|
SOLUTIONS
|
GRAPH UTILITIES PACKAGE SYMBOL
NeighborhoodSubgraph
![]()
gives a subgraph consisting of vertices that can be reached from vertex i within r hops.
![]()
gives a subgraph consisting of vertices that can be reached from vertex i.
DetailsDetails
- To use
, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
returns a subgraph consisting of vertices that can be reached from a given vertex within certain hops.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
| In[1]:= |
This defines a simple directed graph:
| In[2]:= |
| In[3]:= |
| In[4]:= |
| Out[4]= | ![]() |
This finds a subgraph from vertices that can be reached from vertex 2 within 3 hops:
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= | ![]() |
This finds a subgraph consisting of all vertices that can be reached from vertex 2:
| In[7]:= |
| Out[7]= |
| In[8]:= |
| Out[8]= | ![]() |
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »






