graph_analysis
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
graph_analysis::algorithms::ConstraintViolation Class Reference

Representation of ConstraintViolation in a min-cost flow problem. More...

#include <ConstraintViolation.hpp>

Public Types

enum  Type {
  FlowBalance, MinFlow, TransFlow, TotalMinFlow,
  TotalTransFlow
}
 

Public Member Functions

 ConstraintViolation (const MultiCommodityVertex::Ptr &v, uint32_t commodity, int32_t delta, uint32_t inFlow, uint32_t outFlow, Type type=MinFlow)
 
 ConstraintViolation (const MultiCommodityEdge::Ptr &e, uint32_t commodity, int32_t delta, uint32_t inFlow, uint32_t outFlow, Type type=MinFlow)
 
 ConstraintViolation (const MultiCommodityVertex::Ptr &v, const std::set< uint32_t > &commodities, int32_t delta, uint32_t inFlow, uint32_t outFlow, Type type=MinFlow)
 
 ConstraintViolation (const MultiCommodityEdge::Ptr &e, const std::set< uint32_t > &commodities, int32_t delta, uint32_t inFlow, uint32_t outFlow, Type type=MinFlow)
 
uint32_t getCommodity () const
 
uint32_t getInFlow () const
 
uint32_t getOutFlow () const
 
const std::set< uint32_t > & getCommodities () const
 
const Vertex::Ptr & getVertex () const
 
const Edge::Ptr & getEdge () const
 
int32_t getDelta () const
 
Type getType () const
 
std::string toString (size_t indent=0) const
 

Static Public Member Functions

static std::string toString (const std::vector< ConstraintViolation > &flaws, size_t indent=0)
 
static std::string toString (const std::set< uint32_t > &commodities)
 

Static Public Attributes

static std::map< Type, std::string > TypeTxt
 The string representation for each type. More...
 

Detailed Description

Representation of ConstraintViolation in a min-cost flow problem.

To identify the known violations of constraints, this class permits to represent constraint violations. A quantification of the violation is part of this representation.

Member Enumeration Documentation

◆ Type

Enumerator
FlowBalance 

Inflow does not equal Outflow.

MinFlow 

The minimum required flow (for a single commodity) is not available.

TransFlow 

The required transflow (min inflow + min outflow) for a single commodity is not available

TotalMinFlow 

The required minimum flow for all commodities related to this node is not satisfied

TotalTransFlow 

The required transflow for all commodities related to this node is not satisfied

Constructor & Destructor Documentation

◆ ConstraintViolation() [1/4]

graph_analysis::algorithms::ConstraintViolation::ConstraintViolation ( const MultiCommodityVertex::Ptr &  v,
uint32_t  commodity,
int32_t  delta,
uint32_t  inFlow,
uint32_t  outFlow,
Type  type = MinFlow 
)

Default Constructor

Parameters
vThe vertex where the constraint violation is encountered
commodityThe commodity for which the constraint is violated
deltaThe difference to the actually required fulfilment
inFlowCurrent inflow
outFlowCurrent outflow
typeClassification of violation

◆ ConstraintViolation() [2/4]

graph_analysis::algorithms::ConstraintViolation::ConstraintViolation ( const MultiCommodityEdge::Ptr &  e,
uint32_t  commodity,
int32_t  delta,
uint32_t  inFlow,
uint32_t  outFlow,
Type  type = MinFlow 
)

Default Constructor

Parameters
eThe edge where the constraint violation is encountered
commodityThe commodity for which the constraint is violated
deltaThe difference to the actually required fulfilment
inFlowCurrent inflow
outFlowCurrent outflow
typeClassification of violation

◆ ConstraintViolation() [3/4]

graph_analysis::algorithms::ConstraintViolation::ConstraintViolation ( const MultiCommodityVertex::Ptr &  v,
const std::set< uint32_t > &  commodities,
int32_t  delta,
uint32_t  inFlow,
uint32_t  outFlow,
Type  type = MinFlow 
)

Construct a constraint violation with a set of commodities that are affected by the constraint violation

