jkunlin пре 7 година
родитељ
комит
b685f40a61
7 измењених фајлова са 497 додато и 327 уклоњено
  1. 2 0
      arch_tool/Makefile
  2. 9 8
      arch_tool/prun.sh
  3. 119 38
      arch_tool/stat.cc
  4. 30 0
      filter.cpp
  5. 1 1
      stat/Makefile
  6. 296 265
      stat/latex_table.cpp
  7. 40 15
      stat/latex_table.sh

+ 2 - 0
arch_tool/Makefile

@@ -0,0 +1,2 @@
+stat : stat.cc
+	g++ stat.cc -o stat -O2 -std=c++11

+ 9 - 8
arch_tool/prun.sh

@@ -1,30 +1,31 @@
 # !/bin/bash
 
-instance_dirs="bio col fb inf int rec ret sci soc tec web quasiRegular heavyTail snap"
+# instance_dirs="bio col fb inf int rec ret sci soc tec web converted"
+instance_dirs="weighted_graph_wyy"
 
-all_results_dir="./all_satur_color_gc_arch"
-graph_dir="./all_satur_color_gc"
+result_dir="$1"
+target_dir="$1"_arch
 
-if [ ! -d "$all_results_dir" ]
+if [ ! -d "$target_dir" ]
 then
-	mkdir "$all_results_dir"
+	mkdir "$target_dir"
 fi
 
 for ins_dir in $instance_dirs
 do
 	echo "$ins_dir"
-	res_dir="$all_results_dir"/"$ins_dir"
+	res_dir="$target_dir"/"$ins_dir"
 	if [ ! -d "$res_dir" ]
 	then
 		mkdir "$res_dir"
 	fi
-	find  "$graph_dir/$ins_dir" -maxdepth 1 -mindepth 1 |
+	find  "$result_dir/$ins_dir" -maxdepth 1 -mindepth 1 |
 	while read instance
 	do
 		instance=$(basename "$instance")
 		res_file="$res_dir"/"$instance"
 		res_file=${res_file%%_seed*}
-		./stat "$graph_dir/$ins_dir/$instance"  >> "$res_file"
+		~/little_tools/arch_tool/stat "$result_dir/$ins_dir/$instance"  >> "$res_file"
 	done
 done
 

+ 119 - 38
arch_tool/stat.cc

@@ -13,48 +13,129 @@
 //   Organization:  School of EECS, Peking University
 //
 // =====================================================================================
-#include <iostream>
+#include <cstdio>
 #include <fstream>
+#include <iostream>
 #include <sstream>
 #include <string>
 using namespace std;
 
