Social network analysis is the process of investigating the structure of a social network. With the analysis, we may benefit users and advertisers in the social network. For example, with the limited budget, advertisers may choose certain users who most probably share the information of products with their friends. The information of products can reach as many people as possible with the limited budget.
In this task, we want to investigate some properties of a social network, where nodes represent users, and directed edges mean that users can propagate information in that direction.
The following graph shows what a social network looks like in this task.
We use the matrix to represent the network.

The directed edge from node2 to node1 means node2 can propagate the information to node1.
Node2 can also propagate information to node0 : First propagate the information to node4, and then node4 propagates to node0.
Node1 can not propagate the information to node2 because there are no path from node1 to node2.
The weights of edges represent the difficulty of propagating the information. Smaller difficulty value means that the information is more likely to be propagate.
The difficulty of a propagation path is determined by summing up the difficulty values of edges in the path.
For example, node2 can propagate information to node3 with the propagation path:
2->4->0->3
The difficulty of the path:
7+1+3 = 11
In this task, we want to find out least difficult paths (propagation paths with least difficulty) of each node pair in a given network.
Besides the propagation path, we also want to find out the most important nodes in the network. We use centrality to measure the importance of each node. One of the measurement is harmonic centrality.
The definition of harmonic centrality:

x is the node that we want to know its centrality, while y can be any other nodes in the network. d(y,x) means the difficulty of the least difficult path from y to x in our task. If there are no paths from y to x, 1/d(y,x) is 0.
For example, the least difficult paths to node0 are:
Path(1,0): no path
Path(2,0): 2->4->0 (difficulty = 8)
Path(3,0): no path
Path(4,0): 4->0 (difficulty = 1)
So, the harmonic centrality of node0 is:
0 + 1/8 + 0 + 1 = 0 + 0.125 + 0 + 1 = 1.125
In this task, we also want to find out the harmonic centrality of each node.

