SmartGraph Class Reference
[Graph Structures]

#include <smart_graph.h>

Inheritance diagram for SmartGraph:

Inheritance graph
[legend]
List of all members.

Detailed Description

This is a simple and fast graph implementation. It is also quite memory efficient, but at the price that it does not support node and edge deletion. It conforms to the ExtendableGraph concept.
See also:
skeleton::ExtendableGraph.

Todo:
Some member functions could be static.

A possibly useful functionality: a function saveState() would give back a data sturcture X and then the function restoreState(X) would remove the nodes and edges added after the call of saveState(). Of course it should be used as a stack. (Maybe X is not necessary.)

Author:
Alpar Juttner

Definition at line 59 of file smart_graph.h.

Public Member Functions

int nodeNum () const
 Number of nodes.
int edgeNum () const
 Number of edges.
int maxNodeId () const
 Maximum node ID.
int maxEdgeId () const
 Maximum edge ID.
Edge findEdge (Node u, Node v, Edge prev=INVALID)
 Finds an edge between two nodes.

Static Public Member Functions

int id (Node v)
 Node ID.
int id (Edge e)
 Edge ID.


Member Function Documentation

int maxNodeId  )  const [inline]
 

Maximum node ID.

See also:
id(Node)
Definition at line 109 of file smart_graph.h.

int maxEdgeId  )  const [inline]
 

Maximum edge ID.

See also:
id(Edge)
Definition at line 114 of file smart_graph.h.

int id Node  v  )  [inline, static]
 

The ID of a valid Node is a nonnegative integer not greater than maxNodeId(). The range of the ID's is not surely continuous and the greatest node ID can be actually less then maxNodeId().

The ID of the INVALID node is -1.

Returns:
The ID of the node v.
Definition at line 136 of file smart_graph.h.

int id Edge  e  )  [inline, static]
 

The ID of a valid Edge is a nonnegative integer not greater than maxEdgeId(). The range of the ID's is not surely continuous and the greatest edge ID can be actually less then maxEdgeId().

The ID of the INVALID edge is -1.

Returns:
The ID of the edge e.
Definition at line 145 of file smart_graph.h.

Edge findEdge Node  u,
Node  v,
Edge  prev = INVALID
[inline]
 

Finds an edge from node u to node v.

If prev is INVALID (this is the default value), then It finds the first edge from u to v. Otherwise it looks for the next edge from u to v after prev.

Returns:
The found edge or INVALID if there is no such an edge.
Definition at line 176 of file smart_graph.h.


The documentation for this class was generated from the following file:
Generated on Thu Sep 30 12:18:39 2004 for LEMON by doxygen 1.3.8