Generics is a project mainly written in Python, it's free.
Generic algorithms in python
Generic algorithms for python. Only simple graph theoretic algorithms for now.
ucgraph.py
is an Undirected Colored Graph library: your usual undirected unweighted graph where nodes can hold a set of attributes (colors). Nodes can be any python object.
>>> import ucgraph
>>> g=ucgraph.ucgraph()
>>> g.addEdge(0,1)
>>> g.addEdge(1,'e')
>>> g.addEdge('hi','there')
>>> g.connectedComponents()
[set([0, 1, 'e']), set(['hi', 'there'])]