JeffreyBenjaminBrown / digraphs-with-text

BSD 3-Clause "New" or "Revised" License
66 stars 5 forks source link

topological sort #2

Open JeffreyBenjaminBrown opened 7 years ago

JeffreyBenjaminBrown commented 7 years ago

Currently when the user requests a set of expressions, the UI presents them in no particular order. The user should be able to specify a list of relationships (using the QNodes /from and /to) and have the UI attempt to order the relationships lexicographically according to those relationships.

Requirements:

A query syntax.

Behavior for unsuccessful orderings.

There is no built-in routine to provide an ordering; there is only one to detect cycles. If a set of nodes has cycles, sort them anyway. When displaying them, attach a decorator to any expressions which follow on-screen something which "ought" to precede them. Allow the user to "unfold" (using tab indentation) such nodes, so that things that ought to follow them are displayed below them as children. For instance, in a graph a -> b -> c -> b, the user would see something like:

a
b
c (ORDER PROBLEM)

and upon unfolding them, would see:

a
b
c (ORDER PROBLEM)
  b

Relevant functions and files: