This is a simple and fast graph implementation. It is also quite memory efficient, but at the price that it does support only limited (only stack-like) node and arc deletions. It fully conforms to the Graph concept.
- See Also
- concepts::Graph.
#include <lemon/smart_graph.h>
Inherits GraphExtender< Base >.
|
| class | Snapshot |
| | Class to make a snapshot of the digraph and to restrore to it later. More...
|
| |
|
| | SmartGraph () |
| |
| Node | addNode () |
| | Add a new node to the graph.
|
| |
| Edge | addEdge (const Node &s, const Node &t) |
| | Add a new edge to the graph.
|
| |
| bool | valid (Node n) const |
| | Node validity check.
|
| |
| bool | valid (Arc a) const |
| | Arc validity check.
|
| |
| bool | valid (Edge e) const |
| | Edge validity check.
|
| |
| void | clear () |
| | Clear the graph.
|
| |
SmartGraph is not copy constructible. Use GraphCopy() instead.
Assignment of SmartGraph to another one is not allowed. Use GraphCopy() instead.
Add a new node to the graph.
- Returns
- The new node.
| Edge addEdge |
( |
const Node & |
s, |
|
|
const Node & |
t |
|
) |
| |
|
inline |
Add a new edge to the graph with node s and t.
- Returns
- The new edge.
| bool valid |
( |
Node |
n | ) |
const |
|
inline |
This function gives back true if the given node is valid, ie. it is a real node of the graph.
- Warning
- A removed node (using Snapshot) could become valid again when new nodes are added to the graph.
| bool valid |
( |
Arc |
a | ) |
const |
|
inline |
This function gives back true if the given arc is valid, ie. it is a real arc of the graph.
- Warning
- A removed arc (using Snapshot) could become valid again when new edges are added to the graph.
| bool valid |
( |
Edge |
e | ) |
const |
|
inline |
This function gives back true if the given edge is valid, ie. it is a real edge of the graph.
- Warning
- A removed edge (using Snapshot) could become valid again when new edges are added to the graph.
Erase all the nodes and edges from the graph.