def test_strongly_connected_components(graph: DirectedGraph) -> None: sccs = graph.strongly_connected_components() scc_nodes = list(chain(*sccs)) nodes = list(graph.nodes()) assert len(scc_nodes) == len(nodes) assert set(scc_nodes) == set(nodes)
def test_strongly_connected_components_is_deterministic( graph: DirectedGraph) -> None: assert iequal( graph.strongly_connected_components(), graph.strongly_connected_components(), strict=True, )