pub fn would_create_cycle(
existing_edges: &[(String, String)],
from: &str,
to: &str,
) -> boolExpand description
Check whether adding edge from → to would create a cycle in the existing
graph. Returns the cycle path if detected.
Uses DFS reachability: a cycle exists iff from is reachable from to
through existing edges.