|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Example: Karp minimum mean cycle on Aleph digraphs. More...
#include <cmath>#include <iomanip>#include <iostream>#include <string>#include <Min_Mean_Cycle.H>#include <tpl_graph.H>Go to the source code of this file.
Functions | |
| int | main () |
| Example program demonstrating Karp's minimum mean cycle algorithm on Aleph digraphs. | |
Example: Karp minimum mean cycle on Aleph digraphs.
Build and run:
cmake -S . -B build cmake –build build –target min_mean_cycle_example ./build/Examples/min_mean_cycle_example
Definition in file min_mean_cycle_example.cc.
| int main | ( | ) |
Example program demonstrating Karp's minimum mean cycle algorithm on Aleph digraphs.
Constructs a sample directed graph with six nodes (A–F), inserts arcs that create multiple cycles (including an optimal cycle B→D→E→B and a higher-cost cycle C↔F), and runs three variants of the algorithm:
Definition at line 177 of file min_mean_cycle_example.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::karp_minimum_mean_cycle(), Aleph::karp_minimum_mean_cycle_value(), and print_result().