Add base paper and tarjan's SCC algorithm
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#include <doctest/doctest.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include "graph/graph.h"
|
||||
using namespace graph;
|
||||
#include "algorithm/tarjan.h"
|
||||
|
||||
#include "include/graph.h"
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
TEST_SUITE("Testing Graph.") {
|
||||
using namespace graph;
|
||||
|
||||
TEST_CASE("Insert vertices/edges.") {
|
||||
Graph<std::uint16_t> G;
|
||||
@@ -19,6 +21,12 @@ TEST_SUITE("Testing Graph.") {
|
||||
G.insert(3, 6);
|
||||
G.insert(4, 6);
|
||||
G.insert(5, 6);
|
||||
|
||||
Vertex<std::uint16_t> v1(1);
|
||||
Vertex<std::uint16_t> v2(3);
|
||||
Vertex<std::uint16_t> v3(5);
|
||||
algorithm::Tarjan<std::uint16_t> tarjan(G);
|
||||
tarjan.findSCC();
|
||||
|
||||
// CHECK_EQ(G.connected(1, 5), true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user