Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Net_Cap_Node< Node_Info, F_Type > Class Template Reference

Node with capacity constraint for flow networks. More...

#include <tpl_netcapgraph.H>

Inheritance diagram for Aleph::Net_Cap_Node< Node_Info, F_Type >:
[legend]
Collaboration diagram for Aleph::Net_Cap_Node< Node_Info, F_Type >:
[legend]

Public Types

using Flow_Type = F_Type
 Type representing flow and capacity values.
 
using Node_Type = Node_Info
 Type of information stored in the node.
 
- Public Types inherited from GTNodeCommon< NodeInfo >
using Item_Type = NodeInfo
 
using Node = GTNodeCommon
 Common alias for set types.
 
using Node_Type = NodeInfo
 The node.
 

Public Member Functions

 Net_Cap_Node () noexcept
 Default constructor. Sets max_cap to the maximum possible value.
 
 Net_Cap_Node (const Node_Info &node_info)
 Construct a node with the given information.
 
 Net_Cap_Node (Node_Info &&node_info) noexcept
 Move constructor from node info.
 
 Net_Cap_Node (const Net_Cap_Node *node)
 Copy constructor from another Net_Cap_Node.
 
 Net_Cap_Node (const Net_Cap_Node &other)
 Copy constructor.
 
Net_Cap_Nodeoperator= (const Net_Cap_Node &other)
 Copy assignment operator.
 
const Flow_Typeget_max_cap () const noexcept
 Get the maximum capacity of this node.
 
void set_max_cap (const Flow_Type &cap)
 Set the maximum capacity of this node.
 
- Public Member Functions inherited from Aleph::Graph_Anode< Node_Info >
 Graph_Anode ()
 
 Graph_Anode (const Node_Info &info)
 
 Graph_Anode (Node_Info &&info)
 
 Graph_Anode (const Graph_Anode &node)
 
Graph_Anodeoperator= (const Graph_Anode &node)
 
 Graph_Anode (Graph_Anode *p)
 
virtual ~Graph_Anode ()
 
void allocate_more (size_t new_size)
 
voidinsert_arc (void *arc)
 
void remove_arc_ne (const void *arc) noexcept
 
void remove_arc (const void *arc)
 
bool compress () noexcept
 
- Public Member Functions inherited from GTNodeCommon< NodeInfo >
 GTNodeCommon () noexcept=default
 another alias for set type
 
 GTNodeCommon (const NodeInfo &info)
 Copy constructor from info value.
 
 GTNodeCommon (NodeInfo &&info)
 Move constructor from info value.
 
 GTNodeCommon (const GTNodeCommon &other)
 Copy constructor.
 
 GTNodeCommon (GTNodeCommon &&other) noexcept
 Move constructor.
 
GTNodeCommonoperator= (const GTNodeCommon &other)
 Copy assignment operator.
 
GTNodeCommonoperator= (GTNodeCommon &&other) noexcept
 Move assignment operator.
 
NodeInfoget_info () noexcept
 Return a modifiable reference to the data contained in the node.
 
const NodeInfoget_info () const noexcept
 Return a constant reference to the data contained in the node.
 
unsigned int state () const noexcept
 Return the state's value.
 
void set_state (unsigned int s) noexcept
 Set the state to value s
 

Public Attributes

Flow_Type max_cap
 Maximum flow capacity that can pass through this node.
 
Flow_Type in_flow = Flow_Type{0}
 Tracked incoming flow (updated by update() after auxiliary net computation).
 
Flow_Type out_flow = Flow_Type{0}
 Tracked outgoing flow (updated by update() after auxiliary net computation).
 
- Public Attributes inherited from Aleph::Graph_Anode< Node_Info >
void ** arc_array = nullptr
 
size_t arcs_dim = 0
 
size_t contract_threshold = 0
 
- Public Attributes inherited from GTNodeCommon< NodeInfo >
Graph_Attr attrs
 Attributes of node.
 
NodeInfo node_info
 
size_t num_arcs = 0
 data associated to the node. Access it with get_info()
 

Private Types

using Base = Graph_Anode< Node_Info >
 

Additional Inherited Members

Detailed Description

template<typename Node_Info = Empty_Class, typename F_Type = double>
class Aleph::Net_Cap_Node< Node_Info, F_Type >

Node with capacity constraint for flow networks.

Net_Cap_Node extends the base graph node to include a maximum capacity value that limits the total flow that can pass through this node (both incoming and outgoing).

This is useful for modeling networks where nodes themselves have throughput constraints, such as:

  • Network routers with bandwidth limits
  • Processing stations with capacity limits
  • Transportation hubs with handling capacity
Template Parameters
Node_InfoType of information stored in the node.
F_TypeNumeric type for flow values (default: double).
See also
Net_Cap_Graph Net_Graph

Definition at line 98 of file tpl_netcapgraph.H.

Member Typedef Documentation

◆ Base

template<typename Node_Info = Empty_Class, typename F_Type = double>
using Aleph::Net_Cap_Node< Node_Info, F_Type >::Base = Graph_Anode<Node_Info>
private

