Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "ColPackHeaders.h"
00021
00022 using namespace ColPack;
00023 using namespace std;
00024
00025 #ifndef TOP_DIR
00026 #define TOP_DIR "."
00027 #endif
00028
00029
00030 string baseDir=TOP_DIR;
00031
00032
00033 int main(int argc, char ** argv)
00034 {
00035
00036 string s_InputFile;
00037 s_InputFile = baseDir;
00038 s_InputFile += DIR_SEPARATOR; s_InputFile += "Graphs"; s_InputFile += DIR_SEPARATOR; s_InputFile += "column-compress.mtx";
00039
00040
00041 BipartiteGraphBicoloringInterface *g = new BipartiteGraphBicoloringInterface(SRC_FILE, s_InputFile.c_str(), "AUTO_DETECTED");
00042
00043
00044 g->Bicoloring( "SMALLEST_LAST", "IMPLICIT_COVERING__STAR_BICOLORING");
00045
00046
00047
00048
00049
00050
00051 cout<<"Check Star Bicoloring Coloring result ... "<<endl;
00052 g->CheckStarBicoloring();
00053 Pause();
00054
00055
00056
00057 g->PrintVertexBicoloringMetrics();
00058 Pause();
00059
00060
00061
00062 vector<int> vi_LeftVertexColors;
00063 g->GetLeftVertexColors(vi_LeftVertexColors);
00064
00065 vector<int> vi_RightVertexColors;
00066 g->GetRightVertexColors(vi_RightVertexColors);
00067
00068
00069 g->PrintVertexBicolors();
00070 Pause();
00071
00072
00073
00074 int i_LeftSeedRowCount = 0;
00075 int i_LeftSeedColumnCount = 0;
00076 double** LeftSeed = g->GetLeftSeedMatrix(&i_LeftSeedRowCount, &i_LeftSeedColumnCount);
00077
00078 int i_RightSeedRowCount = 0;
00079 int i_RightSeedColumnCount = 0;
00080 double** RightSeed = g->GetRightSeedMatrix(&i_RightSeedRowCount, &i_RightSeedColumnCount);
00081
00082
00083 printf("Left Seed matrix %d x %d \n", i_LeftSeedRowCount, i_LeftSeedColumnCount);
00084 displayMatrix(LeftSeed, i_LeftSeedRowCount, i_LeftSeedColumnCount, 1);
00085 Pause();
00086
00087 printf("Right Seed matrix %d x %d \n", i_RightSeedRowCount, i_RightSeedColumnCount);
00088 displayMatrix(RightSeed, i_RightSeedRowCount, i_RightSeedColumnCount, 1);
00089 Pause();
00090
00091
00092 delete g;
00093 return 0;
00094 }
00095