diff --git a/cpp/switchchain_ccm_cputime.cpp b/cpp/switchchain_ccm_cputime.cpp index 430bbe9ddb79c213cf34b8f5857785958c8824f0..79016ad59460a1dde877a4cd124d048e8dd0e608 100644 --- a/cpp/switchchain_ccm_cputime.cpp +++ b/cpp/switchchain_ccm_cputime.cpp @@ -13,12 +13,12 @@ int main(int argc, char* argv[]) { // Simulation parameters - const int numVerticesMin = 1000; - const int numVerticesMax = 1000; + const int numVerticesMin = 10000; + const int numVerticesMax = 10000; const int numVerticesStep = 1000; //float tauValues[] = {2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f}; - float tauValues[] = {2.1f, 2.3f, 2.5f, 2.7f, 2.9f}; + float tauValues[] = {2.1f, 2.5f, 2.9f}; //const int totalDegreeSamples = 10; const int totalDegreeSamples = 1; @@ -53,6 +53,7 @@ int main(int argc, char* argv[]) { outfile << "3: HH timed triangle seq\n"; outfile << "4: {ccm1 failed attempts, timed triangle seq}\n"; outfile << "5: {ccm2 failed attempts, timed triangle seq}\n"; + outfile << "6: slow-sort-HH timed triangle seq\n"; outfile << "*)" << std::endl; // Mathematica does not accept normal scientific notation @@ -79,17 +80,16 @@ int main(int argc, char* argv[]) { << "). " << std::flush; SwitchChain chain; - if (!chain.initialize(g, true)) { - std::cerr << "Could not initialize Markov chain.\n"; - return 1; - } - std::vector> triangleSeq(mixingTime); { // record start time auto start = std::chrono::high_resolution_clock::now(); // Incorporate Havel-Hakimi time g.createFromDegreeSequence(ds); + if (!chain.initialize(g, true)) { + std::cerr << "Could not initialize Markov chain.\n"; + return 1; + } for (int i = 0; i < mixingTime; ++i) { auto now = std::chrono::high_resolution_clock::now(); std::chrono::duration dt = now - start; @@ -139,6 +139,26 @@ int main(int argc, char* argv[]) { outfile << ",{1000,{}}"; } + // Slow sort method + { + // record start time + auto start = std::chrono::high_resolution_clock::now(); + // Incorporate Havel-Hakimi time + g.createFromDegreeSequence(ds, true); + if (!chain.initialize(g, true)) { + std::cerr << "Could not initialize Markov chain.\n"; + return 1; + } + for (int i = 0; i < mixingTime; ++i) { + auto now = std::chrono::high_resolution_clock::now(); + std::chrono::duration dt = now - start; + triangleSeq[i] = + std::make_pair(dt.count(), chain.g.getTrackedTriangles()); + chain.doMove(true); + } + } + outfile << ',' << triangleSeq; + outfile << '}' << std::flush; std::cout << " Finished timed CCM time evols." << std::flush;