diff --git a/showgraphs.m b/showgraphs.m index b01c4b7166b42164e71b3c552af6615d6661a216..a52dc3261b70c56b473c86cee643c36bc29b3739 100644 --- a/showgraphs.m +++ b/showgraphs.m @@ -14,6 +14,8 @@ Needs["ErrorBarPlots`"] (* (b) How often does this procedure work/fail. Might still be faster to do switchings from Erdos-Gallai.*) (* (c) Compare two greedy ways: (c1) first take highest and finish all its pairings (c2) take new highest after every single pairing*) (* (d) Time evolution for GCM on top of Erdos-Gallai time evolution.*) +(* The initial #triangles in GCM2 is somewhere between 0 and 5 standard deviations below the average #triangles, whereas the #triangles in Erdos-Gallai can be as high as 100 standard deviations above the average.*) +(* TODO: Not only compare number of standard deviations but also percentage above/below average.*) (**) (*- Count #moves that result in +-k triangles (one move could create many triangles at once!)*) (**) @@ -37,13 +39,20 @@ Needs["ErrorBarPlots`"] (*- Compute Sum over i ~2.3 the success rate of GCM2 seems to be higher than 80% for most sequences.*) +(*For tau < ~2.3 the success rate of GCM2 can drop to less than 10% for some sequences but for many sequences it is still larger than 80%.*) +(**) +(**) (* *) @@ -65,11 +74,7 @@ Grid[Partition[gs,10],Frame->All] (* ::Section:: *) -(*Plot triangle counts*) - - -(* ::Subsection:: *) -(*Data import and data merge*) +(*Data import*) gsraw=Import[NotebookDirectory[]<>"data/graphdata_partial.m"]; @@ -82,11 +87,19 @@ nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]]; taulabels=Map["tau = "<>ToString[#]&,gdata[[All,1,1,1,2]]]; +(* ::Subsection:: *) +(*Merge data*) + + newData=Import[NotebookDirectory[]<>"data/graphdata_3.m"]; mergedData=Import[NotebookDirectory[]<>"data/graphdata_merged.m"]; Export[NotebookDirectory[]<>"data/graphdata_merged_new.m",Join[mergedData,newData]] +(* ::Section:: *) +(*Plot triangle counts*) + + (* ::Subsection:: *) (*Plot empirical distribution of maximum degree*) @@ -241,7 +254,7 @@ getStats[run_]:=Module[{avg,stddev}, stats=Map[getStats,gdata,{3}]; -histograms=Map[Histogram[#[[1,3]],PlotRange->{{-8,8},Automatic},PlotLabel->"ErdosGallai deviation: "<>ToString[#[[1,2]]]]&,stats,{2}]; +histograms=Map[Histogram[#[[1,3]],PlotRange->{{-5,5},Automatic},PlotLabel->"ErdosGallai deviation: "<>ToString[#[[1,2]]]]&,stats,{2}]; TableForm[histograms,TableHeadings->{taulabels,nlabels}] @@ -252,8 +265,16 @@ TableForm[histograms,TableHeadings->{taulabels,nlabels}] (* gdata[[ tau index, n index, run index , {ntau, #tris, ds, greedyTriangles} ]] *) -successrates=Map[Length[#[[4]]]&,gdata,{3}]; +successrates=Map[{Length[#[[4]]],Length[#[[5]]]}&,gdata,{3}]; +successrates=Map[Transpose,successrates,{2}]; +successratesDelta=Map[Length[#[[5]]]-Length[#[[4]]]&,gdata,{3}]; rateHistograms=Map[Histogram[#,{10},PlotRange->{{0,100},Automatic}]&,successrates,{2}]; TableForm[rateHistograms,TableHeadings->{taulabels,nlabels}] + +rateHistograms=Map[Histogram[#,{10},PlotRange->{{-100,100},Automatic}]&,successratesDelta,{2}]; +TableForm[rateHistograms,TableHeadings->{taulabels,nlabels}] (*TableForm[Transpose[rateHistograms],TableHeadings->{nlabels,taulabels}]*) + + +