New in Wolfram
Mathematica
8: Graph & Network Analysis
◄
previous
|
next
►
Application Areas
Visualize Hamiltonian Cycles
Find Hamiltonian cycles.
In[1]:=
X
Manipulate[ HighlightGraph[ g2, {Style[hcycle[[1, 1]], Red], PathGraph[hcycle[[1 ;; n]]]}, GraphHighlightStyle -> "Thick", ImageSize -> {400, 300}], {n, 0, Length[hcycle], 1}, Initialization :> (g2 = PolyhedronData["Dodecahedron", "SkeletonGraph"]; hcycle = First[FindHamiltonianCycle[g2]]) ]
Out[1]=
Play Animation
»
Stop Animation
»