diff --git a/showgraphs.m b/showgraphs.m index 421c845e92f2a6508a652a9a92d23f9a2141a10e..593de9225e4d6c401516efe9871c65edc9e4a200 100644 --- a/showgraphs.m +++ b/showgraphs.m @@ -22,6 +22,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!)*) (**) @@ -43,13 +45,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%.*) +(**) +(**) (* *) @@ -71,11 +80,7 @@ Grid[Partition[gs,10],Frame->All] (* ::Section:: *) -(*Plot triangle counts*) - - -(* ::Subsection:: *) -(*Data import and data merge*) +(*Data import*) gsraw=Import[NotebookDirectory[]<>"data/graphdata.m"]; @@ -88,11 +93,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*) @@ -258,8 +271,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}]*) + + +