ColPack
GraphColoring/GraphOrdering.h
Go to the documentation of this file.
00001 /************************************************************************************
00002     Copyright (C) 2005-2008 Assefaw H. Gebremedhin, Arijit Tarafdar, Duc Nguyen,
00003     Alex Pothen
00004 
00005     This file is part of ColPack.
00006 
00007     ColPack is free software: you can redistribute it and/or modify
00008     it under the terms of the GNU Lesser General Public License as published
00009     by the Free Software Foundation, either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     ColPack is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public License
00018     along with ColPack.  If not, see <http://www.gnu.org/licenses/>.
00019 ************************************************************************************/
00020 
00021 #ifndef GRAPHORDERING_H
00022 #define GRAPHORDERING_H
00023 
00024 using namespace std;
00025 
00026 namespace ColPack
00027 {
00033         class GraphOrdering : public GraphInputOutput
00034         {
00035         public:
00037 
00045                 int GetMaxBackDegree();
00046 
00047                 int OrderVertices(string s_OrderingVariant);
00048                 
00050 
00056                 int CheckVertexOrdering();
00057 
00058         private:
00059 
00061 
00066                 int GetBackDegree(int index);
00067 
00068                 //Private Function 1301
00069                 int CheckVertexOrdering(string s_VertexOrderingVariant);
00070 
00071                 int printVertexEdgeMap(vector< vector< pair< int, int> > > &vvpii_VertexEdgeMap);
00072 
00073         protected:
00074 
00075                 double m_d_OrderingTime;
00076 
00077                 string m_s_VertexOrderingVariant;
00078 
00079                 vector<int> m_vi_OrderedVertices; // m_vi_OrderedVertices.size() = m_vi_Vertices.size() - 1
00080 
00081         public:
00082 
00083                 //Public Constructor 1351
00084                 GraphOrdering();
00085 
00086                 //Public Destructor 1352
00087                 ~GraphOrdering();
00088 
00089                 //Virtual Function 1353
00090                 virtual void Clear();
00091                 void ClearOrderingONLY();
00092 
00093                 //Public Function 1354
00094                 int NaturalOrdering();
00095 
00096                 int RandomOrdering();
00097 
00098                 int ColoringBasedOrdering(vector<int> &vi_VertexColors);
00099 
00100                 //Public Function 1355
00101                 int LargestFirstOrdering();
00102 
00103                 //Public Function 1357
00104                 int DistanceTwoLargestFirstOrdering();
00105 
00106                 //Public Function 1356
00107                 int DynamicLargestFirstOrdering();
00108 
00109                 int DistanceTwoDynamicLargestFirstOrdering();
00110 
00111                 //Public Function 1358
00112                 int SmallestLastOrdering();
00113                 int SmallestLastOrdering_serial();
00114 
00115                 //Public Function 1359
00116                 int DistanceTwoSmallestLastOrdering();
00117 
00118                 //Public Function 1360
00119                 int IncidenceDegreeOrdering();
00120 
00121                 //Public Function 1361
00122                 int DistanceTwoIncidenceDegreeOrdering();
00123 
00124                 //Public Function 1362
00125                 string GetVertexOrderingVariant();
00126 
00127                 //Public Function 1363
00128                 void GetOrderedVertices(vector<int> &output);
00129                 vector <int>* GetOrderedVerticesPtr(){ return &m_vi_OrderedVertices; }
00130 
00131                 void PrintVertexOrdering();
00132 
00133                 //Public Function 1364
00134                 double GetVertexOrderingTime();
00135         };
00136 }
00137 #endif
00138 
00139 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines