heightLevels accepts graphs with cycles
DavidDTA opened this issue · 2 comments
DavidDTA commented
This is related to #4.
heightLevels
is another function whose result doesn't make sense if the graph has cycles. I think the signature of heightLevels
should be a result like topologicalSort
.
sgraf812 commented
Alright, I redesigned stuff around an AcyclicGraph
abstraction that is returned by a new checkAcyclic
function and also by stronglyConnectedComponents
. This can be passed to topologicalSort
and heightLevels
, making them total.
Does this work for you? If so, I'll make a release to get this out.
DavidDTA commented
That sounds like a good way of handling it to me.