Exercises
The following is a series of exercises. Answers to all these exercises can be found in the Answers_to_Exercises_Chap10.ipynb
Jupyter Notebook in this book’s GitHub repository:
- The Zachary Karate Club is a well-known network in the field of network science, so much so that a copy of the network is stored in the
NetworkX
package and can be accessed via thekarate_club_graph()
function. Use this function to create the karate club graph and then use thecommunity.greedy_modularity_communities
function to identify the communities within the graph. You can assume that there are two communities, so you should look at how to use thecutoff
andbest_n
parameters of thecommunity.greedy_modularity_communities
function to ensure that only two communities are found. Which nodes do you think are at the center of each of the two communities found? - Use the
scale_free_graph
function of theNetworkX
package to create a scale-free graph with 10,000 nodes. Having generated...