@@ -946,6 +946,16 @@ the graph.
946946Consider the following simple example.
947947
948948``` {code-cell} ipython3
949+ ---
950+ mystnb:
951+ figure:
952+ caption: "Sample Graph"
953+ name: sample_gph_1
954+ image:
955+ alt: sample_gph_1
956+ classes: shadow bg-primary
957+ width: 200px
958+ ---
949959G7 = nx.DiGraph()
950960
951961G7.add_nodes_from(['1','2','3','4','5','6','7'])
@@ -1025,7 +1035,7 @@ plt.show()
10251035Unfortunately, while in-degree and out-degree centrality are simple to
10261036calculate, they are not always informative.
10271037
1028- In * add numref* , an edge exists between almost every node,
1038+ In { numref} ` financial_network ` , an edge exists between almost every node,
10291039so the in- or out-degree based centrality ranking fails to effectively separate the countries.
10301040
10311041This can be seen in the above graph as well.
@@ -1129,10 +1139,10 @@ def eigenvector_centrality(A, k=40, authority=False):
11291139 return e / np.sum(e)
11301140```
11311141
1132- Let us compute eigenvector centrality for the graph generated in * add numref* .
1142+ Let us compute eigenvector centrality for the graph generated in { numref} ` sample_gph_1 ` .
11331143
11341144``` {code-cell} ipython3
1135- A = nx.to_numpy_array(G7) #compute adjacency matrix of graph
1145+ A = nx.to_numpy_array(G7) # compute adjacency matrix of graph
11361146```
11371147
11381148``` {code-cell} ipython3
@@ -1146,7 +1156,7 @@ for i in range(n):
11461156While nodes $2$ and $4$ had the highest in-degree centrality we can see that nodes $1$ and $2$ have the
11471157highest eigenvector centrality.
11481158
1149- Let's once again revisit the international credit network in * add numref* .
1159+ Let's once again revisit the international credit network in { numref} ` financial_network ` .
11501160
11511161``` {code-cell} ipython3
11521162eig_central = eigenvector_centrality(Z)
@@ -1287,7 +1297,7 @@ Element-by-element, this is given by
12871297We see $e_j$ will be high if many nodes with high authority rankings link to $j$.
12881298
12891299The following figurenshows the authority-based eigenvector centrality ranking for the international
1290- credit network shown in * add numref* .
1300+ credit network shown in { numref} ` financial_network ` .
12911301
12921302``` {code-cell} ipython3
12931303ecentral_authority = eigenvector_centrality(Z, authority=True)
0 commit comments