|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Network Simplex algorithm for minimum cost flow. More...
#include <tpl_netcost.H>
Public Types | |
| using | Node = typename Net::Node |
| using | Arc = typename Net::Arc |
| using | Flow_Type = typename Net::Flow_Type |
| using | Node_Info = Simplex_Node_Info< Flow_Type > |
| using | Arc_Info = Simplex_Arc_Info< Flow_Type > |
Public Member Functions | |
| Network_Simplex (Net &network) | |
| Construct Network Simplex solver. | |
| void | set_lower_bound (Arc *a, Flow_Type lower_bound) |
| Set lower bound for an arc. | |
| Flow_Type | get_lower_bound (Arc *a) const |
| Get lower bound for an arc. | |
| bool | is_at_lower_bound (Arc *a) const |
| Check if arc flow is at lower bound. | |
| bool | is_at_upper_bound (Arc *a) const |
| Check if arc flow is at upper bound (capacity). | |
| Flow_Type | residual_capacity (Arc *a) const |
| Get residual capacity (room to increase flow). | |
| Flow_Type | residual_lower (Arc *a) const |
| Get residual lower (room to decrease flow). | |
| size_t | run (Flow_Type unused=0) |
| Execute Network Simplex algorithm. | |
| size_t | get_num_pivots () const |
| Return number of pivots performed in last run. | |
| const NetworkSimplexStats & | get_stats () const noexcept |
| Return execution statistics from last run. | |
| void | print_stats () const |
| Print execution statistics to stdout. | |
| size_t | force_partial_arcs_into_tree () |
| Phase I: Force all partial-flow arcs into the spanning tree. | |
| bool | is_valid_basic_solution () const |
| Check if current solution is a valid basic feasible solution. | |
| size_t | count_non_tree_partial_arcs () const |
| Count arcs with partial flow not in tree. | |
| bool | verify_tree_reduced_costs () const |
| Verify that tree arcs have zero reduced cost. | |
| bool | verify_tree_integrity () const |
| Verify tree integrity - all parent_arcs should be Tree arcs. | |
| void | print_diagnostics () const |
| Print diagnostic information about current state. | |
Private Member Functions | |
| Node_Info & | ninfo (Node *p) |
| Get node info reference. | |
| const Node_Info & | ninfo (Node *p) const |
| Get node info const reference. | |
| Arc_Info & | ainfo (Arc *a) |
| Get arc info reference. | |
| const Arc_Info & | ainfo (Arc *a) const |
| Get arc info const reference. | |
| Node * | parent (Node *p) const |
| Get parent node. | |
| Arc * | parent_arc (Node *p) const |
| Get parent arc. | |
| long | depth (Node *p) const |
| Get depth. | |
| Flow_Type | potential (Node *p) const |
| Get potential. | |
| bool | is_zero (Flow_Type x) const |
| Check if value is effectively zero. | |
| Flow_Type | reduced_cost (Arc *a) const |
| Compute reduced cost of an arc. | |
| void | init_structures () |
| Initialize data structures. | |
| bool | is_partial_flow (Arc *a) const |
| Check if arc has partial flow (strictly between bounds). | |
| void | build_spanning_tree () |
| Build initial spanning tree from source. | |
| Arc * | find_entering_arc () |
| Find entering arc using most negative reduced cost. | |
| Node * | find_lca (Node *u, Node *v) |
| Find the lowest common ancestor of two nodes. | |
| bool | augment_and_find_leaving (Arc *entering, Flow_Type &delta, Arc *&leaving, bool &leaving_goes_lower) |
| Augment flow around the cycle and find leaving arc. | |
| void | pivot_tree (Arc *entering, Arc *leaving, bool leaving_goes_lower) |
| Update tree structure after pivot. | |
Static Private Member Functions | |
| static Flow_Type | eps () |
| Epsilon for floating-point comparisons. | |
Private Attributes | |
| Net & | net |
| DynArray< Node_Info > | node_info |
| DynArray< Arc_Info > | arc_info |
| DynMapTree< Node *, size_t > | node_to_idx |
| DynMapTree< Arc *, size_t > | arc_to_idx |
| Node * | root = nullptr |
| size_t | num_pivots = 0 |
| long | lca_mark = 0 |
| NetworkSimplexStats | stats |
| bool | support_lower_bounds = false |
Static Private Attributes | |
| static constexpr Flow_Type | Inf = std::numeric_limits<Flow_Type>::max() |
Network Simplex algorithm for minimum cost flow.
This class implements the Network Simplex algorithm, a specialized version of the Simplex method for minimum cost network flow problems. It maintains a spanning tree of basic arcs and iteratively improves the solution through pivoting operations.
The algorithm uses a two-phase approach:
After Ford-Fulkerson, some arcs may have partial flow (0 < flow < cap). For a valid basic solution, these arcs MUST be in the spanning tree (non-basic arcs must be at their bounds). Phase I forces all partial-flow arcs into the tree through pivots.
Standard Network Simplex that iteratively:
This implementation follows the presentation in Sedgewick's "Algorithms" with some adaptations for the Aleph-w graph representation and the addition of Phase I to handle the basic feasibility requirement.
The algorithm assumes the network already has a feasible flow (typically from a max-flow algorithm like Ford-Fulkerson). It then optimizes the cost while maintaining the same flow value.
| Net | Network type (must be Net_Cost_Graph or compatible). |
Definition at line 1040 of file tpl_netcost.H.
Definition at line 1044 of file tpl_netcost.H.
| using Aleph::Network_Simplex< Net >::Arc_Info = Simplex_Arc_Info<Flow_Type> |
Definition at line 1047 of file tpl_netcost.H.
Definition at line 1045 of file tpl_netcost.H.
Definition at line 1043 of file tpl_netcost.H.
| using Aleph::Network_Simplex< Net >::Node_Info = Simplex_Node_Info<Flow_Type> |
Definition at line 1046 of file tpl_netcost.H.
|
inlineexplicit |
Construct Network Simplex solver.
| [in,out] | network | The network to optimize. |
Definition at line 1765 of file tpl_netcost.H.
Get arc info reference.
Definition at line 1079 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::arc_info, Aleph::Network_Simplex< Net >::arc_to_idx, and Aleph::DynMapTree< Key, Data, Tree, Compare >::find().
Referenced by Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), Aleph::Network_Simplex< Net >::get_lower_bound(), Aleph::Network_Simplex< Net >::is_at_lower_bound(), Aleph::Network_Simplex< Net >::is_valid_basic_solution(), Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::Network_Simplex< Net >::print_diagnostics(), Aleph::Network_Simplex< Net >::residual_lower(), Aleph::Network_Simplex< Net >::run(), Aleph::Network_Simplex< Net >::set_lower_bound(), Aleph::Network_Simplex< Net >::verify_tree_integrity(), and Aleph::Network_Simplex< Net >::verify_tree_reduced_costs().
|
inlineprivate |
Get arc info const reference.
Definition at line 1082 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::arc_info, Aleph::Network_Simplex< Net >::arc_to_idx, and Aleph::DynMapTree< Key, Data, Tree, Compare >::find().
|
inlineprivate |
Augment flow around the cycle and find leaving arc.
When entering arc is added, it creates a cycle. This function:
For a valid cycle that allows flow redistribution, we need arcs going in both directions (considering the entering arc). If all arcs in the cycle go in the same "global" direction (e.g., all from source towards sink), then we cannot redistribute flow without changing the total flow value.
| [in] | entering | The entering arc. |
| [out] | delta | Flow change amount. |
| [out] | leaving | The leaving arc (becomes non-basic). |
| [out] | leaving_goes_lower | True if leaving arc goes to lower bound. |
Definition at line 1394 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Simplex_Node_Info< Ftype >::arc_from_parent, Aleph::Network_Simplex< Net >::find_lca(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::ninfo(), Aleph::Network_Simplex< Net >::parent(), Aleph::Network_Simplex< Net >::parent_arc(), and Aleph::Simplex_Arc_Info< Ftype >::state.
Referenced by Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), and Aleph::Network_Simplex< Net >::run().
|
inlineprivate |
Build initial spanning tree from source.
Creates a spanning tree rooted at the source node and computes initial potentials. Prioritizes arcs with partial flow.
Non-tree arcs are classified as Lower or Upper based on their current flow relative to capacity.
Definition at line 1161 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::DynList< T >::append(), Aleph::Simplex_Node_Info< Ftype >::depth, Aleph::Network_Simplex< Net >::depth(), Aleph::Network_Simplex< Net >::eps(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::DynListQueue< T >::is_empty(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::Network_Simplex< Net >::ninfo(), Aleph::Simplex_Node_Info< Ftype >::potential, Aleph::DynListQueue< T >::put(), Aleph::Network_Simplex< Net >::reduced_cost(), Aleph::Network_Simplex< Net >::root, Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Tree, Aleph::Upper, and GraphCommon< GT, Node, Arc >::vsize().
Referenced by Aleph::Network_Simplex< Net >::run().
|
inline |
Count arcs with partial flow not in tree.
Definition at line 2058 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::count(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::maps(), Aleph::Network_Simplex< Net >::net, and Aleph::Tree.
Referenced by Aleph::Network_Simplex< Net >::run().
Get depth.
Definition at line 1091 of file tpl_netcost.H.
References Aleph::Simplex_Node_Info< Ftype >::depth, and Aleph::Network_Simplex< Net >::ninfo().
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree().
Epsilon for floating-point comparisons.
Definition at line 1064 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), Aleph::Network_Simplex< Net >::is_at_lower_bound(), Aleph::Network_Simplex< Net >::is_at_upper_bound(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::Network_Simplex< Net >::is_zero(), Aleph::Network_Simplex< Net >::print_diagnostics(), Aleph::Network_Simplex< Net >::run(), and Aleph::Network_Simplex< Net >::verify_tree_reduced_costs().
|
inlineprivate |
Find entering arc using most negative reduced cost.
Scans all non-tree arcs and selects the one with the largest violation of the optimality conditions:
This implementation checks BOTH directions for each arc:
This is essential for finding all negative cycles, including those that require reversing flow through arcs with flow > 0.
Definition at line 1298 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::eps(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::reduced_cost(), Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Tree, and Aleph::Upper.
Referenced by Aleph::Network_Simplex< Net >::run().
|
inlineprivate |
Find the lowest common ancestor of two nodes.
Uses marking to efficiently find the LCA in O(d) where d is depth.
| [in] | u | First node. |
| [in] | v | Second node. |
Definition at line 1355 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::lca_mark, Aleph::maps(), Aleph::Simplex_Node_Info< Ftype >::mark, Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Network_Simplex< Net >::parent().
Referenced by Aleph::Network_Simplex< Net >::augment_and_find_leaving().
|
inline |
Phase I: Force all partial-flow arcs into the spanning tree.
For a valid basic feasible solution in Network Simplex, all arcs with flow strictly between bounds (0 < flow < cap) MUST be in the spanning tree. Non-basic arcs must be at their bounds.
This method identifies arcs with partial flow that are not in the tree and forces pivots to include them. Each pivot replaces one tree arc with the entering arc, maintaining exactly N-1 tree arcs.
Definition at line 1960 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::eps(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Tree, and Aleph::Upper.
Referenced by Aleph::Network_Simplex< Net >::run().
|
inline |
Get lower bound for an arc.
| [in] | a | Arc to query. |
Definition at line 1788 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), and Aleph::Simplex_Arc_Info< Ftype >::lower_bound.
|
inline |
Return number of pivots performed in last run.
Definition at line 1926 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::num_pivots.
|
inlinenoexcept |
Return execution statistics from last run.
Definition at line 1929 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::stats.
|
inlineprivate |
Initialize data structures.
Definition at line 1117 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::arc_info, Aleph::Network_Simplex< Net >::arc_to_idx, Aleph::DynSetTree< Key, Tree, Compare >::empty(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::Lower, Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::node_info, Aleph::Network_Simplex< Net >::node_to_idx, and Aleph::Simplex_Arc_Info< Ftype >::state.
Referenced by Aleph::Network_Simplex< Net >::run().
Check if arc flow is at lower bound.
| [in] | a | Arc to check. |
Definition at line 1798 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::eps(), and Aleph::lower_bound().
Check if arc flow is at upper bound (capacity).
| [in] | a | Arc to check. |
Definition at line 1808 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::eps().
|
inlineprivate |
Check if arc has partial flow (strictly between bounds).
Definition at line 1148 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::eps(), and Aleph::maps().
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), and Aleph::Network_Simplex< Net >::is_valid_basic_solution().
|
inline |
Check if current solution is a valid basic feasible solution.
A valid BFS requires:
Definition at line 2042 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::Network_Simplex< Net >::net, and Aleph::Tree.
Check if value is effectively zero.
Definition at line 1097 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::eps().
Get node info reference.
Definition at line 1073 of file tpl_netcost.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::Network_Simplex< Net >::node_info, and Aleph::Network_Simplex< Net >::node_to_idx.
Referenced by Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::depth(), Aleph::Network_Simplex< Net >::find_lca(), Aleph::Network_Simplex< Net >::parent(), Aleph::Network_Simplex< Net >::parent_arc(), Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::Network_Simplex< Net >::potential(), and Aleph::Network_Simplex< Net >::reduced_cost().
|
inlineprivate |
Get node info const reference.
Definition at line 1076 of file tpl_netcost.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), Aleph::Network_Simplex< Net >::node_info, and Aleph::Network_Simplex< Net >::node_to_idx.
Get parent node.
Definition at line 1085 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Simplex_Node_Info< Ftype >::parent.
Referenced by Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::find_lca(), and Aleph::Network_Simplex< Net >::pivot_tree().
|
inlineprivate |
Get parent arc.
Definition at line 1088 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Simplex_Node_Info< Ftype >::parent_arc.
Referenced by Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::pivot_tree(), and Aleph::Network_Simplex< Net >::verify_tree_integrity().
|
inlineprivate |
Update tree structure after pivot.
Replaces the leaving arc with the entering arc and updates parent pointers, depths, and potentials.
| [in] | entering | The entering arc. |
| [in] | leaving | The leaving arc. |
| [in] | leaving_goes_lower | True if leaving goes to lower bound. |
Definition at line 1602 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::DynListQueue< T >::get(), LocateFunctions< Container, Type >::get_it(), Aleph::DynList< T >::insert(), Aleph::DynListQueue< T >::is_empty(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::next(), Aleph::Network_Simplex< Net >::ninfo(), Aleph::Network_Simplex< Net >::parent(), Aleph::Network_Simplex< Net >::parent_arc(), Aleph::DynListQueue< T >::put(), Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Tree, and Aleph::Upper.
Referenced by Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), and Aleph::Network_Simplex< Net >::run().
|
inlineprivate |
Get potential.
Definition at line 1094 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Simplex_Node_Info< Ftype >::potential.
|
inline |
Print diagnostic information about current state.
Definition at line 2115 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::eps(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Lower, Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::reduced_cost(), Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Tree, Aleph::Upper, Aleph::Network_Simplex< Net >::verify_tree_reduced_costs(), and GraphCommon< GT, Node, Arc >::vsize().
|
inline |
Print execution statistics to stdout.
Definition at line 1932 of file tpl_netcost.H.
References Aleph::NetworkSimplexStats::degenerate_pivots, Aleph::NetworkSimplexStats::forced_into_tree, Aleph::NetworkSimplexStats::initial_partial_arcs, Aleph::Network_Simplex< Net >::net, Aleph::NetworkSimplexStats::phase1_pivots, Aleph::NetworkSimplexStats::phase1_time_ms, Aleph::NetworkSimplexStats::phase2_pivots, Aleph::NetworkSimplexStats::phase2_time_ms, Aleph::Network_Simplex< Net >::stats, Aleph::NetworkSimplexStats::total_pivots, Aleph::NetworkSimplexStats::total_time_ms, Aleph::NetworkSimplexStats::tree_arcs, and GraphCommon< GT, Node, Arc >::vsize().
|
inlineprivate |
Compute reduced cost of an arc.
Reduced cost = c_ij - pi_i + pi_j For optimality: reduced cost >= 0 for arcs at lower bound (flow = 0) reduced cost <= 0 for arcs at upper bound (flow = cap)
Definition at line 1109 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Simplex_Node_Info< Ftype >::potential.
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Network_Simplex< Net >::print_diagnostics(), and Aleph::Network_Simplex< Net >::verify_tree_reduced_costs().
|
inline |
Get residual capacity (room to increase flow).
| [in] | a | Arc to query. |
Definition at line 1818 of file tpl_netcost.H.
|
inline |
Get residual lower (room to decrease flow).
| [in] | a | Arc to query. |
Definition at line 1828 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), and Aleph::Simplex_Arc_Info< Ftype >::lower_bound.
Execute Network Simplex algorithm.
Computes minimum cost flow. If the network already has a feasible flow (e.g., from Ford-Fulkerson), it optimizes starting from there.
| [in] | unused | Kept for API compatibility. |
Definition at line 1843 of file tpl_netcost.H.
References ah_domain_error_if, Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::NetworkSimplexStats::degenerate_pivots, Aleph::Network_Simplex< Net >::eps(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), Aleph::NetworkSimplexStats::forced_into_tree, Aleph::Network_Simplex< Net >::init_structures(), Aleph::NetworkSimplexStats::initial_partial_arcs, Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::num_pivots, Aleph::NetworkSimplexStats::phase1_pivots, Aleph::NetworkSimplexStats::phase1_time_ms, Aleph::NetworkSimplexStats::phase2_pivots, Aleph::NetworkSimplexStats::phase2_time_ms, Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::NetworkSimplexStats::reset(), Aleph::Simplex_Arc_Info< Ftype >::skip, Aleph::Simplex_Arc_Info< Ftype >::state, Aleph::Network_Simplex< Net >::stats, Aleph::NetworkSimplexStats::total_pivots, Aleph::NetworkSimplexStats::total_time_ms, Aleph::Tree, Aleph::NetworkSimplexStats::tree_arcs, and GraphCommon< GT, Node, Arc >::vsize().
|
inline |
Set lower bound for an arc.
Sets the minimum flow that must pass through an arc. Default lower bound is 0.
| [in] | a | Arc to set lower bound for. |
| [in] | lower_bound | Minimum flow value. |
Definition at line 1777 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::lower_bound(), Aleph::Simplex_Arc_Info< Ftype >::lower_bound, and Aleph::Network_Simplex< Net >::support_lower_bounds.
|
inline |
Verify tree integrity - all parent_arcs should be Tree arcs.
Definition at line 2096 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::parent_arc(), Aleph::Network_Simplex< Net >::root, and Aleph::Tree.
|
inline |
Verify that tree arcs have zero reduced cost.
In a valid basic solution, all tree arcs must have reduced cost = 0. This is a consistency check for the potential values.
Definition at line 2077 of file tpl_netcost.H.
References Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::eps(), Aleph::maps(), Aleph::Network_Simplex< Net >::net, Aleph::Network_Simplex< Net >::reduced_cost(), and Aleph::Tree.
Referenced by Aleph::Network_Simplex< Net >::print_diagnostics().
Definition at line 1052 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::ainfo(), and Aleph::Network_Simplex< Net >::init_structures().
|
private |
Definition at line 1054 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::ainfo(), Aleph::Network_Simplex< Net >::ainfo(), and Aleph::Network_Simplex< Net >::init_structures().
|
staticconstexprprivate |
Definition at line 1061 of file tpl_netcost.H.
|
private |
Definition at line 1057 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::find_lca().
|
private |
Definition at line 1050 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), Aleph::Network_Simplex< Net >::init_structures(), Aleph::Network_Simplex< Net >::is_valid_basic_solution(), Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::Network_Simplex< Net >::print_diagnostics(), Aleph::Network_Simplex< Net >::print_stats(), Aleph::Network_Simplex< Net >::run(), Aleph::Network_Simplex< Net >::verify_tree_integrity(), and Aleph::Network_Simplex< Net >::verify_tree_reduced_costs().
Definition at line 1051 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::init_structures(), Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Network_Simplex< Net >::ninfo().
|
private |
Definition at line 1053 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::init_structures(), Aleph::Network_Simplex< Net >::ninfo(), and Aleph::Network_Simplex< Net >::ninfo().
|
private |
Definition at line 1056 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::get_num_pivots(), and Aleph::Network_Simplex< Net >::run().
Definition at line 1055 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), and Aleph::Network_Simplex< Net >::verify_tree_integrity().
|
mutableprivate |
Definition at line 1058 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::get_stats(), Aleph::Network_Simplex< Net >::print_stats(), and Aleph::Network_Simplex< Net >::run().
Definition at line 1059 of file tpl_netcost.H.
Referenced by Aleph::Network_Simplex< Net >::set_lower_bound().