47#include <gtest/gtest.h>
63std::vector<int>
node_keys(
const std::vector<typename GT::Node *> &
nodes)
65 std::vector<int>
keys;
68 keys.push_back(n->get_info());
79 for (
int i = 0; i < 5; ++i)
102 "Graph_Traverse_Generator::traverse() must reject rvalue (temporary) receivers");
105 "Graph_Traverse_Generator::traverse() must still accept lvalue receivers");
113 std::vector<int>
seen;
115 seen.push_back(v->get_info());
129 std::invalid_argument);
134 std::vector<TestGraph::Node *>
nodes;
138 std::vector<int>
seen;
140 seen.push_back(v->get_info());
144 (std::set<int>{0, 1, 2, 3, 4}));
150 std::vector<TestGraph::Node *>
nodes;
170 std::vector<TestGraph::Node *>
nodes;
192 std::vector<TestGraph::Node *>
nodes;
193 for (
int i = 0; i < 5; ++i)
200 std::vector<int>
seen;
202 seen.push_back(v->get_info());
209 std::vector<TestGraph::Node *>
nodes;
262 std::vector<int>
seen;
265 seen.push_back(n->get_info());
273 std::vector<TestGraph::Node *>
nodes;
274 for (
int i = 0; i < 4; ++i)
282 std::vector<int>
seen;
284 seen.push_back(v->get_info());
294 std::vector<TestDigraph::Node *>
nodes;
295 for (
int i = 0; i < 3; ++i)
296 nodes.push_back(g.insert_node(i));
301 std::vector<int>
from0;
303 from0.push_back(v->get_info());
307 std::vector<int>
from2;
309 from2.push_back(v->get_info());
Generic directed graph (digraph) wrapper template.
typename BaseGraph::Node Node
Lazily traverse a graph depth-first or breadth-first.
Aleph::Generator< typename GT::Node * > traverse(typename GT::Node *start) &
Lazily traverse the graph from start.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
NodeInfo & get_info() noexcept
Return a modifiable reference to the data contained in the node.
Traverse a graph depth-first or breadth-first and execute a visit function.
Lazy (coroutine-based) graph traversal (DFS, BFS).
Graph traversal algorithms (DFS, BFS).
DynArray< Graph::Node * > nodes
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Arc of graph implemented with double-linked adjacency lists.
Filtered iterator of adjacent arcs of a node.
Generic graph and digraph implementations.