Loading...
Searching...
No Matches
SmartArcSet< GR > Class Template Reference
Data Structures » Graph Structures

## Detailed Description

template<typename GR>
class lemon::SmartArcSet< GR >

This structure can be used to establish another directed graph over a node set of an existing one. This class uses the same Node type as the underlying graph, and each valid node of the original graph is valid in this arc set, therefore the node objects of the original graph can be used directly with this class. The node handling functions (id handling, observing, and iterators) works equivalently as in the original graph.

Parameters

  GR | The type of the graph which shares its node set with this class. Its interface must conform to the Digraph or Graph concept.

This implementation is slightly faster than the `ListArcSet`, because it uses continuous storage for arcs and it uses just single-linked lists for enumerate outgoing and incoming arcs. Therefore the arcs cannot be erased from the arc sets.

This class fully conforms to the Digraph concept. It provides only linear time counting for nodes and arcs.

Warning
  If a node is erased from the underlying graph and this node is the source or target of one arc in the arc set, then the arc set is invalidated, and it cannot be used anymore. The validity can be checked with the `valid()` member function.

`#include <lemon/edge_set.h>`

## Public Member Functions

| SmartArcSet (const GR &graph)
| Constructor of the ArcSet.
Arc | addArc (const Node &s, const Node &t)
| Add a new arc to the digraph.
bool | valid () const
| Validity check.

## Constructor & Destructor Documentation

## SmartArcSet()

template<typename GR>

SmartArcSet | ( | const GR & | graph | ) |

inline

Constructor of the ArcSet.

## Member Function Documentation

## addArc()

template<typename GR>

Arc addArc | ( | const Node & | s,
|  | const Node & | t )

inline

Add a new arc to the digraph with source node `s` and target node `t`.

Returns
  The new arc.

## valid()

template<typename GR>

bool valid | ( |  | ) | const

inline

This functions gives back false if the ArcSet is invalidated. It occurs when a node in the underlying graph is erased and it is not isolated in the ArcSet.