Wolfram
Mathematica
8의 신기능: 그래프 및 네트워크 모델링
◄
이전
|
다음
►
응용 분야
웹 구조
기업 Web 사이트의 페이지 네트워크를 알아 봅니다.
In[1]:=
X
webcrawler[rooturl_, depth_] := Flatten[ Rest[NestList[ Union[Flatten[ Thread[# -> Import[#, "Hyperlinks"]] & /@ Last /@ #]] &, {"" -> rooturl}, depth]]];
In[2]:=
X
style = {VertexStyle -> White, VertexShapeFunction -> "Point", EdgeStyle -> Directive[Opacity[.5], Hue[.15, .5, .8]], Background -> Black, EdgeShapeFunction -> (Line[#1] &), ImageSize -> 500};
In[3]:=
X
Graph[webcrawler["http://www.wolfram.com", 2], style]
Out[3]=