pybel / pybel-tools

A PyBEL extension for analyzing BEL graphs
http://pybel-tools.readthedocs.io/
MIT License
5 stars 5 forks source link

Implement pseudo-topological sort #120

Open cthoyt opened 6 years ago

cthoyt commented 6 years ago

Is there an analogue of the topological sort (only applicable to DAGs) for directed cyclic graphs?

I could imagine some naive procedures for random sampling of DAGs from a directed cyclic graph and calculating an average topological sort position for each node, or using a heuristic and recursive algorithm like here http://lkozma.net/blog/ordering-cyclic-graphs/ that gives a proper integer position to each.

What we'd like to do is take a BEL graph, remove some uninteresting associative edges, then assign a pseudo-topological sort position to each node to quickly allow users to see how "upstream" or "downstream" a node is in a given NeuroMMSig mechanism.

Resources