diff --git a/triangle_analysis.m b/triangle_analysis.m index a2e2319b7f4f9b7f696ce84f1212bd4a7d75ec35..11db583ec5f2efcdd0999b4210afb90e48a2b940 100644 --- a/triangle_analysis.m +++ b/triangle_analysis.m @@ -71,7 +71,7 @@ Needs["ErrorBarPlots`"] (*Data import*) -gsraw=Import[NotebookDirectory[]<>"data/graphdata_partial.m"]; +gsraw=Import[NotebookDirectory[]<>"data/graphdata_temp2.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. *) *) @@ -146,19 +146,47 @@ Show[ListPlot[avgAndProp,AxesOrigin->{0,0},AxesLabel->{"degree-sequence-property (*Plot triangle count over "time" in Markov chain instances*) -numPlots=20; -selectedData=gdata[[4,-1]][[-numPlots;;-1]]; +numPlots=10; +selectedData=gdata[[1,-1]][[-numPlots;;-1]]; measureSkip=1; minCount=Min[Map[Min[#[[2]]]&,selectedData]]; maxCount=Max[Map[Max[#[[2]]]&,selectedData]]; maxTime=Max[Map[Length[#[[2]]]&,selectedData]]; -skipPts=Max[1,Round[maxTime/200]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) -coarseData=Map[#[[2,1;;-1;;skipPts]]&,selectedData]; +maxTime=30000; +skipPts=Max[1,Round[maxTime/400]]; (* Plotting every point is slow. Plot only once per `skipPts` timesteps *) +coarseData=Map[#[[2,1;;maxTime;;skipPts]]&,selectedData]; labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; -ListPlot[coarseData,Joined->True,PlotRange->{minCount,maxCount},DataRange->{0,measureSkip*maxTime},PlotLegends->labels] +ListPlot[coarseData,Joined->True,PlotRange->{0*minCount,maxCount},DataRange->{0,measureSkip*maxTime},PlotLegends->labels] (* Map[ListPlot[#,Joined->True,PlotRange\[Rule]{minCount,maxCount},DataRange\[Rule]{0,maxTime}]&,coarseData] *) +(* ::Subsection:: *) +(*Plot success rate over "time"*) + + +numPlots=10; +selectedData=gdata[[1,-1]][[-numPlots;;-1]]; +measureSkip=100; +maxTime=Max[Map[Length[#[[4]]]&,selectedData]]; +maxTime=10000; +coarseData=Map[#[[4,1;;maxTime/measureSkip]]&,selectedData]; +labels=Map["{n,tau} = "<>ToString[#[[1]]]&,selectedData]; +ListPlot[coarseData,Joined->True,PlotRange->{0,100},DataRange->{0,maxTime},PlotLegends->labels] +(* Map[ListPlot[#,Joined->True,PlotRange\[Rule]{minCount,maxCount},DataRange\[Rule]{0,maxTime}]&,coarseData] *) + + +(* ::Subsection:: *) +(*Correlation of avgsuccess rate vs other things*) + + +compare1=Map[{Mean[#[[4]]],Mean[#[[2]]]}&,gdata,{3}]; +(* { GCM1 rate, GCM2 rate, mixing time from ErdosGallai } *) + + +scatterPlots=Map[ListPlot[#,PlotRange->{{0,100},All},PlotStyle->PointSize[Large]]&,compare1,{2}]; +TableForm[scatterPlots,TableHeadings->{taulabels,nlabels}] + + (* ::Subsection:: *) (*Compute 'mixing time'*)