Hello John, > Can anyone point me to some code or module that provides the > appropriate data structures and algorithms to handle this task > efficiently? The size of the list will likely be in the range of > 10-1000 elements. boost (http://www.boost.org) has a graph library and a good connection to Python using Boost.Python. HTH. Miki