Definition at line 100 of file tpl_netcapgraph.H.

◆ Flow_Type

template<typename Node_Info = Empty_Class, typename F_Type = double>
using Aleph::Net_Cap_Node< Node_Info, F_Type >::Flow_Type = F_Type

Type representing flow and capacity values.

Definition at line 104 of file tpl_netcapgraph.H.

◆ Node_Type

template<typename Node_Info = Empty_Class, typename F_Type = double>
using Aleph::Net_Cap_Node< Node_Info, F_Type >::Node_Type = Node_Info

Type of information stored in the node.

Definition at line 107 of file tpl_netcapgraph.H.

Constructor & Destructor Documentation

◆ Net_Cap_Node() [1/5]

template<typename Node_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cap_Node< Node_Info, F_Type >::Net_Cap_Node ( )
inlinenoexcept

Default constructor. Sets max_cap to the maximum possible value.

Definition at line 119 of file tpl_netcapgraph.H.

◆ Net_Cap_Node() [2/5]

template<typename Node_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cap_Node< Node_Info, F_Type >::Net_Cap_Node ( const Node_Info &  node_info)
inlineexplicit

Construct a node with the given information.

Capacity and flow attributes are initialized to their default values (max capacity = numeric max, flows = 0).

Parameters
node_infoInformation to store in the node.

Definition at line 132 of file tpl_netcapgraph.H.

◆ Net_Cap_Node() [3/5]

template<typename Node_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cap_Node< Node_Info, F_Type >::Net_Cap_Node ( Node_Info &&  node_info)
inlineexplicitnoexcept

Move constructor from node info.

Parameters
node_infoInformation to move into the node.

Definition at line 143 of file tpl_netcapgraph.H.

◆ Net_Cap_Node() [4/5]

template<typename Node_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cap_Node< Node_Info, F_Type >::Net_Cap_Node ( const Net_Cap_Node< Node_Info, F_Type > *  node)
inline

Copy constructor from another Net_Cap_Node.

Copies all attributes including max_cap but resets flow values.

Parameters
nodePointer to the node to copy from.

Definition at line 156 of file tpl_netcapgraph.H.

◆ Net_Cap_Node() [5/5]

template<typename Node_Info = Empty_Class, typename F_Type = double>
Aleph::Net_Cap_Node< Node_Info, F_Type >::Net_Cap_Node ( const Net_Cap_Node< Node_Info, F_Type > &  other)
inline

Copy constructor.

Parameters
otherNode to copy from.

Definition at line 169 of file tpl_netcapgraph.H.

Member Function Documentation

◆ get_max_cap()

template<typename Node_Info = Empty_Class, typename F_Type = double>
const Flow_Type & Aleph::Net_Cap_Node< Node_Info, F_Type >::get_max_cap ( ) const
inlinenoexcept

Get the maximum capacity of this node.

Returns
The maximum flow that can pass through this node.

Definition at line 199 of file tpl_netcapgraph.H.

References Aleph::Net_Cap_Node< Node_Info, F_Type >::max_cap.

◆ operator=()

template<typename Node_Info = Empty_Class, typename F_Type = double>
Net_Cap_Node & Aleph::Net_Cap_Node< Node_Info, F_Type >::operator= ( const Net_Cap_Node< Node_Info, F_Type > &  other)
inline

◆ set_max_cap()

template<typename Node_Info = Empty_Class, typename F_Type = double>
void Aleph::Net_Cap_Node< Node_Info, F_Type >::set_max_cap ( const Flow_Type cap)
inline

Set the maximum capacity of this node.

Parameters
capNew capacity value (must be non-negative).
Exceptions
std::domain_errorif cap is negative.

Definition at line 209 of file tpl_netcapgraph.H.

References ah_domain_error_if, and Aleph::Net_Cap_Node< Node_Info, F_Type >::max_cap.

Member Data Documentation

◆ in_flow

template<typename Node_Info = Empty_Class, typename F_Type = double>
Flow_Type Aleph::Net_Cap_Node< Node_Info, F_Type >::in_flow = Flow_Type{0}

Tracked incoming flow (updated by update() after auxiliary net computation).

Definition at line 113 of file tpl_netcapgraph.H.

Referenced by Aleph::Net_Cap_Node< Node_Info, F_Type >::operator=().

◆ max_cap

template<typename Node_Info = Empty_Class, typename F_Type = double>
Flow_Type Aleph::Net_Cap_Node< Node_Info, F_Type >::max_cap

◆ out_flow

template<typename Node_Info = Empty_Class, typename F_Type = double>
Flow_Type Aleph::Net_Cap_Node< Node_Info, F_Type >::out_flow = Flow_Type{0}

Tracked outgoing flow (updated by update() after auxiliary net computation).

Definition at line 116 of file tpl_netcapgraph.H.

Referenced by Aleph::Net_Cap_Node< Node_Info, F_Type >::operator=().


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