+string basename(string name) {
+  size_t begin = name.find_last_of('/');
+  return name.substr(begin + 1, name.size() - begin);
+}
+
 int main(int argc, char const *argv[]) {
-	if (argc != 2) {
-		return 1;
-	}
-	string filename = argv[1];
-	ifstream infile(filename);
-	if (!infile) {
-		std::cout << "file" << std::endl;
-		return 1;
-	}
-
-	size_t b = filename.find_last_of('_') + 5;
-	size_t e = filename.find_last_of('.');
-	string seed = filename.substr(b, e - b);
-
-	double cutoff = 120;
-
-	string line, tmp;
-	int size, old_size = 0;
-	double time, old_time = 0;
-	char exact = 'h';
-
-	while (getline(infile, line)) {
-		istringstream is(line);
-		is >> tmp >> size >> time;
-		if (time > cutoff) {
-			size = old_size;
-			time = old_time;
-		}
-		else {
-			old_size = size;
-			old_time = time;
-		}
-	}
-
-	std::cout << seed << '\t' << size << '\t' <<  time << '\t' << exact << std::endl;
-
-	return 0;
+  if (argc != 2) {
+    return 1;
+  }
+  string filename = argv[1];
+  ifstream infile(filename);
+  if (!infile) {
+    std::cout << "file" << std::endl;
+    return 1;
+  }
+
+  size_t b = filename.find_last_of('_') + 5;
+  size_t e = filename.find_last_of('.');
+  string seed = filename.substr(b, e - b);
+
+  double cutoff = 100;
+
+  string line, tmp;
+  int size = 0, old_size = 0;
+  double time = 0, old_time = 0;
+  char exact = 'h', old_exact = 'h';
+
+  /*
+  // fastwclq
+  while (getline(infile, line)) {
+    istringstream is(line);
+    for (int i = 0; i < 2; ++i) {
+      is >> tmp;
+    }
+    is >> size >> time >> tmp >> exact;
+
+    if (!is) {
+      size = old_size;
+      time = old_time;
+      exact = old_exact;
+      break;
+    }
+
+    if (time > cutoff) {
+      size = old_size;
+      time = old_time;
+      exact = old_exact;
+      break;
+    } else {
+      old_size = size;
+      old_time = time;
+      old_exact = exact;
+    }
+  }
+  */
+  // lscc
+  while (getline(infile, line)) {
+    istringstream is(line);
+    for (int i = 0; i < 4; ++i) {
+      is >> tmp;
+    }
+    char ch;
+    is >> time >> ch >> size;
+
+    if (!is) {
+      size = old_size;
+      time = old_time;
+      exact = old_exact;
+      break;
+    }
+
+    if (time > cutoff) {
+      size = old_size;
+      time = old_time;
+      exact = old_exact;
+      break;
+    } else {
+      old_size = size;
+      old_time = time;
+      old_exact = exact;
+    }
+  }
+  // fanyi
+  // getline(infile, line); // read time
+  // while (getline(infile, line)) {
+  //   istringstream is(line);
+  //   for (int i = 0; i < 1; ++i) {
+  //     is >> tmp;
+  //   }
+  //   is >> size >> time;
+  //
+  //   if (!is) {
+  //     size = old_size;
+  //     time = old_time;
+  //     exact = old_exact;
+  //     break;
+  //   }
+  //
+  //   if (time > cutoff) {
+  //     size = old_size;
+  //     time = old_time;
+  //     exact = old_exact;
+  //     break;
+  //   } else {
+  //     old_size = size;
+  //     old_time = time;
+  //     old_exact = exact;
+  //   }
+  // }
+
+  std::cout << seed << '\t' << size << '\t' << time << '\t' << exact
+            << std::endl;
+
+  if (size == 0) {
+    cerr << "size = 0\t" << basename(filename) << endl;
+  }
+
+  return 0;
 }

+ 30 - 0
filter.cpp

@@ -0,0 +1,30 @@
+// =====================================================================================
+//
+//       Filename:  filter.cpp
+//
+//    Description:
+//
+//        Version:  1.0
+//        Created:  Fri Apr 26 12:48:03 CST 2019
+//       Revision:  none
+//       Compiler:  g++
+//
+//         Author:  Jinkun Lin, jkunlin@gmail.com
+//   Organization:  School of EECS, Peking University
+//
+// =====================================================================================
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <vector>
+using namespace std;
+
+int main(int argc, const char *argv[]) {
+  ifstream instance_name_file(argv[1]);
+  if (!instance_name_file) {
+    std::cout << "instance_name_file open error" << std::endl;
+    return 1;
+  }
+
+  return 0;
+}

+ 1 - 1
stat/Makefile

@@ -19,4 +19,4 @@ run:
 	- rm sort.tex
 	./latex_table.sh
 	./win arch.result
-	cat bold_table.tex | sort -k1 -t ' ' > sort.tex
+	cat bold_table.tex | sort -k1 -s -t '-' > sort.tex

+ 296 - 265
stat/latex_table.cpp

@@ -13,281 +13,312 @@
 //   Organization:  School of EECS, Peking University
 //
 // =====================================================================================
-#include <iostream>
+#include <algorithm>
 #include <fstream>
+#include <iostream>
+#include <limits>
 #include <sstream>
 #include <vector>
-#include <algorithm>
-#include <limits>
 using namespace std;
 
