[Python-ideas] Graph class

Serhiy Storchaka storchaka at gmail.com
Sat Dec 8 09:07:40 CET 2012


On 07.12.12 23:45, Mark Adam wrote:
> I have a decent semi-recursive Graph class that I think could be a
> good addition to the Collections module.  It probably needs some
> refactoring, but I'm posting here to see if there's any interest.
>
> For those who aren't too abreast of CS theory, a graph is one of the
> most abstract data structures in computer science, encompassing trees,
> and lists. I'm a bit surprised that no one's offered one up yet, so
> I'll present mine.
>
> The code is at http://github.com/theProphet/Social-Garden under the
> pangaia directly called graph.py.  It has a default dictionary
> (defdict.py) dependency that I made before Python came up with it on
> it's own (another place for refactoring).

Graph is too abstract conception. There are a lot of implementations of 
graphs. Every non-trivial program contains some (may be implicit) graphs.

See also for some implementations: Magnus Lie Hetland, "Python 
Algorithms. Mastering Basic Algorithms in the Python Language".




More information about the Python-ideas mailing list