Changeset - 854fca81cf23
[Not reviewed]
0 2 1
Tom Bannink - 8 years ago 2017-06-02 11:49:50
tom.bannink@cwi.nl
Add data of simulation with higher mixing time
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
 
@@ -69,29 +69,29 @@ int main() {
 

	
 
    // 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.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");
 
    std::ofstream outfile("graphdata_exponent_hightau.m");
 
    outfile << '{';
 
    bool outputComma = false;
 

	
 
    for (int numVertices = 2200; numVertices <= 4000; numVertices += 200) {
 
    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
 
@@ -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 = 32*(32.0f - 26.0f*(tau - 2.0f)) * numVertices; //40000;
 
                int mixingTime = 32*(32.0f - 15.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 (2000-4000 for mix32)
 
    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_exponent_hightau.m
 
    same as above, but with higher mixing time for high tau values
 
    n from 1000 to 10000 with steps of 1000
 
    degreeSamples = 2000
 
    mixingTime = 32 * (32.0f - 15.0f*(tau - 2.0f)) * n //note the -15 instead of -26
 

	
 
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)
 

	

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

0 comments (0 inline, 0 general)