Handling graph objects in Python with NetworkX
The boom of social networks such as Facebook, Twitter, or LinkedIn (among others) has introduced a wide set of problems. Examples of these (but not limited to) are: who is a friend of whom, can I reach a recruiter in that particular company that I would love to work for via my network of friends and associates, am I connected to President Obama in any way, and who is the most influential person in my network?
These types of problems are very common in the present society and any data scientist should know how to tackle them.
In this recipe, we will introduce a fabricated Twitter network of 20 people. You will learn how to create a graph, add nodes and edges (and additional metadata), analyze the graph, and export it so that we can read it using Gephi.
Getting ready
To execute this recipe, you will need NetworkX
, collections
, and Matplotlib
. No other prerequisites are required.
How to do it…
NetworkX
provides you with a framework to build and analyze...