WOLFRAM NOTEBOOK

Mutation Path Length Counting (aspect ratio)

In[]:=
quickTable[mutationPaths_]:=Withlts=
,Column[KeyValueMap[Row[Join[{Style[Text[#1],Gray]," "},#2],Spacer[1/10],Alignment->{Center,Bottom}]&,KeySort@GroupBy[mutationPaths,Function[Length[#]-1]->Function[quickDepict[{2,2},#,lts[{BitAnd@@#,Last[#]}],Mesh->None,ImageSize->{Automatic,8Sqrt[1+lts[{BitAnd@@#,Last[#]}]]}]&[Last[#]]]]],Dividers->{False,Center},FrameStyle->LightGray]
In[]:=
mutationPathByAR[ar_]:=Module[{fitness,g1,paths},fitness=changeFitness[{2,2},$LifetimeData[2,2,"Symmetric"],Function[-Abs[Subtract[Apply[Divide,Dimensions[DeleteCases[#,{0...}]]],ar]]]];g1=EvolutionaryMultiwayGraph[fitness,GraphLayout->"LayeredDigraphEmbedding","Reduced"->False,"ForceAcyclic"->False,"DistanceFunction"->Function[BinaryMutationDistance[#1,#2]],AspectRatio->1];g1=Graph[DirectedEdge[#1,#2,Length[DeleteCases[Transpose[{IntegerDigits[#1[[1]],2,32][[SymDown[2,2]]],IntegerDigits[#2[[1]],2,32][[SymDown[2,2]]]}],{0,_}|{x_,x_}]]]&@@@EdgeList[g1]];g1=Graph[g1,EdgeWeight->Map[1+2Last[#]&,EdgeList[g1]],GraphLayout->"LayeredDigraphEmbedding",AspectRatio->1];g1=VertexOutComponentGraph[g1,{{0,65815}}];paths=FindShortestPath[g1,First[VertexList[g1]],#]&/@VertexList[g1];paths=Map[First,Split[Catenate[MutationPath[#]&/@Partition[#,2,1]]]]&/@Select[paths,Length[#]>1&];Prepend[paths,{{0,65815}}]]
In[]:=
quickTable[mutationPathByAR[.1]]
Out[]=
0
2
3
4
5
6
7
8
9
In[]:=
Table[Labeled[Framed[quickTable[mutationPathByAR[x]],FrameStyle->LightGray],Text@x],{x,.6,1.2,.1}]
Out[]=
0
2
3
4
5
6
7
8
9
0.6
,
0
2
3
4
5
6
7
8
9
0.7
,
0
4
5
6
7
8
9
10
11
12
14
17
18
19
20
21
0.8
,
0
4
5
6
7
8
9
10
11
12
14
0.9
,
0
7
8
9
1.
,
0
6
7
8
9
1.1
,
0
6
7
8
9
10
1.2
In[]:=
aspectRatioGraph[ar_]:=Module[{lts,fitness},lts=$LifetimeData[2,2,"Symmetric"];fitness=changeFitness[{2,2},lts,Function[-Abs[Subtract[(Divide@@Dimensions[DeleteCases[#,{0...}]]),ar]]]];EvolutionaryMultiwayGraph[fitness,GraphLayout->"LayeredDigraphEmbedding"]]
In[]:=
aspectRatioGraph[.9]
Out[]=

the extremal cases:

Build Up

Whole Graph

Aspect Ratio

Tree-ification of Graph

Embedding of Whole Graph

Annotations

Aspect Ratio

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.