4#include <gtest/gtest.h>
42 int operator()(LG::Arc * a)
const {
return a->
get_info(); }
45 struct NonArithmeticCost
51 using Distance_Type = Cost;
52 Cost operator()(LG::Arc *)
const {
return {}; }
85concept can_yen =
requires(
const LG & g, LG::Node * n,
D d) {
139 auto * a = g.insert_node(1);
140 auto * b = g.insert_node(2);
141 g.insert_arc(a, b, 4);
142 g.insert_arc(a, b, 7);
143 auto even = [](LG::Arc * arc) {
return arc->get_info() % 2 == 0; };
151 {
return s + arc->get_info(); })), 11);
162 auto * a = g.insert_node(1);
163 auto * b = g.insert_node(2);
164 auto * c = g.insert_node(3);
165 g.insert_arc(a, b, 2);
166 g.insert_arc(b, c, 3);
167 g.insert_arc(a, c, 9);
Dijkstra's shortest path algorithm.
Johnson's algorithm for all-pairs shortest paths.
K-shortest path algorithms (Yen and Eppstein-style API).
Kruskal's minimum spanning tree algorithm.
C++20 concepts for the protocol shared by graph algorithms.
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.
Arc for graphs implemented with simple adjacency lists.
Graph serialization and deserialization class.
Computes the minimum spanning tree of a graph using Kruskal's algorithm.
Graph implemented with double-linked adjacency lists.
_Graph_Node Node
The graph type.
Graph class implemented with singly-linked adjacency lists.
ArcInfo & get_info() noexcept
Return a modifiable reference to the arc data.
void for_each_node(const GT &g, Op operation, SN sn=SN())
Traverse all the nodes of graph filtering some ones according to a condition and executing an operati...
void clear_graph(GT &g) noexcept
Clean a graph: all its nodes and arcs are removed and freed.
void for_each_arc(const GT &g, Op operation, SA sa=SA())
Traverse all the arcs of graph filtering some ones according to a condition and executing an operatio...
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
void copy_graph(GT >gt, const GT &gsrc, bool cookie_map=false)
Explicit copy of graph.
Graph serialization and deserialization utilities.
Main namespace for Aleph-w library functions.
size_t size(Node *root) noexcept
Net::Flow_Type dinic_maximum_flow(Net &net)
Compute maximum flow using Dinic's algorithm.
and
Check uniqueness with explicit hash + equality functors.
bool are_equal(const GT &g1, const GT &g2)
Fast graph comparison.
Default arc loading functor for binary and text modes.
Default arc storage functor for binary and text modes.
Default node storage functor for binary and text modes.
Arc of graph implemented with double-linked adjacency lists.
Arc of a flow network implemented with adjacency lists.
Flow network implemented with adjacency lists.
Array-based graph implementation.
Generic graph and digraph implementations.
Graph indexing utilities for O(log n) node/arc lookup.
Advanced maximum flow algorithms.
Network flow graph structures.
Simple graph implementation with adjacency lists.