Esempio n. 1
0
 def test_scc(self) -> None:
     vertices = {'A', 'B', 'C', 'D'}
     edges = {'A': ['B', 'C'],
              'B': ['C'],
              'C': ['B', 'D'],
              'D': []}  # type: Dict[str, List[str]]
     sccs = set(frozenset(x) for x in strongly_connected_components(vertices, edges))
     assert_equal(sccs,
                  {frozenset({'A'}),
                   frozenset({'B', 'C'}),
                   frozenset({'D'})})
Esempio n. 2
0
 def test_scc(self) -> None:
     vertices = {'A', 'B', 'C', 'D'}
     edges = {'A': ['B', 'C'],
              'B': ['C'],
              'C': ['B', 'D'],
              'D': []}  # type: Dict[str, List[str]]
     sccs = set(frozenset(x) for x in strongly_connected_components(vertices, edges))
     assert_equal(sccs,
                  {frozenset({'A'}),
                   frozenset({'B', 'C'}),
                   frozenset({'D'})})
Esempio n. 3
0
 def test_scc(self) -> None:
     vertices = {"A", "B", "C", "D"}
     edges: Dict[str, List[str]] = {
         "A": ["B", "C"],
         "B": ["C"],
         "C": ["B", "D"],
         "D": []
     }
     sccs = set(
         frozenset(x)
         for x in strongly_connected_components(vertices, edges))
     assert_equal(
         sccs, {frozenset({'A'}),
                frozenset({'B', 'C'}),
                frozenset({'D'})})
Esempio n. 4
0
 def test_scc(self) -> None:
     vertices = {"A", "B", "C", "D"}
     edges = {"A": ["B", "C"], "B": ["C"], "C": ["B", "D"], "D": []}  # type: Dict[str, List[str]]
     sccs = set(frozenset(x) for x in strongly_connected_components(vertices, edges))
     assert_equal(sccs, {frozenset({"A"}), frozenset({"B", "C"}), frozenset({"D"})})