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.
#include <lemon/smart_graph.h>
Inherits lemon::GraphExtender< SmartGraphBase >.
Classes | |
class | Snapshot |
Class to make a snapshot of the digraph and to restrore to it later. More... | |
Public Member Functions | |
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. | |
Private Member Functions | |
SmartGraph (const SmartGraph &) | |
void | operator= (const SmartGraph &) |
SmartGraph | ( | const SmartGraph & | ) | [inline, private] |
SmartGraph is not copy constructible. Use GraphCopy() instead.
SmartGraph | ( | ) | [inline] |
Constructor.
void operator= | ( | const SmartGraph & | ) | [inline, private] |
Assignment of SmartGraph to another one is not allowed. Use GraphCopy() instead.
Node addNode | ( | ) | [inline] |
Add a new node to the graph.
Edge addEdge | ( | const Node & | s, |
const Node & | t | ||
) | [inline] |
Add a new edge to the graph with node s
and t
.
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.
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.
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.
void clear | ( | ) | [inline] |
Erase all the nodes and edges from the graph.