Public Member Functions | Protected Attributes

ColPack::GraphCore Class Reference
[Classes for Graphs]

class GraphCore in group1. More...

#include <GraphCore.h>

Inherited by ColPack::GraphInputOutput.

Collaboration diagram for ColPack::GraphCore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void PrintVertexD1Neighbor (int VertexIndex, int excludedVertex=-1)
 Print all the Distance-1 neighbors of VertexIndex (0-based), except the excludedVertex.
void GetD1Neighbor (int VertexIndex, vector< int > &D1Neighbor, int excludedVertex=-1)
void PrintVertexD2Neighbor (int VertexIndex)
 Print all the Distance-2 neighbors of VertexIndex.
bool AreD2Neighbor (int VertexIndex1, int VertexIndex2)
 Check and see if VertexIndex1 and VertexIndex2 are Distance-2 neighbor.
bool operator== (const GraphCore &other) const
bool areEqual (const GraphCore &other, bool structureOnly=1) const
virtual ~GraphCore ()
virtual void Initialize ()=0
virtual void Clear ()
int GetVertexCount ()
int GetEdgeCount ()
int GetMaximumVertexDegree ()
int GetMinimumVertexDegree ()
double GetAverageVertexDegree ()
string GetInputFile ()
void GetVertices (vector< int > &output) const
void GetEdges (vector< int > &output) const
void GetValues (vector< double > &output) const
void GetVertexEdgeMap (map< int, map< int, int > > &output)
void GetDisjointSets (DisjointSets &output)

Protected Attributes

int m_i_MaximumVertexDegree
int m_i_MinimumVertexDegree
double m_d_AverageVertexDegree
string m_s_InputFile
vector< int > m_vi_Vertices
vector< int > m_vi_Edges
vector< double > m_vd_Values
 Edge's weight.
map< int, map< int, int > > m_mimi2_VertexEdgeMap
DisjointSets m_ds_DisjointSets

Detailed Description

class GraphCore in group1.

