Python Graph Library

PythonGraph

Python Problem Overview


I'm writing a python application that will make heavy use of a graph data structure. Nothing horribly complex, but I'm thinking some sort of graph/graph-algorithms library would help me out. I've googled around, but I don't find anything that particularly leaps out at me.

Anyone have any good recommendations?

Python Solutions


Solution 1 - Python

There are two excellent choices:

NetworkX

and

igraph

I like NetworkX, but I read good things about igraph as well. I routinely use NetworkX with graphs with 1 million nodes with no problem (it's about double the overhead of a dict of size V + E)

If you want a feature comparison, see this from the Networkx-discuss list

Feature comparison thread

Solution 2 - Python

I would like to plug my own graph python library: graph-tool.

It is very fast, since it is implemented in C++ with the Boost Graph Library, and it contains lots of algorithms and extensive documentation.

Solution 3 - Python

Have you looked at python-graph? I haven't used it myself, but the project page looks promising.

Solution 4 - Python

Also, you might want to take a look at NetworkX

Solution 5 - Python

Take a look at this page on implementing graphs in python.

You could also take a look at pygraphlib on sourceforge.

Solution 6 - Python

Solution 7 - Python

I'm having the most luck with pydot. Some of the others are hard to install and configure on different platforms like Win 7.

http://code.google.com/p/pydot/

Solution 8 - Python

I second zweiterlinde's suggestion to use python-graph. I've used it as the basis of a graph-based research project that I'm working on. The library is well written, stable, and has a good interface. The authors are also quick to respond to inquiries and reports.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncpatrickView Question on Stackoverflow
Solution 1 - PythonGregg LindView Answer on Stackoverflow
Solution 2 - PythonTiago PeixotoView Answer on Stackoverflow
Solution 3 - PythonzweiterlindeView Answer on Stackoverflow
Solution 4 - PythonlmountView Answer on Stackoverflow
Solution 5 - PythonBrian R. BondyView Answer on Stackoverflow
Solution 6 - PythonFrankView Answer on Stackoverflow
Solution 7 - PythonsyvexView Answer on Stackoverflow
Solution 8 - PythonjtguerinView Answer on Stackoverflow