powershell-algorithms
powershell-algorithms copied to clipboard
How about acyclic
How would you implement a CheckCycle method with the Graph class. If I understand the code correctly, you are using GraphVertex.value as they key so duplicate values would make it cyclic.
https://github.com/dfinke/powershell-algorithms/blob/5e1f95b3111adb8c788786f773e63f087ac3d07b/src/data-structures/graph/Graph.ps1#L41
Off the top of my had, maybe use a [System.Collections.Generic.HashSet] instead of an ordered dictionary