#include <list_graph.h>
Inheritance diagram for ListGraph:
It conforms to the ErasableGraph concept.
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. |
|
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. |
|
Maximum node ID.
|
|
Maximum edge ID.
|
|
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.
|
|
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.
|
|
|
|
Finds an edge from node
If
|