Base class for Graph. Define a Graph: vertices, edges and values (edge's weight - optional); and its statisitcs: max, min and average degree.

Definition at line 32 of file GraphCore.h.


Constructor & Destructor Documentation

virtual ColPack::GraphCore::~GraphCore (  )  [inline, virtual]

Definition at line 83 of file GraphCore.h.


Member Function Documentation

bool ColPack::GraphCore::AreD2Neighbor ( int  VertexIndex1,
int  VertexIndex2 
)

Check and see if VertexIndex1 and VertexIndex2 are Distance-2 neighbor.

Algorithm:

  • Get the set D1_of_VertexIndex1 of all the Distance-1 neighbors of VertexIndex1
  • Get the set D1_of_VertexIndex2 of all the Distance-1 neighbors of VertexIndex2
  • Intersect D1_of_VertexIndex1 and D1_of_VertexIndex2 to see which vertices VertexIndex1 and VertexIndex2 have in common. The result is stored in Intersect_set
  • If the size of Intersect_set > 0 => VertexIndex1 and VertexIndex2 are Distance-2 neighbor

Definition at line 174 of file GraphCore.cpp.

References m_vi_Edges, m_vi_Vertices, and STEP_UP.

bool ColPack::GraphCore::areEqual ( const GraphCore other,
bool  structureOnly = 1 
) const

Definition at line 240 of file GraphCore.cpp.

References GetEdges(), GetValues(), GetVertices(), m_vd_Values, m_vi_Edges, and m_vi_Vertices.

Here is the call graph for this function:

void ColPack::GraphCore::Clear (  )  [virtual]
double ColPack::GraphCore::GetAverageVertexDegree (  ) 

Definition at line 75 of file GraphCore.cpp.

References m_d_AverageVertexDegree.

Referenced by toFileC(), toFileC_forColoringBasedOrdering(), and toFileStatisticForGraph().

Here is the caller graph for this function:

void ColPack::GraphCore::GetD1Neighbor ( int  VertexIndex,
vector< int > &  D1Neighbor,
int  excludedVertex = -1 
)

Definition at line 124 of file GraphCore.cpp.

References m_vi_Edges, m_vi_Vertices, and STEP_UP.

void ColPack::GraphCore::GetDisjointSets ( DisjointSets output  ) 
int ColPack::GraphCore::GetEdgeCount (  ) 

Definition at line 54 of file GraphCore.cpp.

References m_vi_Edges.

Referenced by f(), toFileC(), toFileC_forColoringBasedOrdering(), and toFileStatisticForGraph().

Here is the caller graph for this function:

void ColPack::GraphCore::GetEdges ( vector< int > &  output  )  const
string ColPack::GraphCore::GetInputFile (  ) 

Reimplemented in ColPack::GraphInputOutput.

Definition at line 82 of file GraphCore.cpp.

References m_s_InputFile.

int ColPack::GraphCore::GetMaximumVertexDegree (  ) 
int ColPack::GraphCore::GetMinimumVertexDegree (  ) 

Definition at line 68 of file GraphCore.cpp.

References m_i_MinimumVertexDegree.

Referenced by toFileC(), toFileC_forColoringBasedOrdering(), and toFileStatisticForGraph().

Here is the caller graph for this function:

void ColPack::GraphCore::GetValues ( vector< double > &  output  )  const

Definition at line 102 of file GraphCore.cpp.

References m_vd_Values.

Referenced by areEqual(), and operator==().

Here is the caller graph for this function:

int ColPack::GraphCore::GetVertexCount (  ) 
void ColPack::GraphCore::GetVertexEdgeMap ( map< int, map< int, int > > &  output  ) 
void ColPack::GraphCore::GetVertices ( vector< int > &  output  )  const
virtual void ColPack::GraphCore::Initialize (  )  [pure virtual]

Implemented in ColPack::GraphInputOutput.

bool ColPack::GraphCore::operator== ( const GraphCore other  )  const

Definition at line 211 of file GraphCore.cpp.

References GetEdges(), GetValues(), GetVertices(), m_vd_Values, m_vi_Edges, and m_vi_Vertices.

Here is the call graph for this function:

void ColPack::GraphCore::PrintVertexD1Neighbor ( int  VertexIndex,
int  excludedVertex = -1 
)

Print all the Distance-1 neighbors of VertexIndex (0-based), except the excludedVertex.

Print all the Distance-1 neighbors of VertexIndex, except the excludedVertex.

Definition at line 141 of file GraphCore.cpp.

References m_vi_Edges, m_vi_Vertices, and STEP_UP.

Referenced by f(), and PrintVertexD2Neighbor().

Here is the caller graph for this function:

void ColPack::GraphCore::PrintVertexD2Neighbor ( int  VertexIndex  ) 

Print all the Distance-2 neighbors of VertexIndex.

Definition at line 159 of file GraphCore.cpp.

References m_vi_Edges, m_vi_Vertices, PrintVertexD1Neighbor(), and STEP_UP.

Here is the call graph for this function:


Member Data Documentation

m_ds_DisjointSets holds a set of bi-color trees Populated by GraphColoring::AcyclicColoring()

Definition at line 79 of file GraphCore.h.

Referenced by ColPack::GraphColoring::AcyclicColoring(), ColPack::GraphColoring::AcyclicColoring_ForIndirectRecovery(), and GetDisjointSets().

map< int, map< int, int> > ColPack::GraphCore::m_mimi2_VertexEdgeMap [protected]

m_mimi2_VertexEdgeMap is a matrix that has all the non-zero (edge) in the upper triangle marked from 0 to (total number of non-zeros - 1) Populated by GraphColoring::AcyclicColoring()

Definition at line 74 of file GraphCore.h.

Referenced by ColPack::GraphColoring::AcyclicColoring(), ColPack::GraphColoring::AcyclicColoring_ForIndirectRecovery(), and GetVertexEdgeMap().

vector<double> ColPack::GraphCore::m_vd_Values [protected]
vector<int> ColPack::GraphCore::m_vi_Edges [protected]

Definition at line 66 of file GraphCore.h.

Referenced by ColPack::GraphColoring::AcyclicColoring(), ColPack::GraphColoring::AcyclicColoring_ForIndirectRecovery(), AreD2Neighbor(), areEqual(), ColPack::GraphInputOutput::BuildGraphFromRowCompressedFormat(), ColPack::GraphInputOutput::CalculateVertexDegrees(), ColPack::GraphColoring::CheckDistanceTwoColoring(), ColPack::GraphColoring::CheckQuickDistanceTwoColoring(), ColPack::GraphColoring::CheckStarColoring(), Clear(), ColPack::GraphColoring::DistanceOneColoring(), ColPack::GraphColoring::DistanceTwoColoring(), ColPack::GraphOrdering::DistanceTwoDynamicLargestFirstOrdering(), ColPack::GraphOrdering::DistanceTwoIncidenceDegreeOrdering(), ColPack::GraphOrdering::DistanceTwoLargestFirstOrdering(), ColPack::GraphOrdering::DistanceTwoSmallestLastOrdering(), ColPack::GraphOrdering::DynamicLargestFirstOrdering(), ColPack::GraphColoring::FileVertexColoringMetrics(), GetD1Neighbor(), GetEdgeCount(), GetEdges(), ColPack::GraphOrdering::GetMaxBackDegree(), ColPack::GraphOrdering::IncidenceDegreeOrdering(), ColPack::GraphColoring::ModifiedTriangularColoring(), ColPack::GraphColoring::NaiveStarColoring(), operator==(), ColPack::GraphInputOutput::PrintGraph(), ColPack::GraphInputOutput::PrintGraphStructure(), ColPack::GraphInputOutput::PrintMatrix(), ColPack::GraphColoring::PrintVertexColoringMetrics(), PrintVertexD1Neighbor(), PrintVertexD2Neighbor(), ColPack::GraphInputOutput::ReadHarwellBoeingAdjacencyGraph(), ColPack::GraphInputOutput::ReadMatrixMarketAdjacencyGraph(), ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph(), ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph2(), ColPack::GraphColoring::RestrictedStarColoring(), ColPack::GraphColoring::SearchDepthFirst(), ColPack::GraphOrdering::SmallestLastOrdering(), ColPack::GraphColoring::StarColoring(), and ColPack::GraphColoring::TriangularColoring().

vector<int> ColPack::GraphCore::m_vi_Vertices [protected]

Definition at line 64 of file GraphCore.h.

Referenced by ColPack::GraphColoring::AcyclicColoring(), ColPack::GraphColoring::AcyclicColoring_ForIndirectRecovery(), AreD2Neighbor(), areEqual(), ColPack::GraphInputOutput::BuildGraphFromRowCompressedFormat(), ColPack::GraphColoring::CalculateVertexColorClasses(), ColPack::GraphInputOutput::CalculateVertexDegrees(), ColPack::GraphColoring::CheckAcyclicColoring(), ColPack::GraphColoring::CheckDistanceTwoColoring(), ColPack::GraphColoring::CheckQuickDistanceTwoColoring(), ColPack::GraphColoring::CheckStarColoring(), Clear(), ColPack::GraphOrdering::ColoringBasedOrdering(), ColPack::GraphColoring::DistanceOneColoring(), ColPack::GraphColoring::DistanceTwoColoring(), ColPack::GraphOrdering::DistanceTwoDynamicLargestFirstOrdering(), ColPack::GraphOrdering::DistanceTwoIncidenceDegreeOrdering(), ColPack::GraphOrdering::DistanceTwoLargestFirstOrdering(), ColPack::GraphOrdering::DistanceTwoSmallestLastOrdering(), ColPack::GraphOrdering::DynamicLargestFirstOrdering(), ColPack::GraphColoring::FileVertexColoringMetrics(), GetD1Neighbor(), ColPack::GraphOrdering::GetMaxBackDegree(), GetVertexCount(), GetVertices(), ColPack::GraphOrdering::IncidenceDegreeOrdering(), ColPack::GraphOrdering::LargestFirstOrdering(), ColPack::GraphColoring::ModifiedTriangularColoring(), ColPack::GraphColoring::NaiveStarColoring(), ColPack::GraphOrdering::NaturalOrdering(), operator==(), ColPack::GraphInputOutput::PrintGraph(), ColPack::GraphInputOutput::PrintGraphStructure(), ColPack::GraphInputOutput::PrintMatrix(), ColPack::GraphColoring::PrintVertexColoringMetrics(), PrintVertexD1Neighbor(), PrintVertexD2Neighbor(), ColPack::GraphOrdering::RandomOrdering(), ColPack::GraphInputOutput::ReadHarwellBoeingAdjacencyGraph(), ColPack::GraphInputOutput::ReadMatrixMarketAdjacencyGraph(), ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph(), ColPack::GraphInputOutput::ReadMeTiSAdjacencyGraph2(), ColPack::GraphColoring::RestrictedStarColoring(), ColPack::GraphColoring::SearchDepthFirst(), ColPack::GraphOrdering::SmallestLastOrdering(), ColPack::GraphColoring::StarColoring(), and ColPack::GraphColoring::TriangularColoring().