diff --git a/triangle_gcm_initial_analysis.m b/triangle_gcm_initial_analysis.m index de9515c50247576c6ff3609c7741db1295a718e6..0fc898477bbfe8bdda80c1f049b143089224cba6 100644 --- a/triangle_gcm_initial_analysis.m +++ b/triangle_gcm_initial_analysis.m @@ -24,6 +24,24 @@ nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]]; taulabels=Map["\[Tau] = "<>ToString[#]&,gdata[[All,1,1,1,2]]]; +(* ::Subsection:: *) +(*New data format import*) + + +gsraw=Import[NotebookDirectory[]<>"data/graphdata_ccm_constructionrate.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. *) *) + + +gdata2=GatherBy[gsraw,{#[[1,2]]&,#[[1,1]]&}]; +(* Data format: *) +(* gdata[[ tau index, n index, run index , datatype index ]] *) +(* datatype index: +1: {n,tau} +3: CCMdu construction rate <-- CCMdu: get new highest degree vertex every time +4: CCMd construction rate <-- CCMd: finish vertex completely +*) + + (* ::Section:: *) (*Greedy configuration model*) @@ -125,29 +143,56 @@ Export[NotebookDirectory[]<>"plots/ccm_construction_successrate9.pdf",plot3] successrates=Map[#[[3,2]]/100&,gdata,{3}]; +successrates[[1,1]]=gdata2[[1,1,All,2]]; (* New datafile test *) +successrates=Map[Clip[#,{0,0.99999}]&,successrates,{3}]; legends=Map["\[Tau] = "<>ToString[#[[1,1,2]]]<>" ; avg = "<>ToString[NumberForm[N[Mean[#[[All,3,2]]/100]],3]]&,gdata,{2}]; datasets={successrates[[1,1]], successrates[[5,1]], successrates[[9,1]]}; selectedLegends={legends[[1,1]],legends[[5,1]],legends[[9,1]]}; -SmoothHistogram[datasets,{0.06,"Gaussian"},"PDF", +plot1=Histogram[datasets,{-0.025,1.025,0.05},"Probability", +PlotRange->{{0,1},{0,1}}, +ChartStyle->Directive[FaceForm[Opacity[0.8]],EdgeForm[Thickness[0.001]]], +ImageSize->300,AxesOrigin->{0,0}, +Frame->True, +FrameLabel->{"successrate of CCMdu construction\n(distribution over sampled degree sequences)","Probability"}, +ChartLegends->Placed[selectedLegends,Center], +PlotLabel->"n = 1000"] + +histogramlist = Map[Last[HistogramList[#,{-0.05,1.05,0.1},"Probability"]]&,datasets]; +histogramlist = Transpose[histogramlist]; +(* labels=ConstantArray["",Ceiling[1/0.05]]; +labels[[2;;-1;;2]]=Map[ToString,Range[0.1,1,0.1]]; *) +labels=Map[ToString,Range[0,1,0.1]]; +plot2=BarChart[histogramlist, +PlotRange->{All,{0,1}}, +BarSpacing->{None,Medium}, +ChartLabels->{labels,None}, +ImageSize->300,AxesOrigin->{0,0}, +Frame->True, +FrameLabel->{"successrate of CCMdu construction\n(distribution over sampled degree sequences)","Probability"}, +ChartLegends->Placed[selectedLegends,Center], +PlotLabel->"n = 1000"] + +plot3=SmoothHistogram[datasets,{0.01,"Gaussian"},"PDF", PlotRange->{{0,1},All}, -(*ChartStyle\[Rule]Directive[FaceForm[Opacity[0.5]],EdgeForm[Thickness[0.007]]],*) ImageSize->300,AxesOrigin->{0,0}, Frame->True, -FrameLabel->{"successrate of CCMdu construction\n over sampled degree sequences","PDF"}, +FrameLabel->{"successrate of CCMdu construction\n(distribution over sampled degree sequences)","PDF"}, PlotLegends->Placed[selectedLegends,Center], PlotLabel->"n = 1000"] +(* Table[ -SmoothHistogram[datasets,{0.06,weightKernel},"PDF", +SmoothHistogram[datasets,{0.01,weightKernel},"PDF", PlotRange->{{0,1},All}, (*ChartStyle\[Rule]Directive[FaceForm[Opacity[0.5]],EdgeForm[Thickness[0.007]]],*) ImageSize->300,AxesOrigin->{0,0}, Frame->True, -FrameLabel->{"successrate of CCMdu construction\n over sampled degree sequences","PDF"}, +FrameLabel->{"successrate of CCMdu construction\n over sampled degree sequences","CDF"}, PlotLegends->Placed[selectedLegends,Center], PlotLabel->"n = 1000"],{weightKernel,{"Biweight","Gaussian","Rectangular","Cosine","SemiCircle"}}] +*) - +Export[NotebookDirectory[]<>"plots/ccm_construction_successrates.pdf",plot2]