Web Analytics Made Easy - Statcounter
Skip to content

Class SBCGraph#

ClassList > SBCGraph

This class describes a graph. More...

  • #include <SBCGraph.hpp>

Inherits the following classes: SBCReferenceTarget

Public Functions#

Type Name
SBCGraph ()
unsigned int addNode (SBCGraphNode * g)
Adds a node to the graph node, and returns its index.
void getArticulationPoints (SBIndexer< SBCGraphNode * > & articulationPointIndexer, SBIndexer< SBCGraphArc * > & bridgeIndexer)
Finds all articulation points in the graph and adds them to articulationPointIndexer , and adds bridges tobridgeIndexer .
const SBIndexer< SBCGraphNode * > * getNodeIndexer () const
Returns a pointer to the node index.
unsigned int getNumberOfNodes ()
Returns the number of nodes.
void print (std::ostream & os) const
Prints some debugging information.
void print () const
Prints some debugging information.
unsigned int removeNode (SBCGraphNode * g)
Removes a node from the graph.
unsigned int removeNode (unsigned int index)
Removes a node from the graph.
virtual ~SBCGraph ()
Destroys the graph, releasing indexing structures.

Public Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget ()
Builds the reference target.
unsigned int getMemoryFootprint () const
Returns the memory footprint.
void printReferencesToOwners () const
Prints the references to the owners of this reference target.
virtual ~SBCReferenceTarget ()
Destructor.

Protected Attributes#

Type Name
std::vector< SBCGraphNode * > * articulationPoints
std::vector< std::vector< SBCGraphNode * > * > * children
Children during DFS traversal.
std::vector< int > * levelVector
std::vector< unsigned int > * lowVector
SBIndexer< SBCGraphNode * > * nodeIndexer
The graph node indexer.
unsigned int numCounter
std::vector< unsigned int > * numVector
std::vector< unsigned int > * numberOfChildren
std::vector< unsigned int > * numberOfChildrenLeft
std::vector< bool > * visitedVector

Protected Attributes inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTargetData * dataPointer
A pointer to the private data.

Protected Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
Protected constructor.
void removeAllReferenceOwners ()
Stops all the reference owners from referencing this reference target.

Detailed Description#

Short name: SBGraph

Constructs an empty graph.

Public Functions Documentation#

function SBCGraph#

SBCGraph::SBCGraph () 

function addNode#

Adds a node to the graph node, and returns its index.

unsigned int SBCGraph::addNode (
    SBCGraphNode * g
) 

Adds a node to the graph and returns its index.

Parameters:

  • g The node to add to the graph.

Returns:

Index of the added node.


function getArticulationPoints#

Finds all articulation points in the graph and adds them to articulationPointIndexer , and adds bridges tobridgeIndexer .

void SBCGraph::getArticulationPoints (
    SBIndexer< SBCGraphNode * > & articulationPointIndexer,
    SBIndexer< SBCGraphArc * > & bridgeIndexer
) 

Finds articulation points and bridges in the graph.

Parameters:

  • articulationPointIndex Indexer to receive articulation point nodes.
  • bridgeIndex Indexer to receive bridge arcs.

function getNodeIndexer#

Returns a pointer to the node index.

const SBIndexer< SBCGraphNode * > * SBCGraph::getNodeIndexer () const

Returns a pointer to the node indexer.

Returns:

Const pointer to the SBIndexer of graph nodes.


function getNumberOfNodes#

Returns the number of nodes.

unsigned int SBCGraph::getNumberOfNodes () 

Returns the number of vertices in the graph.

Returns:

Number of vertices.


function print [1/2]#

Prints some debugging information.

void SBCGraph::print (
    std::ostream & os
) const

Prints debugging information about the graph to the given output stream.

Parameters:

  • os Output stream to write the information to.

function print [2/2]#

Prints some debugging information.

void SBCGraph::print () const

Prints debugging information about the graph to the standard output.


function removeNode [1/2]#

Removes a node from the graph.

unsigned int SBCGraph::removeNode (
    SBCGraphNode * g
) 

Removes the specified node from the graph.

Parameters:

  • g The node to remove from the graph.

Returns:

Index of the removed node.


function removeNode [2/2]#

Removes a node from the graph.

unsigned int SBCGraph::removeNode (
    unsigned int index
) 

Removes the node at the given index from the graph.

Parameters:

  • index The index of the node to remove from the graph.

Returns:

Index of the removed node.


function ~SBCGraph#

Destroys the graph, releasing indexing structures.

virtual SBCGraph::~SBCGraph () 

This does not delete the underlying graph nodes and edges, but only the indexing structure.


Protected Attributes Documentation#

variable articulationPoints#

std::vector<SBCGraphNode*>* SBCGraph::articulationPoints;

variable children#

Children during DFS traversal.

std::vector<std::vector<SBCGraphNode*>*>* SBCGraph::children;


variable levelVector#

std::vector<int>* SBCGraph::levelVector;

variable lowVector#

std::vector<unsigned int>* SBCGraph::lowVector;

variable nodeIndexer#

The graph node indexer.

SBIndexer<SBCGraphNode*>* SBCGraph::nodeIndexer;


variable numCounter#

unsigned int SBCGraph::numCounter;

variable numVector#

std::vector<unsigned int>* SBCGraph::numVector;

variable numberOfChildren#

std::vector<unsigned int>* SBCGraph::numberOfChildren;

variable numberOfChildrenLeft#

std::vector<unsigned int>* SBCGraph::numberOfChildrenLeft;

variable visitedVector#

std::vector<bool>* SBCGraph::visitedVector;