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