denseDiGraph Class Reference

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

#include <denseDigraph.h>

Inheritance diagram for denseDiGraph:

abstractDiGraph abstractMixedGraph managedObject goblinRootObject distanceGraph

Public Member Functions

 denseDiGraph (TNode _n, TOption options=0, goblinController &_CT=goblinDefaultContext) throw ()
 denseDiGraph (const char *fileName, goblinController &_CT=goblinDefaultContext) throw (ERFile,ERParse)
 denseDiGraph (abstractDiGraph &G) throw ()
 ~denseDiGraph () 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 directed graphs represented with arc capacity (adjacency) matrices.


Constructor & Destructor Documentation

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

Default constructor for dense digraphs.

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

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

File constructor for dense digraphs.

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

denseDiGraph abstractDiGraph G  )  throw ()
 

Copy constructor for dense digraphs.

Parameters:
G The original digraph object

~denseDiGraph  )  throw ()
 


Member Function Documentation

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

unsigned long Allocated  )  const throw ()
 

Reimplemented from abstractDiGraph.

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]