Skip to content

Commit

Permalink
Added more test cases for scc
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosmaggioros committed Nov 25, 2024
1 parent 06a3f4a commit e9614a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/graph/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,22 @@ TEST_CASE("Testing scc function for graph class") {
t.add_edge('e', 'd');

REQUIRE(t.scc() == 2);


graph<int> g3("directed");
g3.add_edge(0, 1);
g3.add_edge(1, 2);
g3.add_edge(2, 0);
g3.add_edge(1, 3);
g3.add_edge(3, 4);
g3.add_edge(4, 5);
g3.add_edge(5, 3);
g3.add_edge(3, 6);
g3.add_edge(6, 7);
g3.add_edge(6, 8);
g3.add_edge(8, 6);

REQUIRE(g3.scc() == 4);
}

#define GRAPH_VISUALIZATION_H
Expand Down

0 comments on commit e9614a7

Please sign in to comment.