GraphList Class Reference

Representation of a graph using adjacency lists. More...

#include <GraphList.h>

Inheritance diagram for GraphList:

Graph List of all members.

Public Member Functions

 GraphList ()
 GraphList (int n)
 ~GraphList ()
bool isEdge (int, int)
int edgeWeight (int, int)
void addEdge (int u, int v, int w)
 Add edge to graph structure from (u,v).
bool removeEdge (int u, int v)
 Remove edge, and if undirected, remove its opposite as well.

Protected Member Functions

void allocate (int n)
 No special allocations.
void deallocate ()
 Deallocate by freeing the vertices.

Private Member Functions

void helperRemove (int, int, bool)

Detailed Description

Representation of a graph using adjacency lists.

Author:
George Heineman
Date:
6/15/08


Constructor & Destructor Documentation

GraphList::GraphList (  )  [inline]

GraphList::GraphList ( int  n  )  [inline]

GraphList::~GraphList (  )  [inline]


Member Function Documentation

void GraphList::addEdge ( int  u,
int  v,
int  w 
)

Add edge to graph structure from (u,v).

If the graph is undirected, then we must add in reverse as well. It is up to user to ensure that no edge already exists. The check will not be performed here.

Parameters:
u integer identifier of a vertex
v integer identifier of a vertex
w planned weight.

Reimplemented from Graph.

void GraphList::allocate ( int  n  )  [inline, protected]

No special allocations.

void GraphList::deallocate (  )  [inline, protected]

Deallocate by freeing the vertices.

int GraphList::edgeWeight ( int  ,
int   
)

void GraphList::helperRemove ( int  ,
int  ,
bool   
) [private]

bool GraphList::isEdge ( int  ,
int   
)

bool GraphList::removeEdge ( int  u,
int  v 
)

Remove edge, and if undirected, remove its opposite as well.

Parameters:
u integer identifier of a vertex
v integer identifier of a vertex
Returns:
true if edge was removed, false otherwise

Reimplemented from Graph.


The documentation for this class was generated from the following file: Algorithm Development Kit 1.0