ListGraph Class Reference
[Graph Structures]

#include <list_graph.h>

Inheritance diagram for ListGraph:

Inheritance graph
[legend]
List of all members.

Detailed Description

This is a simple and fast erasable graph implementation.

It conforms to the ErasableGraph concept.

See also:
skeleton::ErasableGraph.

Definition at line 49 of file list_graph.h.

Public Member Functions

int nodeNum () const
 Number of nodes.
int edgeNum () const
 Number of edges.
void reserveEdge (int n)
 Set the expected maximum number of edges.
int maxNodeId () const
 Maximum node ID.
int maxEdgeId () const
 Maximum edge ID.
Node addNode ()
 Adds a new node to the graph.
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

void reserveEdge int  n  )  [inline]
 

With this function, it is possible to set the expected number of edges. The use of this fasten the building of the graph and makes it possible to avoid the superfluous memory allocation. Definition at line 117 of file list_graph.h.

int maxNodeId  )  const [inline]
 

Maximum node ID.

See also:
id(Node)
Definition at line 123 of file list_graph.h.

int maxEdgeId  )  const [inline]
 

Maximum edge ID.

See also:
id(Edge)
Definition at line 128 of file list_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 150 of file list_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 159 of file list_graph.h.

Node addNode  )  [inline]
 

Warning:
It adds the new node to the front of the list. (i.e. the lastly added node becomes the first.)
Definition at line 165 of file list_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 232 of file list_graph.h.


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