PandA-2024.02
|
#include <network_flow.hpp>
Data Structures | |
struct | nf_balance_t |
struct | nf_capacity_t |
struct | nf_cost_t |
edge tags More... | |
struct | nf_distance_t |
struct | nf_edge_description_t |
struct | nf_flow_t |
struct | nf_imbalance_t |
struct | nf_index_t |
struct | nf_name_t |
vertex tags More... | |
struct | nf_potential_t |
struct | nf_pseudo_flow_t |
struct | nf_reduced_cost_t |
struct | nf_residual_capacity_t |
struct | nf_vertex_description_t |
Public Types | |
using | network_flow_graph_type = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, vertex_nf_property, edge_nf_property > |
definition of the Network Flow Graph More... | |
Public Member Functions | |
network_flow (int _debug_level) | |
Constructor of the class. More... | |
~network_flow ()=default | |
Destructor of the class. More... | |
bool | successive_shortest_path_algorithm () |
Computes the solution for the min cost flow problem with successive shortest path algorithm. More... | |
void | clear_results () |
Clears results of a previous computation. More... | |
bool | print_graph (const char *file_name="network_flow.dot") |
Prints a textual description of the graph in a .dot file format. More... | |
Private Member Functions | |
std::string | get_vertex_description (network_flow_graph_type::vertex_descriptor vd) |
Generates the description string of the vertex vd. More... | |
std::string | get_edge_description (network_flow_graph_type::edge_descriptor ed) |
Generates the description string of the edge ed. More... | |
void | update_vertex_imbalance (network_flow_graph_type::vertex_descriptor vd) |
Updates the vertex imbalance. More... | |
void | generic_label_correcting_algorithm (network_flow_graph_type::vertex_descriptor source, network_flow_graph_type::vertex_descriptor target, std::vector< network_flow_graph_type::edge_descriptor > *P) |
Implements the generic label correcting algorithm for vertex distances labelling. More... | |
Private Attributes | |
CustomOrderedSet< vertex_pair > | inserted_edges |
int | debug_level |
Definition at line 55 of file network_flow.hpp.
|
private |
Definition at line 161 of file network_flow.hpp.
|
private |
edge properties
Definition at line 150 of file network_flow.hpp.
|
private |
Definition at line 159 of file network_flow.hpp.
|
private |
Definition at line 163 of file network_flow.hpp.
|
private |
Definition at line 152 of file network_flow.hpp.
|
private |
Definition at line 157 of file network_flow.hpp.
|
private |
Definition at line 155 of file network_flow.hpp.
using network_flow::network_flow_graph_type = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, vertex_nf_property, edge_nf_property> |
definition of the Network Flow Graph
Definition at line 168 of file network_flow.hpp.
|
private |
Definition at line 175 of file network_flow.hpp.
|
private |
Definition at line 199 of file network_flow.hpp.
|
private |
Definition at line 201 of file network_flow.hpp.
|
private |
Definition at line 181 of file network_flow.hpp.
|
private |
edge maps
Definition at line 189 of file network_flow.hpp.
|
private |
Definition at line 197 of file network_flow.hpp.
|
private |
Definition at line 177 of file network_flow.hpp.
|
private |
Definition at line 183 of file network_flow.hpp.
|
private |
Definition at line 185 of file network_flow.hpp.
|
private |
Definition at line 179 of file network_flow.hpp.
|
private |
Definition at line 191 of file network_flow.hpp.
|
private |
Definition at line 195 of file network_flow.hpp.
|
private |
Definition at line 193 of file network_flow.hpp.
|
private |
vertex maps
Definition at line 173 of file network_flow.hpp.
|
private |
Definition at line 136 of file network_flow.hpp.
|
private |
vertex properties
Definition at line 134 of file network_flow.hpp.
|
private |
Definition at line 142 of file network_flow.hpp.
|
private |
Definition at line 138 of file network_flow.hpp.
|
private |
Definition at line 144 of file network_flow.hpp.
|
private |
Definition at line 140 of file network_flow.hpp.
|
private |
Definition at line 146 of file network_flow.hpp.
|
private |
Definition at line 270 of file network_flow.hpp.
|
explicit |
Constructor of the class.
debug_level_ | is the debug level |
Definition at line 53 of file network_flow.cpp.
|
default |
Destructor of the class.
void network_flow::clear_results | ( | ) |
Clears results of a previous computation.
Definition at line 419 of file network_flow.cpp.
References edges, initial_value, inserted_edges, network_flow_graph, p_nf_cost, p_nf_distance, p_nf_edge_description, p_nf_flow, p_nf_imbalance, p_nf_potential, p_nf_pseudo_flow, p_nf_reduced_cost, p_nf_residual_capacity, and p_nf_vertex_description.
Referenced by successive_shortest_path_algorithm().
|
private |
Implements the generic label correcting algorithm for vertex distances labelling.
source | is the source vertex |
target | is the target vertex |
P | is the shortest path from source to target |
Definition at line 319 of file network_flow.cpp.
References edges, initial_value, network_flow_graph, p_nf_distance, p_nf_reduced_cost, p_nf_residual_capacity, and lenet_tvm::target.
Referenced by successive_shortest_path_algorithm().
|
private |
Generates the description string of the edge ed.
Called by print_graph function and used to fill the edge_nf_description_property. Useful to printing methods
ed | is the edge |
Definition at line 492 of file network_flow.cpp.
References I2S, p_nf_capacity, p_nf_cost, p_nf_flow, p_nf_pseudo_flow, p_nf_reduced_cost, and p_nf_residual_capacity.
Referenced by print_graph().
|
private |
Generates the description string of the vertex vd.
Called by print_graph function and used to fill the vertex_nf_description_property. Useful to printing methods
vd | is the vertex |
Definition at line 481 of file network_flow.cpp.
References I2S, p_nf_balance, p_nf_distance, p_nf_imbalance, p_nf_index, p_nf_name, and p_nf_potential.
Referenced by print_graph().
bool network_flow::print_graph | ( | const char * | file_name = "network_flow.dot" | ) |
Prints a textual description of the graph in a .dot file format.
file_name | is the name of the text file |
Definition at line 455 of file network_flow.cpp.
References edges, get_edge_description(), get_vertex_description(), network_flow_graph, p_nf_edge_description, and p_nf_vertex_description.
Referenced by successive_shortest_path_algorithm().
bool network_flow::successive_shortest_path_algorithm | ( | ) |
Computes the solution for the min cost flow problem with successive shortest path algorithm.
Definition at line 74 of file network_flow.cpp.
References clear_results(), D, debug_level, DEBUG_LEVEL_MINIMUM, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERBOSE, DEBUG_LEVEL_VERY_PEDANTIC, edges, generic_label_correcting_algorithm(), I2S, initial_value, inserted_edges, k, network_flow_graph, original, P, p_nf_balance, p_nf_capacity, p_nf_cost, p_nf_distance, p_nf_flow, p_nf_imbalance, p_nf_potential, p_nf_pseudo_flow, p_nf_reduced_cost, p_nf_residual_capacity, PRINT_DBG_MEX, print_graph(), lenet_tvm::target, and update_vertex_imbalance().
|
private |
Updates the vertex imbalance.
vd | is the vertex |
Definition at line 394 of file network_flow.cpp.
References network_flow_graph, p_nf_balance, p_nf_imbalance, and p_nf_pseudo_flow.
Referenced by successive_shortest_path_algorithm().
|
private |
Definition at line 273 of file network_flow.hpp.
Referenced by successive_shortest_path_algorithm().
|
private |
Definition at line 271 of file network_flow.hpp.
Referenced by clear_results(), and successive_shortest_path_algorithm().
network_flow_graph_type network_flow::network_flow_graph |
Network flow graph pointer.
Definition at line 205 of file network_flow.hpp.
Referenced by clear_results(), generic_label_correcting_algorithm(), print_graph(), successive_shortest_path_algorithm(), and update_vertex_imbalance().
pmap_nf_balance_t network_flow::p_nf_balance |
Definition at line 211 of file network_flow.hpp.
Referenced by get_vertex_description(), successive_shortest_path_algorithm(), and update_vertex_imbalance().
pmap_nf_capacity_t network_flow::p_nf_capacity |
Definition at line 235 of file network_flow.hpp.
Referenced by get_edge_description(), and successive_shortest_path_algorithm().
pmap_nf_cost_t network_flow::p_nf_cost |
Definition at line 237 of file network_flow.hpp.
Referenced by clear_results(), get_edge_description(), and successive_shortest_path_algorithm().
pmap_nf_distance_t network_flow::p_nf_distance |
Definition at line 217 of file network_flow.hpp.
Referenced by clear_results(), generic_label_correcting_algorithm(), get_vertex_description(), and successive_shortest_path_algorithm().
pmap_nf_edge_description_t network_flow::p_nf_edge_description |
Edge maps variables.
Definition at line 225 of file network_flow.hpp.
Referenced by clear_results(), and print_graph().
pmap_nf_flow_t network_flow::p_nf_flow |
Definition at line 233 of file network_flow.hpp.
Referenced by clear_results(), get_edge_description(), and successive_shortest_path_algorithm().
pmap_nf_imbalance_t network_flow::p_nf_imbalance |
Definition at line 213 of file network_flow.hpp.
Referenced by clear_results(), get_vertex_description(), successive_shortest_path_algorithm(), and update_vertex_imbalance().
pmap_nf_index_t network_flow::p_nf_index |
Definition at line 219 of file network_flow.hpp.
Referenced by get_vertex_description().
pmap_nf_name_t network_flow::p_nf_name |
Definition at line 221 of file network_flow.hpp.
Referenced by get_vertex_description().
pmap_nf_potential_t network_flow::p_nf_potential |
Definition at line 215 of file network_flow.hpp.
Referenced by clear_results(), get_vertex_description(), and successive_shortest_path_algorithm().
pmap_nf_pseudo_flow_t network_flow::p_nf_pseudo_flow |
Definition at line 227 of file network_flow.hpp.
Referenced by clear_results(), get_edge_description(), successive_shortest_path_algorithm(), and update_vertex_imbalance().
pmap_nf_reduced_cost_t network_flow::p_nf_reduced_cost |
Definition at line 231 of file network_flow.hpp.
Referenced by clear_results(), generic_label_correcting_algorithm(), get_edge_description(), and successive_shortest_path_algorithm().
pmap_nf_residual_capacity_t network_flow::p_nf_residual_capacity |
Definition at line 229 of file network_flow.hpp.
Referenced by clear_results(), generic_label_correcting_algorithm(), get_edge_description(), and successive_shortest_path_algorithm().
pmap_nf_vertex_description_t network_flow::p_nf_vertex_description |
Vertex maps variables.
Definition at line 209 of file network_flow.hpp.
Referenced by clear_results(), and print_graph().