i haven't read your code, but there are many graph implementations in python. in case you haven't found these yet: http://wiki.python.org/moin/PythonGraphApi
if you only want to do some analysis i think you need this one (as it's pretty complete and simple): https://networkx.lanl.gov/ i also recommend Guido's essay to read: http://www.python.org/doc/essays/graphs.html -- http://mail.python.org/mailman/listinfo/python-list