Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Network_Simplex< Net > Class Template Reference

Network Simplex algorithm for minimum cost flow. More...

#include <tpl_netcost.H>

Collaboration diagram for Aleph::Network_Simplex< Net >:
[legend]

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, 0.
 
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

void set_tolerances ()
 Compute the tolerances from the capacities, flows and costs.
 
void ensure_ran (const char *member) const
 Throw domain_error, naming member, if run() has not made the structures of the arcs that it reads.
 
bool feasible_flow () const
 Whether the flow of the network is feasible: finite and within the bounds of each arc, and kept by each node but the source and the sink, within the tolerance of check_node().
 
size_t expected_tree_arcs () const
 The arcs of the trees of a basic solution, one by node but the root of the tree of each component of the network; zero before run().
 
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.
 
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 void move_flow (Arc *a, const Flow_Type d, const bool up) noexcept
 Add d to the flow of a, if up, or take it away.
 
static bool without_capacity (const Arc *a) noexcept
 Whether an arc has no capacity: its capacity is infinite or max().
 

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
 
Flow_Type flow_tol = Flow_Type{0}
 
Flow_Type cost_tol = Flow_Type{0}
 
bool ran = false
 
bool unbounded = false
 

Static Private Attributes

static constexpr Flow_Type Inf = std::numeric_limits<Flow_Type>::max()
 

Detailed Description

template<FlowNetwork Net>
class Aleph::Network_Simplex< Net >

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.

Algorithm Overview

The algorithm uses a two-phase approach:

Phase I: Establish Basic Feasible Solution

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.

Phase II: Cost Optimization

Standard Network Simplex that iteratively:

  1. Finds an entering arc with negative reduced cost
  2. Identifies the cycle created by adding this arc
  3. Determines the leaving arc (blocking arc in the cycle)
  4. Performs the pivot: updates flows and tree structure

Implementation Notes

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. The lower bound of every arc is 0: it supports no other.

Warning
With a floating flow, the comparisons are within tolerances relative to the whole network (see run()): 1000 epsilons, some 2.2e-13, of the largest finite capacity or flow, and of the largest finite cost. They keep the residues of rounding from being taken for improvements, at any scale of the data; but a difference below them counts as zero. So an arc of a far larger magnitude, even one without flow, as a large penalty cost or a large finite capacity, hides the improvements of the other arcs that are below 2.2e-13 of it, and the flow is not of least cost, without notice: a cost of 1e13 hides the differences of cost 1, and a capacity of 1e13 keeps an arc of capacity 1 from taking flow. Keep the largest cost below some 4.5e12 times the smallest difference of cost that matters, and the largest capacity below some 4.5e12 times the smallest one, as by scaling them; give an arc without a bound the capacity max() or infinity, which the tolerances leave out; or take an integer flow, which compares exactly.
Template Parameters
NetNetwork type (must be Net_Cost_Graph or compatible).
See also
max_flow_min_cost_by_network_simplex
max_flow_min_cost_by_cycle_canceling

Definition at line 1289 of file tpl_netcost.H.

Member Typedef Documentation

◆ Arc

template<FlowNetwork Net>
using Aleph::Network_Simplex< Net >::Arc = typename Net::Arc

Definition at line 1293 of file tpl_netcost.H.

◆ Arc_Info

template<FlowNetwork Net>
using Aleph::Network_Simplex< Net >::Arc_Info = Simplex_Arc_Info<Flow_Type>

Definition at line 1296 of file tpl_netcost.H.

◆ Flow_Type

template<FlowNetwork Net>
using Aleph::Network_Simplex< Net >::Flow_Type = typename Net::Flow_Type

Definition at line 1294 of file tpl_netcost.H.

◆ Node

template<FlowNetwork Net>
using Aleph::Network_Simplex< Net >::Node = typename Net::Node

Definition at line 1292 of file tpl_netcost.H.

◆ Node_Info

template<FlowNetwork Net>
using Aleph::Network_Simplex< Net >::Node_Info = Simplex_Node_Info<Flow_Type>

Definition at line 1295 of file tpl_netcost.H.

Constructor & Destructor Documentation

◆ Network_Simplex()

