Classes | Public Member Functions | Static Public Member Functions | Related Functions

SplitNodes< DGR > Class Template Reference


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 $ u $ in the digraph with two nodes, namely node $ u_{in} $ and node $ u_{out} $. If there is a $ (v, u) $ arc in the original digraph, then the new target of the arc will be $ u_{in} $ and similarly the source of each original $ (u, v) $ arc will be $ u_{out} $. The adaptor adds an additional bind arc from $ u_{in} $ to $ u_{out} $ for each node $ u $ 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.

Template Parameters:
DGRThe 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>

List of all members.

Classes

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

Public Member Functions

 SplitNodes (const DGR &g)
 Constructor.

Static Public Member Functions

static bool inNode (const Node &n)
static bool outNode (const Node &n)
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)
static Node outNode (const DigraphNode &n)
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 Functions

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

Constructor & Destructor Documentation

SplitNodes ( const DGR &  g) [inline]

Constructor of the adaptor.


Member Function Documentation

static bool inNode ( const Node &  n) [inline, static]

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

static bool outNode ( const Node &  n) [inline, static]

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

static bool origArc ( const Arc &  a) [inline, static]

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

static 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.

static Node inNode ( const DigraphNode &  n) [inline, static]

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

static Node outNode ( const DigraphNode &  n) [inline, static]

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

static 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.

static Arc arc ( const DigraphArc &  a) [inline, static]

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

static CombinedNodeMap<IN, OUT> combinedNodeMap ( IN &  in_map,
OUT &  out_map 
) [inline, static]

This function just returns a combined node map.

static CombinedArcMap<ArcMap, NodeMap> combinedArcMap ( ArcMap &  arc_map,
NodeMap &  node_map 
) [inline, static]

This function just returns a combined arc map.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines