diff --git a/cpp/switchchain.cpp b/cpp/switchchain.cpp index b14a8ecfd6c5fdbcea2373c39d7f623ca350ea99..9fccb10b01bc2834dd2111e27d01d2d80a505953 100644 --- a/cpp/switchchain.cpp +++ b/cpp/switchchain.cpp @@ -66,6 +66,8 @@ class SwitchChain { // // Assumes degree sequence does NOT contain any zeroes! // +// method2 = true -> take highest degree and finish its pairing completely +// method2 = false -> take new highest degree after every pairing bool greedyConfigurationModel(DegreeSequence& ds, Graph& g, auto& rng, bool method2) { // Similar to Havel-Hakimi but instead of pairing up with the highest ones // that remain, simply pair up with random ones @@ -189,7 +191,7 @@ int main() { outfile << '{'; bool outputComma = false; - for (int numVertices = 200; numVertices <= 1000; numVertices += 100) { + for (int numVertices = 200; numVertices <= 2000; numVertices += 400) { for (float tau : tauValues) { DegreeSequence ds(numVertices); @@ -232,11 +234,13 @@ int main() { int successrate2 = 0; for (int i = 0; i < 100; ++i) { Graph gtemp; + // Take new highest degree every time if (greedyConfigurationModel(ds, gtemp, rng, false)) { ++successrate1; greedyTriangles1.push_back(gtemp.countTriangles()); g1 = gtemp; } + // Finish all pairings of highest degree first if (greedyConfigurationModel(ds, gtemp, rng, true)) { ++successrate2; greedyTriangles2.push_back(gtemp.countTriangles()); @@ -269,7 +273,7 @@ int main() { //constexpr int measureSkip = // 200; // Take a sample every ... steps int mixingTime = 0; - constexpr int measurements = 5000; + constexpr int measurements = 50000; constexpr int measureSkip = 1;