I want to choose any given node and build a subgraph for that node based on what distance degree I want. I need to input a node's ID, and specify the degree ( 1 = only direct friends, 2 = direct friends, and friends of friends, 3 = direct friends, friends of friends, friends of friends of friends and so on...) and generate a subgraph for that node's social network to that degree.
Does anyone know a good way to do this in networkx?
I found the feature I'm looking for like, right after I posted this. It is the networkx ego_graph feature. networkx.github.io/documentation/networkx-1.10/reference/
Generating NetworkX subgraphs based on distance