first commit
This commit is contained in:
31
main.cpp
Normal file
31
main.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
#include "HyperGraph.hpp"
|
||||
|
||||
int main() {
|
||||
HyperGraph g;
|
||||
|
||||
// v0~v7
|
||||
for (int i{0}; i <= 7; ++i) {
|
||||
g.add_vertex(i);
|
||||
}
|
||||
|
||||
// e0: v1, v2
|
||||
g.add_edge({1, 2}, 0);
|
||||
// e1: v2, v6
|
||||
g.add_edge({2, 6}, 1);
|
||||
// e2: v0, v2, v4, v7
|
||||
g.add_edge({0, 2, 4, 7}, 2);
|
||||
// e3: v0, v3, v5, v7
|
||||
g.add_edge({0, 3, 5, 7}, 3);
|
||||
auto res = g.PR();
|
||||
double total = 0;
|
||||
for (const auto &val: res) {
|
||||
total += val;
|
||||
std::cout << val << " ";
|
||||
}
|
||||
std::cout << "\nTotal: " << total << std::endl;
|
||||
|
||||
auto chg = CompressedHyperGraph<int, int>::from_hypergraph(g);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user