NeighborhoodVertices
NeighborhoodVertices[g,i,r]
gives vertices that can be reached from vertex i within r hops.
NeighborhoodVertices[g,i]
gives vertices that can be reached from vertex i.
Details and Options
- NeighborhoodVertices functionality is now available in the built-in Wolfram Language function NeighborhoodGraph.
- To use NeighborhoodVertices, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
- NeighborhoodVertices returns the vertices that can be reached from a given vertex within certain hops.
Examples
Basic Examples (2)
This defines a simple directed graph:
This finds all vertices that can be reached from vertex 2 within 1 hop:
This finds all vertices that can be reached from vertex 2:
NeighborhoodVertices has been superseded by NeighborhoodGraph:
Text
Wolfram Research (2007), NeighborhoodVertices, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodVertices.html.
CMS
Wolfram Language. 2007. "NeighborhoodVertices." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodVertices.html.
APA
Wolfram Language. (2007). NeighborhoodVertices. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodVertices.html