Classes | Public Member Functions | Private Member Functions

SmartGraph Class Reference


Detailed Description

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 lemon::GraphExtender< SmartGraphBase >.

List of all members.

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 &)

Constructor & Destructor Documentation

SmartGraph ( const SmartGraph ) [inline, private]

SmartGraph is not copy constructible. Use GraphCopy() instead.

SmartGraph ( ) [inline]

Constructor.


Member Function Documentation

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.

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.
void clear ( ) [inline]

Erase all the nodes and edges from the graph.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines