New in Wolfram
Mathematica
8: Modelado de grafos y de redes
◄
previous
|
next
►
Áreas de aplicación
Estructura de la Web
Una red de páginas de un sitio de una empresa.
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]=