toposort icon indicating copy to clipboard operation
toposort copied to clipboard

Allow passing a sort function as a tie breaker

Open Graham42 opened this issue 6 years ago • 0 comments

I'm not sure how difficult this would be. But it would be nice to be able to pass a sort function that would act as a tie breaker so that the final order would always be deterministic.

Case: A and B both depend on C

  A
 /
C
 \
  B

if edges are passed as

[  [c, a],  [c, b] ]

vs

[  [c, b],  [c, a] ]

The result is different.

Graham42 avatar Dec 12 '17 21:12 Graham42