denseGraph Class Reference

A class for undirected graphs represented with arc capacity (adjacency) matrices. More...

#include <denseGraph.h>

Inheritance diagram for denseGraph:

abstractGraph abstractMixedGraph managedObject goblinRootObject metricGraph

Public Member Functions

 denseGraph (TNode _n, TOption options=0, goblinController &_CT=goblinDefaultContext) throw ()
 denseGraph (const char *fileName, goblinController &_CT=goblinDefaultContext) throw (ERFile,ERParse)
 denseGraph (abstractGraph &G) throw ()
 ~denseGraph () throw ()
void ReadNNodes (goblinImport &F) throw (ERParse)
unsigned long Size () const throw ()
unsigned long Allocated () const throw ()
TArc Adjacency (TNode u, TNode v, TMethAdjacency method=ADJ_MATRIX) const throw (ERRange)
TNode StartNode (TArc a) const throw (ERRange)
TNode EndNode (TArc a) const throw (ERRange)
TArc First (TNode v) const throw (ERRange)
TArc Right (TArc a, TNode v=NoNode) const throw (ERRange)

Protected Member Functions

TFloat TSP_Heuristic (THeurTSP method, TNode root) throw (ERRange,ERRejected)

Protected Attributes

denseRepresentation X

Detailed Description

A class for undirected graphs represented with arc capacity (adjacency) matrices.


Constructor & Destructor Documentation

denseGraph TNode  _n,
TOption  options = 0,
goblinController _CT = goblinDefaultContext
throw ()
 

Default constructor for dense undirected graphs.

Parameters:
_n The initial number of nodes
options Either 0 or OPT_COMPLETE
_CT The context to which this graph object is attached

denseGraph const char *  fileName,
goblinController _CT = goblinDefaultContext
throw (ERFile,ERParse)
 

File constructor for dense undirected graphs.

Parameters:
fileName The source file name
_CT The context to which this graph object is attached

denseGraph abstractGraph G  )  throw ()
 

Copy constructor for dense undirected graphs.

Parameters:
G The original graph object

~denseGraph  )  throw ()
 


Member Function Documentation

TArc Adjacency TNode  u,
TNode  v,
TMethAdjacency  method = ADJ_MATRIX
const throw (ERRange)
 

unsigned long Allocated  )  const throw ()
 

Reimplemented from abstractGraph.

TNode EndNode TArc  a  )  const throw (ERRange) [virtual]
 

Query the end node of a given arc.

Parameters:
a An arc index ranged [0,1,..,2*mAct-1]
Returns:
The index of the end node

Reimplemented from abstractMixedGraph.

TArc First TNode  v  )  const throw (ERRange) [virtual]
 

Retrieve an arc with a given start node.

The First(v) incidence is somewhat arbitrary, since icidence lists are cyclic. But when an arc is inserted, it is inserted into the incidence lists right after the First() incidence. If the graph is planely represented, and v is an exterior node, the first two incidences are usually exterior arcs, and inserting an arc with two exterior end nodes preserves the planar representation.

Parameters:
v A node index ranged [0,1,..,nAct-1]
Returns:
The index of an outgoing arc

Implements abstractMixedGraph.

void ReadNNodes goblinImport F  )  throw (ERParse) [virtual]
 

Read the number of nodes from file.

Parameters:
F An input file stream
This reads the number of graph nodes, the number of layout points and, if the graph is bipartite, the number of left-hand nodes. This operation must occur prior to all attribute read attempts.

Reimplemented from abstractMixedGraph.

TArc Right TArc  a,
TNode  v = NoNode
const throw (ERRange) [virtual]
 

Query the successor of a given arc in the incidence list of its start node.

Parameters:
a An arc index ranged [0,1,..,2*mAct-1]
v The index of the start node of a (only to reduce lookup times)
Returns:
The index of the right-hand incident arc

Implements abstractMixedGraph.

unsigned long Size  )  const throw () [virtual]
 

Implements goblinRootObject.

TNode StartNode TArc  a  )  const throw (ERRange) [virtual]
 

Query the start node of a given arc.

Parameters:
a An arc index ranged [0,1,..,2*mAct-1]
Returns:
The index of the start node

Implements abstractMixedGraph.


Field Documentation

denseRepresentation X [protected]