Changeset - 552662b431c8
[Not reviewed]
0 2 2
Tom Bannink - 8 years ago 2017-05-23 09:30:44
tom.bannink@cwi.nl
Add new datafiles of overnight simulation
2 files changed:
Changeset was too big and was cut off... Show full diff anyway
0 comments (0 inline, 0 general)
cpp/switchchain_exponent.cpp
Show inline comments
 
@@ -73,35 +73,35 @@ int main() {
 
    // 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.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f};
 

	
 
    Graph g;
 
    Graph g1;
 
    Graph g2;
 

	
 
    std::ofstream outfile("graphdata_exponent.m");
 
    outfile << '{';
 
    bool outputComma = false;
 

	
 
    for (int numVertices = 200; numVertices <= 2000; numVertices += 200) {
 
    for (int numVertices = 2200; numVertices <= 4000; numVertices += 200) {
 
        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 < 1000; ++degreeSample) {
 
            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(),
 
                                  [&degDist, &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()++;
 
                    }
 
@@ -116,25 +116,25 @@ int main() {
 
                    }
 
                }
 

	
 
                SwitchChain chain;
 
                if (!chain.initialize(g)) {
 
                    std::cerr << "Could not initialize Markov chain.\n";
 
                    return 1;
 
                }
 

	
 
                std::cout << "Running n = " << numVertices << ", tau = " << tau
 
                          << ". \t" << std::flush;
 

	
 
                int mixingTime = 8*(32.0f - 26.0f*(tau - 2.0f)) * numVertices; //40000;
 
                int mixingTime = 32*(32.0f - 26.0f*(tau - 2.0f)) * numVertices; //40000;
 
                constexpr int measurements = 50;
 
                constexpr int measureSkip =
 
                    200; // Take a sample every ... steps
 

	
 
                int movesDone = 0;
 

	
 
                long long trianglesTotal = 0;
 

	
 
                for (int i = 0; i < mixingTime; ++i) {
 
                    if (chain.doMove())
 
                        ++movesDone;
 
                }
data/README
Show inline comments
 
Contents of each file
 

	
 
graphdata_exponent_mixN.m
 
    output: {{n,tau},avgTriangles}
 
    n from 200 to 2000 with step 200
 
    degreeSamples = 500 + 1000 for mix1 and 1000 for mix4,mix8
 
    degreeSamples = (500 + 1000) for mix1 and 1000 for mix4,mix8, 2000 for mix16
 
    initial ErdosGallai
 
    mixingTime = N * (32.0f - 26.0f*(tau - 2.0f)) * n
 
    measurements = 50
 
    measureSkip = 200
 

	
 
graphdata_initialtris.m
 
    output: {{n,tau},avgTriangles,{gcm1TrisSum,gcm1TrisCount},{gcm1TrisSum,gcm1TrisCount}}
 
    simulation was stopped halfway through. Was halfway n=1000
 
    degreeSamples = 200
 
    avgTriangles was obtained from switchchain with EG start and
 
    mixingTime = (32.0f - 20.0f * (tau - 2.0f)) * numVertices;
 
    measurements = 20
 
    measureSkip = 200
 

	
 
graphdata_initialtris2.m
 
    same as above but simulation was stopped during (n,tau)=(1400,2.6)
 

	
 
graphdata_initialtris3.m
 
    same as above but simulation was not stopped. n from 200 to 2000
 

	
 
graphdata_gcm_partial.m
 
    ??
 
    output: {{n,tau},triangleseq,ds, {...??...} }
 

	
 
graphdata_partial.m
 
    output: {{n,tau},triangleseq,ds,greedyTriangles1,greedyTriangles2,greedySeq1,greedySeq2}
 
    degreeSamples = 200
 
    mixingTime = 0
 
    measurements = 50000
 
    measureSkip = 1

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)