Minor project updates and add 2 example datasets
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "algorithm/roditty_zwick.h"
|
#include "algorithm/roditty_zwick.h"
|
||||||
#include "algorithm/tarjan.h"
|
#include "algorithm/tarjan.h"
|
||||||
#include "algorithm/breadth_first_search.h"
|
|
||||||
#include "tree/breadth_first_tree.h"
|
#include "tree/breadth_first_tree.h"
|
||||||
|
|
||||||
using namespace graph;
|
using namespace graph;
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
#ifndef DIRECTED_ACYCLIC_GRAPH_H_
|
|
||||||
#define DIRECTED_ACYCLIC_GRAPH_H_
|
|
||||||
|
|
||||||
#include "digraph.h"
|
|
||||||
|
|
||||||
namespace graph {
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class DirectedAcyclicGraph {
|
|
||||||
public:
|
|
||||||
DirectedAcyclicGraph() = default;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace graph
|
|
||||||
|
|
||||||
#endif
|
|
||||||
1098
resources/dag.txt
Normal file
1098
resources/dag.txt
Normal file
File diff suppressed because it is too large
Load Diff
2615
resources/general.txt
Normal file
2615
resources/general.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,8 @@
|
|||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
|
|
||||||
#include "algorithm/decremental_scc.h"
|
#include "algorithm/decremental_scc.h"
|
||||||
#include "algorithm/decremental_tc.h"
|
#include "algorithm/frigioni.h"
|
||||||
|
#include "algorithm/italiano.h"
|
||||||
|
|
||||||
using namespace graph;
|
using namespace graph;
|
||||||
|
|
||||||
@@ -95,7 +96,7 @@ TEST_SUITE("Decremental algorithms") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Decremental maintenance of the TC 1") {
|
TEST_CASE("Italiano 1") {
|
||||||
// 1 --> 2 --> 5 --> 7 --> 2
|
// 1 --> 2 --> 5 --> 7 --> 2
|
||||||
// 1 --> 4 --> 3 --> 1
|
// 1 --> 4 --> 3 --> 1
|
||||||
// 4 --> 6 --> 3
|
// 4 --> 6 --> 3
|
||||||
@@ -112,19 +113,19 @@ TEST_SUITE("Decremental algorithms") {
|
|||||||
|
|
||||||
REQUIRE_EQ(G.adjMatrix.size(), 7);
|
REQUIRE_EQ(G.adjMatrix.size(), 7);
|
||||||
|
|
||||||
algo::DecrementalTC<std::uint16_t> rz(G);
|
algo::Italiano<std::uint16_t> rz(G);
|
||||||
rz.init();
|
rz.init();
|
||||||
|
|
||||||
SUBCASE("DecrementalTC::query") {
|
SUBCASE("Italiano::query") {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SUBCASE("DecrementalTC::remove") {
|
SUBCASE("Italiano::remove") {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Decremental maintenance of the TC 2") {
|
TEST_CASE("Italiano 2") {
|
||||||
// 1 --> 2 --> 3 --> 1
|
// 1 --> 2 --> 3 --> 1
|
||||||
// 3 --> 4 --> 5 --> 3
|
// 3 --> 4 --> 5 --> 3
|
||||||
// 2 --> 6 --> 7 --> 8 --> 6
|
// 2 --> 6 --> 7 --> 8 --> 6
|
||||||
@@ -152,15 +153,96 @@ TEST_SUITE("Decremental algorithms") {
|
|||||||
|
|
||||||
REQUIRE_EQ(G.adjMatrix.size(), 13);
|
REQUIRE_EQ(G.adjMatrix.size(), 13);
|
||||||
|
|
||||||
algo::DecrementalTC<std::uint16_t> rz(G);
|
algo::Italiano<std::uint16_t> rz(G);
|
||||||
rz.init();
|
rz.init();
|
||||||
|
|
||||||
SUBCASE("DecrementalTC::query") {
|
SUBCASE("Italiano::query") {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SUBCASE("DecrementalTC::remove") {
|
SUBCASE("Italiano::remove") {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Frigioni 1") {
|
||||||
|
// 1 --> 2 --> 3 --> 1
|
||||||
|
// 3 --> 4 --> 5 --> 3
|
||||||
|
// 2 --> 6 --> 7 --> 8 --> 6
|
||||||
|
// 6 --> 9 --> 10 --> 11 --> 12 --> 13 --> 9
|
||||||
|
// 12 --> 10
|
||||||
|
Digraph<std::uint16_t> G;
|
||||||
|
G.insert(1, 2);
|
||||||
|
G.insert(2, 3);
|
||||||
|
G.insert(3, 1);
|
||||||
|
G.insert(3, 4);
|
||||||
|
G.insert(4, 5);
|
||||||
|
G.insert(5, 3);
|
||||||
|
G.insert(2, 6);
|
||||||
|
G.insert(6, 7);
|
||||||
|
G.insert(7, 8);
|
||||||
|
G.insert(7, 9);
|
||||||
|
G.insert(8, 6);
|
||||||
|
G.insert(6, 9);
|
||||||
|
G.insert(9, 10);
|
||||||
|
G.insert(10, 11);
|
||||||
|
G.insert(11, 12);
|
||||||
|
G.insert(12, 13);
|
||||||
|
G.insert(13, 9);
|
||||||
|
G.insert(12, 10);
|
||||||
|
|
||||||
|
REQUIRE_EQ(G.adjMatrix.size(), 13);
|
||||||
|
|
||||||
|
algo::Frigioni<std::uint16_t> rz(G);
|
||||||
|
rz.init();
|
||||||
|
|
||||||
|
SUBCASE("Frigioni::query") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SUBCASE("Frigioni::remove") {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Frigioni 2") {
|
||||||
|
// 1 --> 2 --> 3 --> 1
|
||||||
|
// 3 --> 4 --> 5 --> 3
|
||||||
|
// 2 --> 6 --> 7 --> 8 --> 6
|
||||||
|
// 6 --> 9 --> 10 --> 11 --> 12 --> 13 --> 9
|
||||||
|
// 12 --> 10
|
||||||
|
Digraph<std::uint16_t> G;
|
||||||
|
G.insert(1, 2);
|
||||||
|
G.insert(2, 3);
|
||||||
|
G.insert(3, 1);
|
||||||
|
G.insert(3, 4);
|
||||||
|
G.insert(4, 5);
|
||||||
|
G.insert(5, 3);
|
||||||
|
G.insert(2, 6);
|
||||||
|
G.insert(6, 7);
|
||||||
|
G.insert(7, 8);
|
||||||
|
G.insert(7, 9);
|
||||||
|
G.insert(8, 6);
|
||||||
|
G.insert(6, 9);
|
||||||
|
G.insert(9, 10);
|
||||||
|
G.insert(10, 11);
|
||||||
|
G.insert(11, 12);
|
||||||
|
G.insert(12, 13);
|
||||||
|
G.insert(13, 9);
|
||||||
|
G.insert(12, 10);
|
||||||
|
|
||||||
|
REQUIRE_EQ(G.adjMatrix.size(), 13);
|
||||||
|
|
||||||
|
algo::Frigioni<std::uint16_t> rz(G);
|
||||||
|
rz.init();
|
||||||
|
|
||||||
|
SUBCASE("Frigioni::query") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SUBCASE("Frigioni::remove") {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
14
test/fully_dynamic_test.cc
Normal file
14
test/fully_dynamic_test.cc
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include <doctest/doctest.h>
|
||||||
|
|
||||||
|
#include "algorithm/decremental_scc.h"
|
||||||
|
#include "algorithm/frigioni.h"
|
||||||
|
|
||||||
|
using namespace graph;
|
||||||
|
|
||||||
|
TEST_SUITE("Fully dynamic algorithms") {
|
||||||
|
|
||||||
|
TEST_CASE("Fully dynamic 1") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user