template<FlowNetwork Net>
Aleph::Network_Simplex< Net >::Network_Simplex ( Net &  network)
inlineexplicit

Construct Network Simplex solver.

Parameters
[in,out]networkThe network to optimize.

Definition at line 2072 of file tpl_netcost.H.

Member Function Documentation

◆ ainfo() [1/2]

template<FlowNetwork Net>
Arc_Info & Aleph::Network_Simplex< Net >::ainfo ( Arc *  a)
inlineprivate

Get arc info reference.

Definition at line 1431 of file tpl_netcost.H.

◆ ainfo() [2/2]

template<FlowNetwork Net>
const Arc_Info & Aleph::Network_Simplex< Net >::ainfo ( Arc *  a) const
inlineprivate

Get arc info const reference.

Definition at line 1434 of file tpl_netcost.H.

◆ augment_and_find_leaving()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::augment_and_find_leaving ( Arc *  entering,
Flow_Type &  delta,
Arc *&  leaving,
bool &  leaving_goes_lower 
)
inlineprivate

Augment flow around the cycle and find leaving arc.

When entering arc is added, it creates a cycle. This function:

  1. Finds the bottleneck (minimum slack) in the cycle
  2. Updates flows around the cycle
  3. Identifies the leaving arc

Flow pushed around a cycle, directed or not, or around a loop, keeps the value of the flow, and the entering arc makes the cost lower.

Parameters
[in]enteringThe entering arc.
[out]deltaFlow change amount.
[out]leavingThe leaving arc (becomes non-basic).
[out]leaving_goes_lowerTrue if leaving arc goes to lower bound.
Returns
true if a valid augmentation was performed.

Definition at line 1756 of file tpl_netcost.H.

References Aleph::and.

◆ build_spanning_tree()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::build_spanning_tree ( )
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. The nodes that it does not reach, as those of a flow apart from the source, get trees of their own, with the potentials of each from 0.

Non-tree arcs are classified as Lower or Upper based on their current flow relative to capacity.

Definition at line 1506 of file tpl_netcost.H.

