Files
Library/tests/package/AlgorithmsOnly/main.cpp

20 lines
503 B
C++

#include <Void/Algorithms/Graph.hpp>
#include <vector>
int main()
{
const std::vector<std::vector<std::size_t>> dag{
{1, 2},
{3},
{3},
{},
};
const Void::Algorithms::AdjacencyView view{dag};
const auto sp = Void::Algorithms::shortest_path_unweighted(view, 0, 3);
const auto topo = Void::Algorithms::topological_order(view);
if (!sp || !sp->found || sp->distance != 2 || !topo || topo->order.size() != 4) {
return 1;
}
return 0;
}