rh0dium wrote: > Hi all, > > I need some help on writing a recursive priority function > > Given a list = [ A, B, C, D] > > Where the following constraints are in place: > > A depends on [B, C] > C depends on [B] > > Figure out real order that prioritizes these.
You need a topological sort. http://en.wikipedia.org/wiki/Topological_sort Two Python implementations: http://pypi.python.org/pypi/topsort/0.9 http://www.bitformation.com/art/python_toposort.html Kent -- http://mail.python.org/mailman/listinfo/python-list