References Aleph::and, Aleph::DynList< T >::append(), Aleph::DynListQueue< T >::get(), Aleph::DynListQueue< T >::is_empty(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::DynListQueue< T >::put(), r, Aleph::reduced_cost(), and root().

◆ count_non_tree_partial_arcs()

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs ( ) const
inline

Count arcs with partial flow not in tree.

Definition at line 2432 of file tpl_netcost.H.

References Aleph::and, and Aleph::count().

◆ depth()

template<FlowNetwork Net>
long Aleph::Network_Simplex< Net >::depth ( Node *  p) const
inlineprivate

Get depth.

Definition at line 1443 of file tpl_netcost.H.

◆ ensure_ran()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::ensure_ran ( const char *  member) const
inlineprivate

Throw domain_error, naming member, if run() has not made the structures of the arcs that it reads.

Definition at line 1373 of file tpl_netcost.H.

References ah_domain_error_if.

◆ expected_tree_arcs()

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::expected_tree_arcs ( ) const
inlineprivate

The arcs of the trees of a basic solution, one by node but the root of the tree of each component of the network; zero before run().

vsize() - 1 counted those of a single tree.

Definition at line 1412 of file tpl_netcost.H.

◆ feasible_flow()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::feasible_flow ( ) const
inlineprivate

Whether the flow of the network is feasible: finite and within the bounds of each arc, and kept by each node but the source and the sink, within the tolerance of check_node().

check_network() also asks that each node be connected, as the source of a network whose source is its sink, isolated, is not.

Definition at line 1384 of file tpl_netcost.H.

References Aleph::Net_Graph< NodeT, ArcT >::node_tolerance(), and out.

◆ find_entering_arc()

template<FlowNetwork Net>
Arc * Aleph::Network_Simplex< Net >::find_entering_arc ( )
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:

  • Arc at Lower bound (flow=0): should have reduced_cost >= 0
  • Arc at Upper bound (flow=cap): should have reduced_cost <= 0

This implementation checks BOTH directions for each arc:

  • Forward direction: increase flow (requires flow < cap, benefits if rc < 0)
  • Backward direction: decrease flow (requires flow > 0, benefits if rc > 0)

This is essential for finding all negative cycles, including those that require reversing flow through arcs with flow > 0.

Returns
Entering arc, or nullptr if optimal.

Definition at line 1662 of file tpl_netcost.H.

References Aleph::and, and Aleph::reduced_cost().

◆ find_lca()

template<FlowNetwork Net>
Node * Aleph::Network_Simplex< Net >::find_lca ( Node *  u,
Node *  v 
)
inlineprivate

Find the lowest common ancestor of two nodes.

Uses marking to efficiently find the LCA in O(d) where d is depth.

Parameters
[in]uFirst node.
[in]vSecond node.
Returns
LCA of u and v.

Definition at line 1719 of file tpl_netcost.H.

References Aleph::and.

◆ force_partial_arcs_into_tree()

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree ( )
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.

Returns
Number of forced pivots performed.

Definition at line 2332 of file tpl_netcost.H.

References Aleph::and.

◆ get_lower_bound()

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::get_lower_bound ( Arc *  a) const
inline

Get lower bound for an arc.

Parameters
[in]aArc to query.
Returns
0, the lower bound of every arc.
Deprecated:
It goes in 8.0.0.

Definition at line 2101 of file tpl_netcost.H.

◆ get_num_pivots()

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::get_num_pivots ( ) const
inline

Return number of pivots performed in last run.

Definition at line 2298 of file tpl_netcost.H.

◆ get_stats()

template<FlowNetwork Net>
const NetworkSimplexStats & Aleph::Network_Simplex< Net >::get_stats ( ) const
inlinenoexcept

Return execution statistics from last run.

Definition at line 2301 of file tpl_netcost.H.

◆ init_structures()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::init_structures ( )
inlineprivate

Initialize data structures.

Definition at line 1460 of file tpl_netcost.H.

References Aleph::Simplex_Arc_Info< Ftype >::state.

◆ is_at_lower_bound()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::is_at_lower_bound ( Arc *  a) const
inline

Check if arc flow is at lower bound, 0.

With a floating flow, within the tolerance of the flows of the last run(); exactly before it.

Parameters
[in]aArc to check.
Returns
true if flow equals lower bound.

Definition at line 2114 of file tpl_netcost.H.

◆ is_at_upper_bound()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::is_at_upper_bound ( Arc *  a) const
inline

Check if arc flow is at upper bound (capacity).

With a floating flow, within the tolerance of the flows of the last run(); exactly before it.

Parameters
[in]aArc to check.
Returns
true if flow equals capacity.

Definition at line 2127 of file tpl_netcost.H.

◆ is_partial_flow()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::is_partial_flow ( Arc *  a) const
inlineprivate

Check if arc has partial flow (strictly between bounds).

Definition at line 1491 of file tpl_netcost.H.

References Aleph::and.

◆ is_valid_basic_solution()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::is_valid_basic_solution ( ) const
inline

Check if current solution is a valid basic feasible solution.

A valid BFS requires:

  1. All tree arcs can have any flow
  2. All non-tree arcs must be at their bounds (flow=0 or flow=cap)
Returns
true if valid BFS, false otherwise.

Definition at line 2415 of file tpl_netcost.H.

◆ move_flow()

template<FlowNetwork Net>
static void Aleph::Network_Simplex< Net >::move_flow ( Arc *  a,
const Flow_Type  d,
const bool  up 
)
inlinestaticprivatenoexcept

Add d to the flow of a, if up, or take it away.

A floating flow stays within [0, cap]: rounding left it an ulp beyond, and then every later cycle through the arc had a negative ratio, so that its pivot failed and run() ended as if it were optimal.

Definition at line 1327 of file tpl_netcost.H.

◆ ninfo() [1/2]

template<FlowNetwork Net>
Node_Info & Aleph::Network_Simplex< Net >::ninfo ( Node *  p)
inlineprivate

Get node info reference.

Definition at line 1425 of file tpl_netcost.H.

◆ ninfo() [2/2]

template<FlowNetwork Net>
const Node_Info & Aleph::Network_Simplex< Net >::ninfo ( Node *  p) const
inlineprivate

Get node info const reference.

Definition at line 1428 of file tpl_netcost.H.

◆ parent()

template<FlowNetwork Net>
Node * Aleph::Network_Simplex< Net >::parent ( Node *  p) const
inlineprivate

Get parent node.

Definition at line 1437 of file tpl_netcost.H.

◆ parent_arc()

template<FlowNetwork Net>
Arc * Aleph::Network_Simplex< Net >::parent_arc ( Node *  p) const
inlineprivate

Get parent arc.

Definition at line 1440 of file tpl_netcost.H.

◆ pivot_tree()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::pivot_tree ( Arc *  entering,
Arc *  leaving,
bool  leaving_goes_lower 
)
inlineprivate

Update tree structure after pivot.

Replaces the leaving arc with the entering arc and updates parent pointers, depths, and potentials.

Parameters
[in]enteringThe entering arc.
[in]leavingThe leaving arc.
[in]leaving_goes_lowerTrue if leaving goes to lower bound.

Definition at line 1909 of file tpl_netcost.H.

References Aleph::and, Aleph::DynListQueue< T >::get(), LocateFunctions< Container, Type >::get_it(), Aleph::DynList< T >::insert(), Aleph::DynListQueue< T >::is_empty(), Aleph::next(), and Aleph::DynListQueue< T >::put().

◆ potential()

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::potential ( Node *  p) const
inlineprivate

Get potential.

Definition at line 1446 of file tpl_netcost.H.

◆ print_diagnostics()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::print_diagnostics ( ) const
inline

Print diagnostic information about current state.

Definition at line 2492 of file tpl_netcost.H.

References Aleph::and, and Aleph::reduced_cost().

◆ print_stats()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::print_stats ( ) const
inline

Print execution statistics to stdout.

Definition at line 2304 of file tpl_netcost.H.

◆ reduced_cost()

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::reduced_cost ( Arc *  a) const
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 1452 of file tpl_netcost.H.

◆ residual_capacity()

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::residual_capacity ( Arc *  a) const
inline

Get residual capacity (room to increase flow).

Parameters
[in]aArc to query.
Returns
Available capacity above current flow.

Definition at line 2137 of file tpl_netcost.H.

◆ residual_lower()

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::residual_lower ( Arc *  a) const
inline

Get residual lower (room to decrease flow).

Parameters
[in]aArc to query.
Returns
Available decrease to lower bound: the flow of the arc, as every lower bound is 0.
Deprecated:
It goes in 8.0.0: it is a->flow.

Definition at line 2151 of file tpl_netcost.H.

◆ run()

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::run ( Flow_Type  unused = 0)
inline

Execute Network Simplex algorithm.

Computes minimum cost flow. It optimizes the cost of the flow that the network has, as one of Ford-Fulkerson, keeping its value.

With a floating flow, its comparisons are within tolerances relative to the data: 1000 epsilons of the largest capacity or flow, and of the largest cost; and the residues of rounding that the pivots leave, as the arc that leaves the tree takes its bound exactly, go back at the end, as those of the maximum flows (see net_detail::return_dust()), also before the exception of an unbounded program: every node keeps its flow within the tolerance of check_node().

Parameters
[in]unusedKept for API compatibility.
Returns
Number of pivots performed.
Exceptions
std::domain_errorif the network is not of a single source and a single sink, if its flow is not feasible (beyond the capacity of an arc, negative, infinite, or not kept by a node but the source and the sink), or if the program is unbounded: a cycle of negative cost through arcs without capacity; the network keeps then a feasible flow of the same value, that of the pivots made
std::runtime_errorif the pivots reach their bound before the optimum; the network keeps a feasible flow of the same value

Definition at line 2185 of file tpl_netcost.H.

References ah_domain_error, ah_domain_error_if, ah_runtime_error_if, Aleph::and, Aleph::build_spanning_tree(), and Aleph::net_detail::return_dust().

Referenced by Aleph::max_flow_min_cost_by_network_simplex().

◆ set_lower_bound()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::set_lower_bound ( Arc *  a,
Flow_Type  lower_bound 
)
inline

Set lower bound for an arc.

Network_Simplex supports no lower bound but 0, that of every arc. It stored another one, which no part of the algorithm read, and which the next run() set to 0.

Parameters
[in]aArc to set lower bound for.
[in]lower_boundMinimum flow value; only 0.
Exceptions
std::domain_errorif lower_bound is not 0.
Deprecated:
It goes in 8.0.0.

Definition at line 2087 of file tpl_netcost.H.

References ah_domain_error_if, and Aleph::lower_bound().

◆ set_tolerances()

template<FlowNetwork Net>
void Aleph::Network_Simplex< Net >::set_tolerances ( )
inlineprivate

Compute the tolerances from the capacities, flows and costs.

Definition at line 1350 of file tpl_netcost.H.

◆ verify_tree_integrity()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::verify_tree_integrity ( ) const
inline

Verify tree integrity - all parent_arcs should be Tree arcs.

Returns
true if tree structure is consistent.

Definition at line 2472 of file tpl_netcost.H.

References root().

◆ verify_tree_reduced_costs()

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::verify_tree_reduced_costs ( ) const
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.

Returns
true if all tree arcs have rc=0, false otherwise.

Definition at line 2452 of file tpl_netcost.H.

References Aleph::reduced_cost().

◆ without_capacity()

template<FlowNetwork Net>
static bool Aleph::Network_Simplex< Net >::without_capacity ( const Arc *  a)
inlinestaticprivatenoexcept

Whether an arc has no capacity: its capacity is infinite or max().

Definition at line 1344 of file tpl_netcost.H.

References Aleph::net_detail::without_capacity().

Member Data Documentation

◆ arc_info

template<FlowNetwork Net>
DynArray<Arc_Info> Aleph::Network_Simplex< Net >::arc_info
private

Definition at line 1301 of file tpl_netcost.H.

◆ arc_to_idx

template<FlowNetwork Net>
DynMapTree<Arc *, size_t> Aleph::Network_Simplex< Net >::arc_to_idx
private

Definition at line 1303 of file tpl_netcost.H.

◆ cost_tol

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::cost_tol = Flow_Type{0}
private

Definition at line 1318 of file tpl_netcost.H.

◆ flow_tol

template<FlowNetwork Net>
Flow_Type Aleph::Network_Simplex< Net >::flow_tol = Flow_Type{0}
private

Definition at line 1317 of file tpl_netcost.H.

◆ Inf

template<FlowNetwork Net>
constexpr Flow_Type Aleph::Network_Simplex< Net >::Inf = std::numeric_limits<Flow_Type>::max()
staticconstexprprivate

Definition at line 1309 of file tpl_netcost.H.

◆ lca_mark

template<FlowNetwork Net>
long Aleph::Network_Simplex< Net >::lca_mark = 0
private

Definition at line 1306 of file tpl_netcost.H.

◆ net

template<FlowNetwork Net>
Net& Aleph::Network_Simplex< Net >::net
private

Definition at line 1299 of file tpl_netcost.H.

◆ node_info

template<FlowNetwork Net>
DynArray<Node_Info> Aleph::Network_Simplex< Net >::node_info
private

Definition at line 1300 of file tpl_netcost.H.

◆ node_to_idx

template<FlowNetwork Net>
DynMapTree<Node *, size_t> Aleph::Network_Simplex< Net >::node_to_idx
private

Definition at line 1302 of file tpl_netcost.H.

◆ num_pivots

template<FlowNetwork Net>
size_t Aleph::Network_Simplex< Net >::num_pivots = 0
private

Definition at line 1305 of file tpl_netcost.H.

◆ ran

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::ran = false
private

Definition at line 1320 of file tpl_netcost.H.

◆ root

template<FlowNetwork Net>
Node* Aleph::Network_Simplex< Net >::root = nullptr
private

Definition at line 1304 of file tpl_netcost.H.

◆ stats

template<FlowNetwork Net>
NetworkSimplexStats Aleph::Network_Simplex< Net >::stats
mutableprivate

Definition at line 1307 of file tpl_netcost.H.

◆ unbounded

template<FlowNetwork Net>
bool Aleph::Network_Simplex< Net >::unbounded = false
private

Definition at line 1321 of file tpl_netcost.H.


The documentation for this class was generated from the following file: