New in Wolfram
Mathematica
8: Graph & Network Analysis
◄
previous
|
next
►
Application Areas
Perform a Breadth-First Scan
Breadth-first traversal of a hypercube.
In[1]:=
X
Manipulate[ GraphicsRow[{HighlightGraph[g3, {1, stepedge3[[;; i]]}, GraphStyle -> "BasicBlue", GraphHighlightStyle -> "Thick"], HighlightGraph[tree3, {1, stepedge3[[;; i]]}, GraphStyle -> "BasicBlue", GraphHighlightStyle -> "Thick"]}, ImageSize -> 500], {{i, 0, "step"}, 0, 15, 1}, Initialization :> (g3 = PetersenGraph[8, 1]; {pred3, edges3} = Reap[BreadthFirstScan[g3, 1, {"FrontierEdge" -> Sow}]]; tree3 = TreeGraph[edges3[[1]]]; stepedge3 = edges3[[1]]) ]
Out[1]=
Play Animation
»
Stop Animation
»