Skip to content
Advertisement

Tag: networkx

Fetch connected nodes in a NetworkX graph

Straightforward question: I would like to retrieve all the nodes connected to a given node within a NetworkX graph in order to create a subgraph. In the example shown below, I just want to extract all the nodes inside the circle, given the name of one of any one of them. I’ve tried the following recursive function, but hit Python’s

Combine (join) networkx Graphs

Say I have two networkx graphs, G and H: What is the best way to join the two networkx graphs? I’d like to preserve the node names (note the common nodes, 2 to 7). When I used nx.disjoint_union(G,H), this did not happen: The H node labels were changed (not what I want). I want to join the graphs at the

Interface between networkx and igraph

I’ve been working with networkx for quite some time now and it’s been serving my purposes quite well with minimal tweaks until recently when I started looking into community detection. In comparison, the igraph Python package seems to have a much wider implementations of community detection methods (even compared to networkx with Thomas Aynaud’s community package added on). I’m just

Improving Python NetworkX graph layout

I am having some problems in visualizing the graphs created with python-networkx, I want to able to reduce clutter and regulate the distance between the nodes (I have also tried spring_layout, it just lays out the nodes in an elliptical fashion). Please advise. Parts of code: Answer In networkx, it’s worth checking out the graph drawing algorithms provided by graphviz

Graph traversal with Networkx (Python)

I’m playing a bit with Networkx to manage a graph of dependencies. Let’s say I have this Graph which each letter represent a server So here we can see that before starting A we need to start H and B and to start H we need to start C and then to start B wee need to start C and

Read/Write NetworkX Graph Object

I am trying to deal with a super-massive NetworkX Graph object with hundreds of millions of nodes. I’d like to be able to write it to file as to not consume all my computer memory. However, I need to constantly be searching across existing nodes, updating edges, etc. Is there a good solution for this? I’m not sure how it

Advertisement