00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00018
00020
00021
00022 #include "StableSetMaster.hh"
00023 #include <iostream>
00024
00025 using namespace std;
00026
00027
00031 int main(int argc, char *argv[]) {
00032
00033
00034
00035 #ifdef ABACUS_VISUAL_CPP
00036 char inputFileName[100];
00037 char inequalitiesFileName[100];
00038 char smallGraphFileName[100];
00039 #else
00040 char *inputFileName;
00041 char *inequalitiesFileName;
00042 char *smallGraphFileName;
00043 #endif
00044
00045
00046 #ifdef ABACUS_VISUAL_CPP
00047
00048 cout << "input file: ";
00049 cin >> inputFileName;
00050 cout << "inequalities file: ";
00051 cin >> inequalitiesFileName;
00052 cout << "small graph file: ";
00053 cin >> smallGraphFileName;
00054 #else
00055
00056 if (argc != 4){
00057 cerr << "usage: " << argv[0] << " <instance> <inequalities>";
00058 cerr << " <smallGraphName>";
00059 cerr << endl;
00060 return 1;
00061 }
00062 inputFileName = argv[1];
00063 inequalitiesFileName = argv[2];
00064 smallGraphFileName = argv[3];
00065 #endif
00066
00067
00068
00069
00070 StableSetMaster *stableSet;
00071 stableSet = new StableSetMaster(inputFileName, inequalitiesFileName,
00072 smallGraphFileName);
00073 ABA_MASTER::STATUS status = stableSet->optimize();
00074
00075
00076 delete stableSet;
00077
00078
00079 cout << "\n\nCheck inequalities:" << endl;
00080 cout << "----------------------------------------------------";
00081 cout << "------------------------------------------" << endl;
00082
00083
00084
00085
00086 string check("./CheckInequalities.exe ");
00087 check.append("~/Diplomarbeit/Abacus/Stable_Set/Instanzen/");
00088 check.append(inputFileName);
00089 check.append(" ");
00090 check.append(inequalitiesFileName);
00091
00092
00093 int notValid = system(check.c_str());
00094 check.clear();
00095
00096 cout << "----------------------------------------------------";
00097 cout << "------------------------------------------\n" << endl;
00098
00099 if(status || notValid) {
00100 cout << "\nNOT OPTIMAL." << endl;
00101 return 1;
00102 }
00103 else {
00104 cout << "Optimality profen.\n" << endl;
00105 return 0;
00106 }
00107 }
00108
00109