New in Wolfram
Mathematica
8: Graph & Network Analysis
◄
previous
|
next
►
Application Areas
Subtract Random Neighborhoods
Mathematica
8 provides functions to compute subgraphs and neighborhood graphs.
In[1]:=
X
graph = GridGraph[{25, 50}];
In[2]:=
X
Subgraph[graph, Complement[VertexList[graph], VertexList[ NeighborhoodGraph[graph, RandomSample[VertexList[graph], 20], 1]]], ImageSize -> 500]
Out[2]=