New in Wolfram
Mathematica
8: Modelado de grafos y de redes
◄
previous
|
next
►
Áreas de aplicación
Empaque componentes desconectadas
Especifique cómo las componentes desconectadas de un grafo deben empacarse juntas.
In[1]:=
X
packing = {"ClosestPacking", "ClosestPackingCenter", "Layered", "LayeredLeft", "LayeredTop", "NestedGrid"};
In[2]:=
X
edges = Union[ Flatten[Table[ Table[j \[UndirectedEdge] FromDigits[Insert[IntegerDigits[j, 2], 1, i], 2], {i, Length[IntegerDigits[j, 2]] + 1}], {j, 1, 80}]]];
In[3]:=
X
Grid[Flatten[{Style[#, 11, FontFamily -> "Verdana"] & /@ #, Table[Graph[edges, GraphLayout -> {"PackingLayout" -> pm}, BaselinePosition -> Top], {pm, #}]} & /@ Partition[packing, {3}], 1], Frame -> {All, {True, False, True, False}}, FrameStyle -> LightGray, Spacings -> {.5, {{2, 1}}}]
Out[3]=