Loading...
Searching...
No Matches
SplitNodes< DGR > Class Template Reference
Data Structures » Graph Structures » Adaptor Classes for Graphs

## Detailed Description

template<typename DGR>
class lemon::SplitNodes< DGR >

SplitNodes adaptor can be used for splitting each node into an in-node and an out-node in a digraph. Formaly, the adaptor replaces each node in the digraph with two nodes, namely node and node . If there is a arc in the original digraph, then the new target of the arc will be and similarly the source of each original arc will be . The adaptor adds an additional bind arc from to for each node of the original digraph.

The aim of this class is running an algorithm with respect to node costs or capacities if the algorithm considers only arc costs or capacities directly. In this case you can use `SplitNodes` adaptor, and set the node costs/capacities of the original digraph to the bind arcs in the adaptor.

This class provides item counting in the same time as the adapted digraph structure.

Template Parameters

  DGR | The type of the adapted digraph. It must conform to the Digraph concept. It is implicitly `const`.

Note
  The `Node` type of this adaptor is converible to the `Node` type of the adapted digraph.

`#include <lemon/adaptors.h>`

## Classes

class | CombinedNodeMap
| Node map combined from two original node maps. More...
class | CombinedArcMap
| Arc map combined from an arc map and a node map of the original digraph. More...

## Public Member Functions

| SplitNodes (const DGR &g)
| Constructor.

## Static Public Member Functions

static bool | inNode (const Node &n)
| Returns `true` if the given node is an in-node.
static bool | outNode (const Node &n)
| Returns `true` if the given node is an out-node.
static bool | origArc (const Arc &a)
| Returns `true` if the given arc is an original arc.
static bool | bindArc (const Arc &a)
| Returns `true` if the given arc is a bind arc.
static Node | inNode (const DigraphNode &n)
| Returns the in-node created from the given original node.
static Node | outNode (const DigraphNode &n)
| Returns the out-node created from the given original node.
static Arc | arc (const DigraphNode &n)
| Returns the bind arc that corresponds to the given original node.
static Arc | arc (const DigraphArc &a)
| Returns the arc that corresponds to the given original arc.
template<typename IN, typename OUT>
static CombinedNodeMap< IN, OUT > | combinedNodeMap (IN &in_map, OUT &out_map)
| Returns a combined node map.
template<typename ArcMap, typename NodeMap>
static CombinedArcMap< ArcMap, NodeMap > | combinedArcMap (ArcMap &arc_map, NodeMap &node_map)
| Returns a combined arc map.

## Related Symbols

(Note that these are not member symbols.)
template<typename DGR>
SplitNodes< DGR > | splitNodes (const DGR &digraph)
| Returns a (read-only) SplitNodes adaptor.

## Constructor & Destructor Documentation

## SplitNodes()

template<typename DGR>

SplitNodes | ( | const DGR & | g | ) |

inline

Constructor of the adaptor.

## Member Function Documentation

## inNode() [1/2]

template<typename DGR>

bool inNode | ( | const Node & | n | ) |

inline static

Returns `true` if the given node is an in-node.

## outNode() [1/2]

template<typename DGR>

bool outNode | ( | const Node & | n | ) |

inline static

Returns `true` if the given node is an out-node.

## origArc()

template<typename DGR>

bool origArc | ( | const Arc & | a | ) |

inline static

Returns `true` if the given arc is one of the arcs in the original digraph.

## bindArc()

template<typename DGR>

bool bindArc | ( | const Arc & | a | ) |

inline static

Returns `true` if the given arc is a bind arc, i.e. it connects an in-node and an out-node.

## inNode() [2/2]

template<typename DGR>

Node inNode | ( | const DigraphNode & | n | ) |

inline static

Returns the in-node created from the given original node.

## outNode() [2/2]

template<typename DGR>

Node outNode | ( | const DigraphNode & | n | ) |

inline static

Returns the out-node created from the given original node.

## arc() [1/2]

template<typename DGR>

Arc arc | ( | const DigraphNode & | n | ) |

inline static

Returns the bind arc in the adaptor that corresponds to the given original node, i.e. the arc connecting the in-node and out-node of `n`.

## arc() [2/2]

template<typename DGR>

Arc arc | ( | const DigraphArc & | a | ) |

inline static

Returns the arc in the adaptor that corresponds to the given original arc.

## combinedNodeMap()

template<typename DGR>
template<typename IN, typename OUT>

CombinedNodeMap< IN, OUT > combinedNodeMap | ( | IN & | in_map,
|  | OUT & | out_map )

inline static

This function just returns a combined node map.

## combinedArcMap()

template<typename DGR>
template<typename ArcMap, typename NodeMap>

CombinedArcMap< ArcMap, NodeMap > combinedArcMap | ( | ArcMap & | arc_map,
|  | NodeMap & | node_map )

inline static

This function just returns a combined arc map.