-bool small = true;
+bool SMALL_BETTER = false;
+int FAILED_SIZE = numeric_limits<int>::min();
+double PENALTY_TIME = 100;
+double DELTA = 0.0001;
 
 string basename(string name) {
-	size_t begin = name.find_last_of('/');
-	return name.substr(begin + 1, name.size() - begin);
+  size_t begin = name.find_last_of('/');
+  return name.substr(begin + 1, name.size() - begin);
 }
 
-template<class T1, class T2>
-bool better(T1 a, T2 b) {
-	return small ? a < b : a > b;
+bool equal_for_double(double d1, double d2, double delta = DELTA) {
+  return fabs(d1 - d2) < delta;
 }
 
-int main(int argc, char const *argv[]) {
-	int solver_count = argc - 1;
-
-	// =====================================================================================
-	//      read data from file
-	// =====================================================================================
-	vector<vector<int>> size_matrix (solver_count);
-	vector<vector<double>> time_matrix (solver_count);
-	vector<vector<char>> exact_matrix (solver_count);
-
-	for (int i = 0; i < solver_count; ++i) {
-		ifstream in_file(argv[i + 1]);
-		if (!in_file) {
-			std::cout << argv[i + 1] << '\t' <<  i + 1 <<  " file error" << std::endl;
-			return 1;
-		}
-		int seed, size;
-		double solver_time;
-		char exact;
-		while (in_file >> seed >> size >> solver_time >> exact) {
-			size_matrix[i].push_back(size);
-			time_matrix[i].push_back(solver_time);
-			exact_matrix[i].push_back(exact);
-		}
-		in_file.close();
-	}
-
-	// =====================================================================================
-	//       caculate data
-	// =====================================================================================
-	vector<int> best_size (solver_count);
-	vector<double> avg_size (solver_count);
-	vector<double> avg_time (solver_count);
-	vector<int> is_exact (solver_count, 0);
-
-	int g_best_size = small ? std::numeric_limits<int>::max() : 0;
-	double g_avg_best_size = small ? std::numeric_limits<double>::max() : 0;
-	double g_min_avg_t = std::numeric_limits<double>::max();
-
-	for (int i = 0; i < solver_count; ++i) {
-		int okay_count = 0;
-
-		int best_s = size_matrix[i][0];
-		double avg_s = size_matrix[i][0];
-		double avg_t = time_matrix[i][0];
-
-		if (size_matrix[i][0] != 0) {
-			okay_count++;
-		}
-
-		for (size_t j = 1; j < size_matrix[i].size(); ++j) {
-			if (better(size_matrix[i][j], best_s)) {
-				best_s = size_matrix[i][j];
-			}
-
-			avg_s += size_matrix[i][j];
-
-			avg_t += time_matrix[i][j];
-
-			if (exact_matrix[i][j] == 'x') {
-				is_exact[i] = 1;
-			}
-
-			if (size_matrix[i][j] != 0) {
-				okay_count++;
-			}
-		}
-
-
-		best_size[i] = best_s;
-		if (okay_count != 0) {
-			avg_size[i] = round(avg_s / okay_count * 100) / 100;
-			avg_time[i] = round(avg_t / okay_count * 100) / 100;
-		}
-		else {
-			avg_size[i] = 0;
-			avg_time[i] = 0;
-		}
-
-		if (okay_count == 0) {
-			continue;
-		}
-
-		if (better(best_size[i], g_best_size)) {
-			g_best_size = best_size[i];
-		}
-		if (better(avg_size[i], g_avg_best_size)) {
-			g_avg_best_size = avg_size[i];
-		}
-		if (g_min_avg_t > avg_time[i]) {
-			g_min_avg_t = avg_time[i];
-		}
-	}
-
-	// =====================================================================================
-	//       generate latex table
-	// =====================================================================================
-	ofstream out_latex("bold_table.tex", ios::app);
-	if (!out_latex) {
-		std::cout << "out file error" << std::endl;
-		return 1;
-	}
-	auto bf_write = [&](double d, bool is_bf) {
-		if (is_bf) {
-			out_latex << "\\textbf{" << d << "}";
-		}
-		else {
-			out_latex << d;
-		}
-	};
-	auto bf_write_time = [&](double d, bool is_bf) {
-		if (is_bf) {
-			if (d < 0.01) {
-				out_latex << "\\boldmath{$<$}\\textbf{0.01}";
-			}
-			else {
-				out_latex << "\\textbf{" << d << "}";
-			}
-		}
-		else {
-			if (d < 0.01) {
-				out_latex << "$<$0.01";
-			}
-			else {
-				out_latex << d;
-			}
-		}
-	};
-
-	out_latex << basename(argv[1]) << " & ";
-	int s_win_count = 0;
-	int avg_s_win_count = 0;
-	int avg_t_win_count = 0;
-	for (int i = 0; i < solver_count; ++i) {
-		if (best_size[i] == g_best_size) {
-			s_win_count++;
-		}
-		if (avg_size[i] == g_avg_best_size) {
-			avg_s_win_count++;
-		}
-		if (avg_time[i] == g_min_avg_t) {
-			avg_t_win_count++;
-		}
-	}
-
-	for (int i = 0; i < solver_count; ++i) {
-		if (best_size[i] == 0) {
-			out_latex << "N/A" << " & " << "N/A";
-			if (i == solver_count - 1) {
-				out_latex << " \\\\" << std::endl;
-			}
-			else {
-				out_latex << " & ";
-			}
-			continue;
-		}
-		// size
-		if (best_size[i] != avg_size[i]) {  // max size dosen't equal to avg size
-			if (s_win_count != solver_count) {
-				bf_write(best_size[i], best_size[i] == g_best_size);
-			}
-			else {
-				bf_write(best_size[i], false);
-			}
-
-			out_latex << "(";
-			if (avg_s_win_count != solver_count) {
-				bf_write(avg_size[i], avg_size[i] == g_avg_best_size);
-			}
-			else {
-				bf_write(avg_size[i], false);
-			}
-			out_latex << ")";
-		}
-		else {
-			if (s_win_count != solver_count || avg_s_win_count != solver_count) {
-				bf_write(best_size[i], best_size[i] == g_best_size || avg_size[i] == g_avg_best_size);
-			}
-			else {
-				bf_write(best_size[i], false);
-			}
-		}
-
-		if (is_exact[i]) {
-			out_latex << "$^*$";
-		}
-
-		out_latex << " & ";
-
-		// time
-		if (s_win_count == solver_count && avg_s_win_count == solver_count &&
-				avg_t_win_count != solver_count) {
-			bf_write_time(avg_time[i], avg_time[i] == g_min_avg_t);
-		}
-		else {
-			bf_write_time(avg_time[i], false);
-		}
-
-		if (i == solver_count - 1) {
-			out_latex << " \\\\" << std::endl;
-		}
-		else {
-			out_latex << " & ";
-		}
-	}
-	out_latex.close();
-
-	// =====================================================================================
-	//       generate compare file
-	// =====================================================================================
-	vector<bool> win (solver_count, false);
-	// if (s_win_count != solver_count || avg_s_win_count != solver_count) {
-		for (int i = 0; i < solver_count; ++i) {
-			if (best_size[i] == g_best_size && avg_size[i] == g_avg_best_size) {
-			// if (best_size[i] == g_best_size) {
-				win[i] = true;
-			}
-		}
-	// }
-	ofstream out_arch("arch.result", ios::app);
-	if (!out_arch) {
-		std::cout << "arch file error" << std::endl;
-		return 1;
-	}
-
-	// win
-	out_arch << (win[0] ? 1 : 0);
-	for (int i = 1; i < solver_count; ++i) {
-		out_arch << '\t' << (win[i] ? 1 : 0);
-	}
-	out_arch << std::endl;
-
-	// time
-	out_arch << avg_time[0];
-	for (int i = 1; i < solver_count; ++i) {
-		out_arch << '\t' <<  avg_time[i];
-	}
-	out_arch << std::endl;
-
-	// okay solver
-	out_arch << (best_size[0] != 0 ? 1 : 0);
-	for (int i = 1; i < solver_count; ++i) {
-		out_arch << '\t' << (best_size[i] != 0 ? 1 : 0);
-	}
-	out_arch << endl;
-
-	// exact
-	out_arch << (is_exact[0] != 0 ? 1 : 0);
-	for (int i = 1; i < solver_count; ++i) {
-		out_arch << '\t' << (is_exact[i] != 0 ? 1 : 0);
-	}
-	out_arch << endl;
-
-
-	out_arch.close();
+template <class T1, class T2> bool better(T1 a, T2 b) {
+  return SMALL_BETTER ? a < b : a > b;
+}
 
-	return 0;
+int main(int argc, char const *argv[]) {
+  int solver_count = argc - 1;
+
+  // =====================================================================================
+  //      read data from file
+  // =====================================================================================
+  vector<vector<int>> size_matrix(solver_count);
+  vector<vector<double>> time_matrix(solver_count);
+  vector<vector<char>> exact_matrix(solver_count);
+
+  for (int i = 0; i < solver_count; ++i) {
+    ifstream in_file(argv[i + 1]);
+
+    in_file.seekg(0, in_file.end);
+    int length = in_file.tellg();
+    in_file.seekg(0, in_file.beg);
+    if (!in_file || length == 0) {
+      std::cout << argv[i + 1] << '\t' << i + 1 << " file error" << std::endl;
+      for (int j = 0; j < 10; ++j) {
+        size_matrix[i].push_back(FAILED_SIZE);
+        time_matrix[i].push_back(PENALTY_TIME);
+        exact_matrix[i].push_back('h');
+      }
+      continue;
+    }
+
+    int seed, size;
+    double solver_time;
+    char exact;
+    while (in_file >> seed >> size >> solver_time >> exact) {
+      if (size == 0) {
+        size_matrix[i].push_back(FAILED_SIZE);
+        time_matrix[i].push_back(PENALTY_TIME);
+        exact_matrix[i].push_back('h');
+      } else {
+        size_matrix[i].push_back(size);
+        time_matrix[i].push_back(solver_time);
+        exact_matrix[i].push_back(exact);
+      }
+    }
+    in_file.close();
+  }
+
+  // =====================================================================================
+  //       caculate data
+  // =====================================================================================
+  vector<int> best_size(solver_count);
+  vector<double> avg_size(solver_count);
+  vector<double> avg_time(solver_count);
+  vector<int> is_exact(solver_count, 0);
+
+  int g_best_size = FAILED_SIZE;
+  double g_avg_best_size = FAILED_SIZE;
+  double g_min_avg_t = std::numeric_limits<double>::max();
+
+  for (int i = 0; i < solver_count; ++i) {
+    int okay_count = 0;
+
+    int best_s = FAILED_SIZE;
+    double avg_s = 0;
+    double avg_t = 0;
+    for (int j = 0; j < size_matrix[i].size(); j++) {
+      if (size_matrix[i][j] != FAILED_SIZE) {
+        if (best_s == FAILED_SIZE || better(size_matrix[i][j], best_s)) {
+          best_s = size_matrix[i][j];
+        }
+        avg_s += size_matrix[i][j];
+        avg_t += time_matrix[i][j];
+        if (exact_matrix[i][j] == 'x') {
+          is_exact[i] = 1;
+        }
+        okay_count++;
+      } else {
+        avg_t += PENALTY_TIME;
+      }
+    }
+
+    if (okay_count != 0) {
+      best_size[i] = best_s;
+      avg_size[i] = round(avg_s / okay_count * 100) / 100;
+      avg_time[i] = round(avg_t / size_matrix[i].size() * 100) / 100;
+
+      if (better(best_size[i], g_best_size)) {
+        g_best_size = best_size[i];
+      }
+      if (better(avg_size[i], g_avg_best_size)) {
+        g_avg_best_size = avg_size[i];
+      }
+      if (g_min_avg_t > avg_time[i]) {
+        g_min_avg_t = avg_time[i];
+      }
+    } else {
+      best_size[i] = FAILED_SIZE;
+      avg_size[i] = FAILED_SIZE;
+      avg_time[i] = PENALTY_TIME;
+    }
+  }
+
+  // =====================================================================================
+  //       generate latex table
+  // =====================================================================================
+  ofstream out_latex("bold_table.tex", ios::app);
+  if (!out_latex) {
+    std::cout << "out file error" << std::endl;
+    return 1;
+  }
+  auto bf_write = [&](double d, bool is_bf) {
+    if (is_bf) {
+      out_latex << "\\textbf{" << d << "}";
+    } else {
+      out_latex << d;
+    }
+  };
+  auto bf_write_time = [&](double d, bool is_bf) {
+    if (is_bf) {
+      if (d < 0.01) {
+        out_latex << "\\boldmath{$<$}\\textbf{0.01}";
+      } else {
+        out_latex << "\\textbf{" << d << "}";
+      }
+    } else {
+      if (d < 0.01) {
+        out_latex << "$<$0.01";
+      } else {
+        out_latex << d;
+      }
+    }
+  };
+
+  out_latex << basename(argv[1]) << " & ";
+  bool has_double_winner = false;
+  int s_win_count = 0;
+  int avg_s_win_count = 0;
+  int avg_t_win_count = 0;
+  for (int i = 0; i < solver_count; ++i) {
+    if (best_size[i] == g_best_size) {
+      s_win_count++;
+    }
+    if (equal_for_double(avg_size[i], g_avg_best_size)) {
+      avg_s_win_count++;
+    }
+    if (equal_for_double(avg_time[i], g_min_avg_t)) {
+      avg_t_win_count++;
+    }
+
+    if (best_size[i] == g_best_size &&
+        equal_for_double(avg_size[i], g_avg_best_size)) {
+      has_double_winner = true;
+    }
+  }
+
+  for (int i = 0; i < solver_count; ++i) {
+    if (best_size[i] == FAILED_SIZE) {
+      out_latex << "N/A"
+                << " & "
+                << "N/A";
+      if (i == solver_count - 1) {
+        out_latex << " \\\\" << std::endl;
+      } else {
+        out_latex << " & ";
+      }
+      continue;
+    }
+    // size
+
+    if (equal_for_double(best_size[i], avg_size[i])) {
+      if (has_double_winner) {
+        if ((s_win_count != solver_count || avg_s_win_count != solver_count) &&
+            best_size[i] == g_best_size &&
+            equal_for_double(avg_size[i], g_avg_best_size)) {
+          bf_write(best_size[i], true);
+        } else {
+          bf_write(best_size[i], false);
+        }
+      } else {
+        bf_write(best_size[i],
+                 best_size[i] == g_best_size ||
+                     equal_for_double(avg_size[i], g_avg_best_size));
+      }
+    } else { // max size dosen't equal to avg size
+      if (has_double_winner) {
+        if ((s_win_count != solver_count || avg_s_win_count != solver_count) &&
+            (best_size[i] == g_best_size &&
+             equal_for_double(avg_size[i], g_avg_best_size))) {
+          bf_write(best_size[i], true);
+          out_latex << "(";
+          bf_write(avg_size[i], true);
+          out_latex << ")";
+        } else {
+          bf_write(best_size[i], false);
+          out_latex << "(";
+          bf_write(avg_size[i], false);
+          out_latex << ")";
+        }
+      } else {
+        if (s_win_count != solver_count) {
+          bf_write(best_size[i], best_size[i] == g_best_size);
+        } else {
+          bf_write(best_size[i], false);
+        }
+
+        out_latex << "(";
+        if (avg_s_win_count != solver_count) {
+          bf_write(avg_size[i], equal_for_double(avg_size[i], g_avg_best_size));
+        } else {
+          bf_write(avg_size[i], false);
+        }
+        out_latex << ")";
+      }
+    }
+    if (is_exact[i]) {
+      out_latex << "$^*$";
+    }
+
+    out_latex << " & ";
+
+    // time
+    if (s_win_count == solver_count && avg_s_win_count == solver_count &&
+        avg_t_win_count != solver_count) {
+      bf_write_time(avg_time[i], equal_for_double(avg_time[i], g_min_avg_t));
+    } else {
+      bf_write_time(avg_time[i], false);
+    }
+
+    if (i == solver_count - 1) {
+      out_latex << " \\\\" << std::endl;
+    } else {
+      out_latex << " & ";
+    }
+  }
+  out_latex.close();
+
+  // =====================================================================================
+  //       generate compare file
+  // =====================================================================================
+  vector<bool> win(solver_count, false);
+  // if (s_win_count != solver_count || avg_s_win_count != solver_count) {
+  for (int i = 0; i < solver_count; ++i) {
+    if (best_size[i] == g_best_size &&
+        equal_for_double(avg_size[i], g_avg_best_size)) {
+      // if (best_size[i] == g_best_size) {
+      win[i] = true;
+    }
+  }
+  // }
+  ofstream out_arch("arch.result", ios::app);
+  if (!out_arch) {
+    std::cout << "arch file error" << std::endl;
+    return 1;
+  }
+
+  // win
+  out_arch << (win[0] ? 1 : 0);
+  for (int i = 1; i < solver_count; ++i) {
+    out_arch << '\t' << (win[i] ? 1 : 0);
+  }
+  out_arch << std::endl;
+
+  // time
+  out_arch << avg_time[0];
+  for (int i = 1; i < solver_count; ++i) {
+    out_arch << '\t' << avg_time[i];
+  }
+  out_arch << std::endl;
+
+  // okay solver
+  out_arch << (best_size[0] != FAILED_SIZE ? 1 : 0);
+  for (int i = 1; i < solver_count; ++i) {
+    out_arch << '\t' << (best_size[i] != FAILED_SIZE ? 1 : 0);
+  }
+  out_arch << endl;
+
+  // exact
+  out_arch << (is_exact[0] != 0 ? 1 : 0);
+  for (int i = 1; i < solver_count; ++i) {
+    out_arch << '\t' << (is_exact[i] != 0 ? 1 : 0);
+  }
+  out_arch << endl;
+
+  out_arch.close();
+
+  return 0;
 }

+ 40 - 15
stat/latex_table.sh

@@ -3,18 +3,43 @@
 # bio col fb inf int rec ret sci soc tec web
 #~/massive-graphs/${dir}/focus/*.dim; do
 
-# Cutoff=100
-# Solver_DIR1="./fastwclq/169cd"
-# Solver_DIR2="./wlmc/noproof_""$Cutoff""s_format"
-# Solver_DIR3="./lscc/include_""$Cutoff""s_format"
-# Solver_DIR4="./fanyi/include_""$Cutoff""s_format"
-# Solver_DIR5="./hao-jinkao/rets1_""$Cutoff""s_format"
-# Solver_DIR6="./hao-jinkao/rets2_""$Cutoff""s_format"
-
-Solver_DIR1="./fastwclq/63e68_ran/63e68_1_0"
-Solver_DIR2="./fastwclq/63e68_ran/63e68_0"
-# Solver_DIR3="./fastwclq/63e68_ran/63e68_1_0"
-# Solver_DIR4="./fastwclq/63e68_ran/63e68_0"
+Solver_DIR1="/home/jkunlin/mcq/final_ios_result/fastwclq/fafe20/arch/fafe20_wyy_arch"
+Solver_DIR2="/home/jkunlin/mcq/final_ios_result/TSM/arch/noproof_wyy_1000s_format"
+Solver_DIR3="/home/jkunlin/mcq/final_ios_result/lscc/arch/1000s_wyy"
+Solver_DIR4="/home/jkunlin/mcq/final_ios_result/Fanyi/arch/1000s_wyy"
+
+# Solver_DIR1="/home/jkunlin/mcq/final_ios_result/fastwclq/tmp/fafe20_arch"
+# Solver_DIR2="/home/jkunlin/mcq/final_ios_result/wcmwc/arch/noproof_100s_format"
+# Solver_DIR3="/home/jkunlin/mcq/final_ios_result/wlmc/arch/noproof_100s_format"
+# Solver_DIR4="/home/jkunlin/mcq/final_ios_result/Fanyi/arch/include_init_all_100s_arch"
+# Solver_DIR5="/home/jkunlin/mcq/final_ios_result/lscc/arch/include_init_ios_100s_arch"
+# Solver_DIR6="/home/jkunlin/mcq/final_ios_result/hao-jinkao/arch/rets1_100s_format"
+# Solver_DIR7="/home/jkunlin/mcq/final_ios_result/hao-jinkao/arch/rets2_100s_format"
+
+# Solver_DIR1="/home/jkunlin/mcq/final_ios_result/fastwclq/tmp/fafe20_truncated_arch"
+# Solver_DIR2="/home/jkunlin/mcq/final_ios_result/wcmwc/arch/noproof_truncated_100s_format"
+# Solver_DIR3="/home/jkunlin/mcq/final_ios_result/wlmc/arch/noproof_100s_truncated_format"
+# Solver_DIR4="/home/jkunlin/mcq/final_ios_result/Fanyi/arch/include_init_all_100s_truncated_arch"
+# Solver_DIR5="/home/jkunlin/mcq/final_ios_result/lscc/arch/include_init_ios_truncated_100s_arch"
+# Solver_DIR1="/home/jkunlin/mcq/final_ios_result/fastwclq/tmp/fafe20_truncated_ub0_arch"
+# Solver_DIR2="/home/jkunlin/mcq/final_ios_result/fastwclq/tmp/fafe20_truncated_ub01_arch"
+# Solver_DIR3="/home/jkunlin/mcq/final_ios_result/fastwclq/tmp/fafe20_truncated_ub02_arch"
+# Solver_DIR4="/home/jkunlin/mcq/final_ios_result/fastwclq/fafe20/arch/fafe20_truncated_arch"
+
+# Solver_DIR2="/home/jkunlin/mcq/final_ios_result/wcmwc/arch/noproof_truncated_100s_format"
+# Solver_DIR3="/home/jkunlin/mcq/final_ios_result/wlmc/arch/noproof_100s_truncated_format"
+
+# Solver_DIR1="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_all_arch"
+# Solver_DIR2="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_noub1_arch"
+# Solver_DIR3="/home/jkunlin/mcq/ios_result/fastwlcq/ran100/verbose_f90ee89_nocolor_ran100_arch"
+# Solver_DIR4="/home/jkunlin/mcq/ios_result/fastwlcq/ran100/verbose_f90ee89_noub1_ran100_arch"
+
+# Solver_DIR1="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_all_arch"
+# Solver_DIR2="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_color_rerun_arch"
+# Solver_DIR3="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_nocolor_arch"
+# Solver_DIR4="/home/jkunlin/mcq/ios_result/fastwlcq/verbose_f90ee89_noub1_arch"
+# Solver_DIR1="./combine_10_reduce2_final_arch"
+# Solver_DIR2="./weighted_color_final_arch"
 find "$Solver_DIR1" -maxdepth 1 -mindepth 1| while read dir
 do
 	sub_dir=$(basename "$dir")
@@ -28,8 +53,8 @@ do
 	do
 		filename=$(basename "$file")
 		./latex_table "$Solver_DIR1"/"$sub_dir"/"$filename" "$Solver_DIR2"/"$sub_dir"/"$filename" \
-			# "$Solver_DIR3"/"$sub_dir"/"$filename" "$Solver_DIR4"/"$sub_dir"/"$filename" \
-			# "$Solver_DIR5"/"$sub_dir"/"$filename" "$Solver_DIR6"/"$sub_dir"/"$filename"
+      "$Solver_DIR3"/"$sub_dir"/"$filename" \
+          "$Solver_DIR4"/"$sub_dir"/"$filename"
+          # "$Solver_DIR5"/"$sub_dir"/"$filename" 
 	done
-
 done