From c9c22e41130dd6f450a0ae965bb4dc82795802af 2017-06-11 13:29:41 From: Tom Bannink Date: 2017-06-11 13:29:41 Subject: [PATCH] Move degree sequence generation to separate file --- diff --git a/cpp/graph_powerlaw.hpp b/cpp/graph_powerlaw.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9d6981eaef64d669f6d06bdf6f604698a532eaa7 --- /dev/null +++ b/cpp/graph_powerlaw.hpp @@ -0,0 +1,35 @@ +#pragma once +#include "graph.hpp" +#include "powerlaw.hpp" +#include +#include + +template +void generatePowerlawGraph(int n, float tau, Graph& g, DegreeSequence& ds, + RNG& rng) { + ds.resize(n); + powerlaw_distribution degDist(tau, 1, n); + + // Generate a graph + // might require multiple tries + for (int i = 1;; ++i) { + std::generate(ds.begin(), ds.end(), + [°Dist, &rng] { return degDist(rng); }); + // First make the sum even + unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); + if (sum % 2) { + continue; + // Can we do this: ?? + ds.back()++; + } + + if (g.createFromDegreeSequence(ds)) + break; + + // When 10 tries have not worked, output a warning + if (i % 10 == 0) { + std::cerr << "Warning: could not create graph from " + "degree sequence. Trying again...\n"; + } + } +} diff --git a/cpp/switchchain.cpp b/cpp/switchchain.cpp index 36b2c464badc33cb3a262ab9d03504fe4be0f5ec..930fedebbcfacbe96e1f3c7406b4f1238297b37e 100644 --- a/cpp/switchchain.cpp +++ b/cpp/switchchain.cpp @@ -2,8 +2,8 @@ #include "exports.hpp" #include "graph.hpp" #include "graph_gcm.hpp" +#include "graph_powerlaw.hpp" #include "graph_spectrum.hpp" -#include "powerlaw.hpp" #include #include #include @@ -65,37 +65,11 @@ int main(int argc, char* argv[]) { for (int numVertices = 500; numVertices <= 500; numVertices += 1000) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 5; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); #if 0 // diff --git a/cpp/switchchain.hpp b/cpp/switchchain.hpp index d574263da0d03e66ee0161ec70794773b19ed8e8..34e511d1c602394689504f56908bb64795eec7a8 100644 --- a/cpp/switchchain.hpp +++ b/cpp/switchchain.hpp @@ -1,3 +1,4 @@ +#pragma once #include "graph.hpp" #include #include diff --git a/cpp/switchchain_dsp.cpp b/cpp/switchchain_dsp.cpp index e7b052a0827d70c0d93e8499e01c935d770d18ae..845a31981bada3d777c1fdcd7a74f7a478790fb5 100644 --- a/cpp/switchchain_dsp.cpp +++ b/cpp/switchchain_dsp.cpp @@ -1,6 +1,6 @@ #include "exports.hpp" #include "graph.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -9,7 +9,7 @@ #include #include -double getProperty(const DegreeSequence& ds) { +double getDSTN(const DegreeSequence& ds) { std::vector> vals(ds.size()); for (auto& v : vals) { v.resize(ds.size(), 0); @@ -38,56 +38,60 @@ double getProperty(const DegreeSequence& ds) { return result; } -int main() { - // Generate a random degree sequence - std::mt19937 rng(std::random_device{}()); - - // Goal: - // Degrees follow a power-law distribution with some parameter tau - // Expect: #tri = const * n^{ something } - // The goal is to find the 'something' by finding the number of triangles - // for different values of n and tau - float tauValues[] = {2.1f, 2.5f, 2.9f}; +int main(int argc, char* argv[]) { + // Simulation parameters + const int numVerticesMin = 100; + const int numVerticesMax = 1000; + const int numVerticesStep = 100; + + float tauValues[] = {2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f}; + + const int totalDegreeSamples = 2000; + + auto getMixingTime = [](int n, float tau) { + return int(30.0f * (50.0f - 30.0f * (tau - 2.0f)) * n); + }; + constexpr int measurements = 50; + constexpr int measureSkip = 200; // Take a sample every ... steps + + // Output file + std::ofstream outfile; + if (argc >= 2) + outfile.open(argv[1]); + else + outfile.open("graphdata_dsp.m"); + if (!outfile.is_open()) { + std::cout << "ERROR: Could not open output file.\n"; + return 1; + } - Graph g; + // Output Mathematica-style comment to indicate file contents + outfile << "(*\n"; + outfile << "n from " << numVerticesMin << " to " << numVerticesMax + << " step " << numVerticesStep << std::endl; + outfile << "tauValues: " << tauValues << std::endl; + outfile << "degreeSamples: " << totalDegreeSamples << std::endl; + outfile << "mixingTime: 30 * (50 - 30 (tau - 2)) n\n"; + outfile << "data:\n"; + outfile << "1: {n,tau}\n"; + outfile << "2: avgTriangles\n"; + outfile << "3: dstn\n"; + outfile << "*)" << std::endl; - std::ofstream outfile("graphdata_dsp.m"); outfile << '{'; bool outputComma = false; - for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) { + std::mt19937 rng(std::random_device{}()); + Graph g; + for (int numVertices = numVerticesMin; numVertices <= numVerticesMax; + numVertices += numVerticesStep) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results - for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + for (int degreeSample = 0; degreeSample < totalDegreeSamples; + ++degreeSample) { + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); SwitchChain chain; if (!chain.initialize(g)) { @@ -98,12 +102,8 @@ int main() { std::cout << "Running n = " << numVertices << ", tau = " << tau << ". \t" << std::flush; - int mixingTime = 32*(32.0f - 10.0f*(tau - 2.0f)) * numVertices; //40000; - constexpr int measurements = 50; - constexpr int measureSkip = - 200; // Take a sample every ... steps - int movesDone = 0; + int mixingTime = getMixingTime(numVertices,tau); long long trianglesTotal = 0; @@ -117,24 +117,25 @@ int main() { ++movesDone; trianglesTotal += chain.g.countTriangles(); } + float avgTriangles = + float(trianglesTotal) / float(measurements); - std::cout << movesDone << '/' << mixingTime + measurements * measureSkip + std::cout << movesDone << '/' + << mixingTime + measurements * measureSkip << " moves succeeded (" << 100.0f * float(movesDone) / float(mixingTime + measurements * measureSkip) << "%)."; std::cout << std::flush; - //std::cout << std::endl; if (outputComma) outfile << ',' << '\n'; outputComma = true; - float avgTriangles = - float(trianglesTotal) / float(measurements); outfile << '{' << '{' << numVertices << ',' << tau << '}'; outfile << ',' << avgTriangles; - outfile << ',' << getProperty(ds) << '}' << std::flush; + outfile << ',' << getDSTN(ds); + outfile << '}' << std::flush; std::cout << std::endl; } diff --git a/cpp/switchchain_exponent.cpp b/cpp/switchchain_exponent.cpp index 85d514b2ab9cbfc5f076c6c835e83996ddb9c59a..8b6b27afa50f9dfcd6b940307d0e2e4ef3982306 100644 --- a/cpp/switchchain_exponent.cpp +++ b/cpp/switchchain_exponent.cpp @@ -1,6 +1,6 @@ #include "exports.hpp" #include "graph.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -28,37 +28,11 @@ int main() { for (int numVertices = 1000; numVertices <= 10000; numVertices += 1000) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); SwitchChain chain; if (!chain.initialize(g)) { diff --git a/cpp/switchchain_initialtris.cpp b/cpp/switchchain_initialtris.cpp index 3acda57dd7e8e959c1c51deb9c4a02f6151e8dc0..158e26550a13b9db01e08a9cb6d917f7be2afed4 100644 --- a/cpp/switchchain_initialtris.cpp +++ b/cpp/switchchain_initialtris.cpp @@ -1,7 +1,7 @@ #include "exports.hpp" #include "graph.hpp" #include "graph_gcm.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -29,37 +29,11 @@ int main() { for (int numVertices = 200; numVertices <= 2000; numVertices += 400) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 200; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); std::cout << "Running n = " << numVertices << ", tau = " << tau << "." << std::flush; diff --git a/cpp/switchchain_mixingtime.cpp b/cpp/switchchain_mixingtime.cpp index ba0ed098adafa94f400394f3e4e97db3953e2a23..419df3207be6ef51f19ee9adf608bb4e9030e971 100644 --- a/cpp/switchchain_mixingtime.cpp +++ b/cpp/switchchain_mixingtime.cpp @@ -1,6 +1,6 @@ #include "exports.hpp" #include "graph.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -43,37 +43,12 @@ int main(int argc, char* argv[]) { for (int numVertices = 100; numVertices <= 1000; numVertices += 100) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 200; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } // Multiple runs from the same degree sequence for (int i = 0; i < 5; ++i) { diff --git a/cpp/switchchain_spectrum.cpp b/cpp/switchchain_spectrum.cpp index 5ccf1e5f81447b1789ee6e8c8fb717cbb325db12..e9d8603be10a778cd2facf9c113bf48b65a899dd 100644 --- a/cpp/switchchain_spectrum.cpp +++ b/cpp/switchchain_spectrum.cpp @@ -3,7 +3,7 @@ #include "graph.hpp" #include "graph_gcm.hpp" #include "graph_spectrum.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include #include #include @@ -42,37 +42,11 @@ int main(int argc, char* argv[]) { for (int numVertices = 500; numVertices <= 500; numVertices += 1000) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 5; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); SwitchChain chain; if (!chain.initialize(g)) { diff --git a/cpp/switchchain_successrates.cpp b/cpp/switchchain_successrates.cpp index 38df1c97466f53f30cfcfd77d6e32d51b769d325..44465ab360e2d02379af8f1fb9a5c4b6ed0f8c30 100644 --- a/cpp/switchchain_successrates.cpp +++ b/cpp/switchchain_successrates.cpp @@ -1,6 +1,6 @@ #include "exports.hpp" #include "graph.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -41,37 +41,11 @@ int main(int argc, char* argv[]) { for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); SwitchChain chain; if (!chain.initialize(g)) { diff --git a/cpp/switchchain_timeevol.cpp b/cpp/switchchain_timeevol.cpp index 374a466dbe551eda889568394fd95173969b6334..bcf9d426edff6847dc283c849762f52ee935a1a7 100644 --- a/cpp/switchchain_timeevol.cpp +++ b/cpp/switchchain_timeevol.cpp @@ -1,6 +1,6 @@ #include "exports.hpp" #include "graph.hpp" -#include "powerlaw.hpp" +#include "graph_powerlaw.hpp" #include "switchchain.hpp" #include #include @@ -41,37 +41,11 @@ int main(int argc, char* argv[]) { for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) { for (float tau : tauValues) { - - DegreeSequence ds(numVertices); - powerlaw_distribution degDist(tau, 1, numVertices); - //std::poisson_distribution<> degDist(12); - // For a single n,tau take samples over several instances of // the degree distribution. - // 500 samples seems to give reasonable results for (int degreeSample = 0; degreeSample < 5; ++degreeSample) { - // Generate a graph - // might require multiple tries - for (int i = 1; ; ++i) { - std::generate(ds.begin(), ds.end(), - [°Dist, &rng] { return degDist(rng); }); - // First make the sum even - unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0); - if (sum % 2) { - continue; - // Can we do this: ?? - ds.back()++; - } - - if (g.createFromDegreeSequence(ds)) - break; - - // When 10 tries have not worked, output a warning - if (i % 10 == 0) { - std::cerr << "Warning: could not create graph from " - "degree sequence. Trying again...\n"; - } - } + DegreeSequence ds; + generatePowerlawGraph(numVertices, tau, g, ds, rng); // Multiple runs from the same degree sequence for (int i = 0; i < 5; ++i) { diff --git a/triangle_etmt_plots.m b/triangle_etmt_plots.m index 2c341f6f6d0dd3c1968f34a290475808e17af321..2b0cfbcb1fa4a83fae478a78b5653fb1d06ac06d 100644 --- a/triangle_etmt_plots.m +++ b/triangle_etmt_plots.m @@ -3,7 +3,7 @@ Needs["ErrorBarPlots`"] -gsraw=Import[NotebookDirectory[]<>"data/graphdata_etmt_partial.m"]; +gsraw=Import[NotebookDirectory[]<>"data/graphdata_etmt.m"]; (* gsraw=SortBy[gsraw,{#[[1,1]]&,#[[1,2]]&}]; (* Sort by n and then by tau. The {} forces a *stable* sort because otherwise Mathematica sorts also on triangle count and other things. *) *) @@ -14,17 +14,34 @@ gdata=GatherBy[gsraw,{#[[1,2]]&,#[[1,1]]&}]; 1: {n,tau} 2: etmt *) +tauvalues=gdata[[All,1,1,1,2]]; nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]]; taulabels=Map["\[Tau] = "<>ToString[#]&,gdata[[All,1,1,1,2]]]; +etmtMean=Map[Mean[N[#[[All,2]]]]&,gdata,{2}]; +etmtSD=Map[StandardDeviation[N[#[[All,2]]]]&,gdata,{2}]; +etmtQuantile=Map[Quantile[#[[All,2]],99/100]&,gdata,{2}]; + + histograms=Map[Histogram[#[[All,2]]]&,gdata,{2}]; -histogramsWithLine=Map[Histogram[#[[All,2]],Epilog->Line[{{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],0},{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],500}}]]&,gdata,{2}]; +histogramsWithLines=MapIndexed[ +Histogram[#[[All,2]],PlotRange->All, +Epilog->Line[{ +{{etmtMean[[#2/.List->Sequence]],0}, +{etmtMean[[#2/.List->Sequence]],500}}, +{{etmtMean[[#2/.List->Sequence]]+etmtSD[[#2/.List->Sequence]],0}, +{etmtMean[[#2/.List->Sequence]]+etmtSD[[#2/.List->Sequence]],500}}, +{{etmtQuantile[[#2/.List->Sequence]],0}, +{etmtQuantile[[#2/.List->Sequence]],500}} +}] +] +&,gdata,{2}]; -TableForm[histograms,TableHeadings->{taulabels,nlabels}] +TableForm[histogramsWithLines,TableHeadings->{taulabels,nlabels}] gdataSwitched=Transpose[gdata]; @@ -39,17 +56,37 @@ Export[NotebookDirectory[]<>"plots/ETMTdistribution.pdf",combiHistograms[[9]]] mixingTimesBars=Map[{{#[[1,1,1]],Mean[#[[All,2]]]},ErrorBar[StandardDeviation[#[[All,2]]]]}&,gdata,{2}]; +mixingTimesQuantiles=Map[{#[[1,1,1]],Quantile[#[[All,2]],99/100]}&,gdata,{2}]; -ErrorListPlot[mixingTimesBars[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels] +plot1=ErrorListPlot[mixingTimesBars[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels]; +plot2=ListPlot[mixingTimesQuantiles[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels]; +Show[plot2,plot1] mixingTimesDivN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]])}&,mixingTimesBars,{2}]; mixingTimesDivNlogN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]]*Log[#[[1,1]]])}&,mixingTimesBars,{2}]; +etmtQuantileDivN=Map[{#[[1]],#[[2]]/(#[[1]])}&,mixingTimesQuantiles,{2}]; +etmtQuantileDivNlogN=Map[{#[[1]],#[[2]]/(#[[1]]*Log[#[[1]]])}&,mixingTimesQuantiles,{2}]; plotN=ListPlot[mixingTimesDivN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/n"},PlotLegends->taulabels,ImageSize->300] plotNlogN=ListPlot[mixingTimesDivNlogN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/(n log n)"},PlotLegends->taulabels,ImageSize->300] +plotQuantileN=ListPlot[etmtQuantileDivN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","q(ETMT,99%)/n"},PlotLegends->taulabels,ImageSize->300] +plotQuantileNlogN=ListPlot[etmtQuantileDivNlogN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","q(ETMT,99%)/(n log n)"},PlotLegends->taulabels,ImageSize->300] Export[NotebookDirectory[]<>"plots/ETMTdivN.pdf",plotN] + + +etmtQuantileDivNmax=Map[Max[#[[All,2]]]&,etmtQuantileDivN]; +etmtQuantileDivNmax=Transpose[{tauvalues,etmtQuantileDivNmax}]; + +mixingTimesDivNmax=Map[Max[#[[All,2]]]&,mixingTimesDivN]; +mixingTimesDivNmax=Transpose[{tauvalues,mixingTimesDivNmax}]; + + +Show[ +Plot[{(50-30(tau-2)),32-26(tau-2)},{tau,2,3},AxesOrigin->{2,0}], +ListPlot[{etmtQuantileDivNmax,mixingTimesDivNmax},Joined->True,PlotMarkers->Automatic,PlotRange->{{2,3},All}] +]