dito above.. I couldn’t find anything in the NetworkX docs… In Python Igraph, i can just use: Answer Event though I came too late I want to contribute with my proposal, since I was looking for the same answer: I am also looking for a command in the networkx package to find the “sources” and the “targets” of a Directed
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
I’m trying to perform the transitive reduction of directed graph in Python
As a warning, I’m still a bit inexperienced in python I’m trying to perform the transitive reduction of directed graph using the networkx library. I’ve figured out an algorithm but I’m having trouble implementing it. After a quick search, I found algorithms similar to mine in other stack exchange questions but no demonstrations of how to actually code the algorithm.
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
(Python) ValueError: Program dot not found in path
I have the following problem: I am on xUbuntu OS and I am trying to use networkx in a Flask application, and I am having the following code: The last line is line 411. I get the following error: What could be causing this problem? I’ve installed networkx and pygraphviz, but I still get this error. Any ideas how to
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