Parameters
vThe vertex where the constraint violation is encountered
commoditiesThe set of commodities for which the constraint is violated
deltaThe difference to the actually required fulfilment
inFlowCurrent inflow
outFlowCurrent outflow
typeClassification of violation

◆ ConstraintViolation() [4/4]

graph_analysis::algorithms::ConstraintViolation::ConstraintViolation ( const MultiCommodityEdge::Ptr &  e,
const std::set< uint32_t > &  commodities,
int32_t  delta,
uint32_t  inFlow,
uint32_t  outFlow,
Type  type = MinFlow 
)

Construct a constraint violation with a set of commodities that are affected by the constraint violation

Parameters
eThe edge where the constraint violation is encountered
commoditiesThe set of commodities for which the constraint is violated
deltaThe difference to the actually required fulfilment
inFlowCurrent inflow
outFlowCurrent outflow
typeClassification of violation

Member Function Documentation

◆ getCommodities()

const std::set<uint32_t>& graph_analysis::algorithms::ConstraintViolation::getCommodities ( ) const
inline

The set of commodities that are affected by this violation

Returns
set of commodities

◆ getCommodity()

uint32_t graph_analysis::algorithms::ConstraintViolation::getCommodity ( ) const

Get the commodity id

Returns
commodity id

◆ getDelta()

int32_t graph_analysis::algorithms::ConstraintViolation::getDelta ( ) const
inline

Quantification of the constraint violation, regarding the missing flow

Returns
missing flow

◆ getEdge()

const Edge::Ptr& graph_analysis::algorithms::ConstraintViolation::getEdge ( ) const
inline

Get the edge that this constraint violation is related to (can be null)

Returns
affected edge

◆ getInFlow()

uint32_t graph_analysis::algorithms::ConstraintViolation::getInFlow ( ) const
inline

Get the current inflow

Returns
inflow

◆ getOutFlow()

uint32_t graph_analysis::algorithms::ConstraintViolation::getOutFlow ( ) const
inline

Get the current outflow

Returns
outflow

◆ getType()

Type graph_analysis::algorithms::ConstraintViolation::getType ( ) const
inline

Get the constraint violation type

Returns
type

◆ getVertex()

const Vertex::Ptr& graph_analysis::algorithms::ConstraintViolation::getVertex ( ) const
inline

Get the vertex that this constraint violation is related to (can be null)

Returns
affected vertex

◆ toString() [1/3]

std::string graph_analysis::algorithms::ConstraintViolation::toString ( const std::set< uint32_t > &  commodities)
static

Stringify commodities

Returns
string object

◆ toString() [2/3]

std::string graph_analysis::algorithms::ConstraintViolation::toString ( const std::vector< ConstraintViolation > &  flaws,
size_t  indent = 0 
)
static

Stringify list of constraint violations

Returns
string object

◆ toString() [3/3]

std::string graph_analysis::algorithms::ConstraintViolation::toString ( size_t  indent = 0) const

Stringify constraint

Parameters
indentNumber of indentation spaces
Returns
string object

Member Data Documentation

◆ TypeTxt

std::map< ConstraintViolation::Type, std::string > graph_analysis::algorithms::ConstraintViolation::TypeTxt
static
Initial value:
= InitMap<ConstraintViolation::Type, std::string>
(MinFlow, "MinFlow")
(TransFlow, "TransFlow")
(TotalMinFlow, "TotalMinFlow")
(TotalTransFlow, "TotalTransFlow")

The string representation for each type.


The documentation for this class was generated from the following files:
graph_analysis::algorithms::ConstraintViolation::TotalTransFlow
@ TotalTransFlow
Definition: ConstraintViolation.hpp:34
graph_analysis::algorithms::ConstraintViolation::TotalMinFlow
@ TotalMinFlow
Definition: ConstraintViolation.hpp:31
graph_analysis::algorithms::ConstraintViolation::TransFlow
@ TransFlow
Definition: ConstraintViolation.hpp:28
graph_analysis::algorithms::ConstraintViolation::MinFlow
@ MinFlow
The minimum required flow (for a single commodity) is not available.
Definition: ConstraintViolation.hpp:25