38#include <gtest/gtest.h>
56 template <
class G,
class D,
class A>
66 return std::getenv(
"ALEPH_RUN_GRAPH_STRESS") !=
nullptr;
71 const char *
env = std::getenv(
"ALEPH_GRAPH_STRESS_NODES");
76 const unsigned long long v = std::strtoull(
env, &end, 10);
77 if (end ==
env || *end !=
'\0')
80 return static_cast<size_t>(v);
87 GTEST_SKIP() <<
"Set ALEPH_RUN_GRAPH_STRESS=1 (and optionally ALEPH_GRAPH_STRESS_NODES=N) to enable.";
93 std::vector<Node *>
nodes;
96 for (
size_t i = 0; i <
N; ++i)
99 for (
size_t i = 0; i + 1 <
N; ++i)
103 const bool found =
dij.paint_partial_min_paths_tree(g,
nodes.front(),
nodes.back());
106 const int dist =
dij.get_distance(
nodes.back());
Dijkstra's shortest path algorithm.
WeightedDigraph::Node Node
Generic directed graph (digraph) wrapper template.
Spanning tree calculation of all shortest paths from a given node according to Dijkstra's algorithm.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
DynArray< Graph::Node * > nodes
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Default filter for filtered iterators on arcs.
Arc of graph implemented with double-linked adjacency lists.
Filtered iterator of adjacent arcs of a node.
Generic graph and digraph implementations.