# How to implement weighted centrality in NetworkX

I am using the following code to try implement eigen-vector centrality for a weighted graph G. The nodes represent search terms and the is an edge from node A to node B if someone searches for A and then B. The edge weight is the number of times this happens i.e. the number of time someone searches for A and then searches for B.

import networkx as nx

G = nx.DiGraph()


However I am getting identical scores for each node, the output of the above program is: {1: 0.7071067811865476, 2: 0.7071067811865476}