Tag Info

New answers tagged

3

not quite what you asked for, but possibly useful: relationships = {1 <-> 2, 2 <-> 3, 2 <-> 4, 3 <-> 5, 2 <-> 6, 6 <-> 7, 4 <-> 8, 4 <-> 9}; numNodes = Max[relationships[[All, 2]]]; sizes = RandomReal[{0.25, 1}, numNodes]; xCoords = {0, 1, 2, 2, 3, 3, 4, 5, 5}; vars0 = Array[a, 9]; Manipulate[ vars = ...


3

Just for fun to do recursively in contrast to in-built binary graphs, e[n_] := {n <-> 2 n, n <-> 2 n + 1}; gf[grp_, n_, opts : OptionsPattern[]] := Module[{vl, ne, ng}, vl = Sort@VertexList[grp]; ne = Flatten[e /@ vl[[-n ;;]]]; ng = EdgeAdd[VertexAdd[grp, ne[[All, 2]]], ne]; Graph[VertexList[ng], EdgeList[ng], ...


1

If your are looking for a Binary tree than this may work for you: fnBTree[n_] := CompleteKaryTree[Sequence @@ # , VertexLabels -> "Name"] & /@ Join[{{1, 1}, {2, 1}}, Table[{i + 1, 2}, {i, n - 2}]] Call fnBTree with n=4 fnBTree[4]



Top 50 recent answers are included