Wolfram
Mathematica
8의 신기능: 그래프 및 네트워크 분석
◄
이전
|
다음
►
응용 분야
너비 우선 검색 수행
초 입방체의 너비 우선 검색을 살펴 봅니다.
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
»