I tried this with the below code but I'm not sure, I need thisASAP - thanks!
In [18]: for i in range (3,21,2): 1.0 0.6666666666666666 0.5 0.4 G = nx.circulant_graph(i, [1])| print (nx.closeness_centrality (G)[0]) 0.3333333333333333 0.2857142857142857 0.25 0.2222222222222222 0.2
Betweenness Centrality in a Line Graph 1 point possible (graded) Consider the undirected line graph on n nodes: the nodes form a straight line. Let the nodes be numbered 1, 2, ..., n. Compute the betweenness centrality of node i (use the formula defined on this page, rather than the one in the lecture video):
Closeness Centrality and Betweenness Centrality The closeness centrality of a node i is the reciprocal of average distance of the node to every other node. Recall that dij is the shortest path length (smallest weight path, in weighted graphs) between node i and j. The closeness centrality of node i is given as G-(n²-1 Σ¹) = dij The measure of "high" or "low" value of closeness centrality is relative. A high closeness centrality C₁, relative to the closeness centrality of the other nodes, indicates that node i is relatively close to all the other nodes. The betweenness centrality measures the extent to which a node lies on paths between other nodes. B₁ = 'st 8Fift 9st where n't is the number of shortest paths between s and t that pass through i and gst is the total number of shortest paths between s and t. Note that this considers both orderings of each pair of nodes, so for undirected graphs, a path counts twice (as it counts both for n and for nig). Closeness Centrality in a Circle Graph 1 point possible (graded) Consider the circle graph of n nodes: the nodes all have degree 2 and are linked to form a circle. Assume that n is odd and that n> 3. Compute the closeness centrality of the nodes.
I tried this with the below code but I'm not sure, I need this ASAP - thanks!
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am