Session Ready
Exercise

Plot degree centrality on projection

Here, you're going to compare the degree centrality distributions for each of the following graphs: the original graph G, the people graph projection peopleG, and the clubs graph projection clubsG. This will reinforce the difference in degree centrality score computation between bipartite and unipartite versions of degree centrality metrics. The node lists people and clubs have been pre-loaded for you.

Recall from the video that the bipartite functions require passing in a container of nodes, but will return all degree centrality scores nonetheless. Remember also that degree centrality scores are stored as dictionaries (mapping node to score).

Instructions
100 XP
  • Plot the degree centrality distribution of the original graph G, using the degree_centrality function from the bipartite module: nx.bipartite.degree_centrality(). It takes in two arguments: The graph G, and one of the node lists (people or clubs).
  • Plot the degree centrality distribution of the peopleG graph, using the normal/non-bipartite degree_centrality function from NetworkX: nx.degree_centrality().
  • Plot the degree centrality distribution of the clubsG graph, using the normal/non-bipartite degree_centrality function from NetworkX: nx.degree_centrality().