How to ignore cycles in a topological sort?
I am using this library to perform a topological sort on a graph in JS.
The problem is that in some rare cases the graph will contain cycles.
Those are a minor part of the structure, so dropping a few edges would not
affect the final result considerably. Yet the algorithm just breaks when
they appear. What is the most efficient way to update it so it won't crash
if there is a cycle or two?
No comments:
Post a Comment