#include #include #include using namespace std; void generate (int n, int m); /** * ./combGenerator3 N mult * Generate a graph with N nodes 2N-3 edges, mult*N badge IDs that requires * most nodes to be visited at least twice * to resolve the badge ID propogation. */ int main (int argc, char** argv) { int N = atoi(argv[1]); int mult = atoi(argv[2]); generate(N, mult); return 0; } void generate (int N, int badgeMult) { int L = N + N - 3; int B = badgeMult*N; ofstream inputData (string("combs") + to_string(N) + ".in"); inputData << N << ' ' << L << ' ' << B << endl; inputData << 0 << ' ' << N-1 << endl; for (int i = 1; i <= N-2; ++i) { inputData << 0 << ' ' << i << ' ' << badgeMult*i << ' ' << badgeMult*(i+1)-2 << endl; } inputData << (N-2) << ' ' << 1 << ' ' << 0 << ' ' << badgeMult*(N-1)-3 << endl; for (int i = 1; i < N-2; ++i) inputData << i << ' ' << i+1 << ' ' << i << ' ' << B-1 << endl; inputData << 2 << ' ' << N-1 << ' ' << 0 << ' ' << B-2 << endl; inputData.close(); ofstream answerData (string("combs") + to_string(N) + ".ans"); answerData << (badgeMult-1)*(N-2) - 1 << endl; answerData.close(); }