Neighborhood[g,v,k]
returns the subset of vertices in g that are at a distance of k or less from vertex v.
Neighborhood[al,v,k]
behaves identically, except that it takes as input an adjacency list al.
Neighborhood
Neighborhood[g,v,k]
returns the subset of vertices in g that are at a distance of k or less from vertex v.
Neighborhood[al,v,k]
behaves identically, except that it takes as input an adjacency list al.
Details and Options
- Neighborhood functionality is now available in the built-in Wolfram Language function NeighborhoodGraph.
- To use Neighborhood, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Examples
Basic Examples (2)
Needs["Combinatorica`"]g = FromUnorderedPairs[{{1, 2}, {2, 3}, {3, 4}, {3, 1}}];ShowGraph[g]Neighborhood[g, 1, 1]Neighborhood has been superseded by NeighborhoodGraph:
g = Graph[{12, 23, 34, 31}]VertexList[NeighborhoodGraph[g, 1, 1]]See Also
Tech Notes
Related Guides
-
▪
- Graph Algorithms ▪
- Graphs & Networks ▪
- Graph Visualization ▪
- Computation on Graphs ▪
- Graph Construction & Representation ▪
- Graphs and Matrices ▪
- Graph Properties & Measurements ▪
- Graph Operations and Modifications ▪
- Statistical Analysis ▪
- Social Network Analysis ▪
- Graph Properties ▪
- Mathematical Data Formats ▪
- Discrete Mathematics
Text
Wolfram Research (2012), Neighborhood, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/Neighborhood.html.
CMS
Wolfram Language. 2012. "Neighborhood." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/Neighborhood.html.
APA
Wolfram Language. (2012). Neighborhood. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/Combinatorica/ref/Neighborhood.html
BibTeX
@misc{reference.wolfram_2026_neighborhood, author="Wolfram Research", title="{Neighborhood}", year="2012", howpublished="\url{https://reference.wolfram.com/language/Combinatorica/ref/Neighborhood.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_neighborhood, organization={Wolfram Research}, title={Neighborhood}, year={2012}, url={https://reference.wolfram.com/language/Combinatorica/ref/Neighborhood.html}, note=[Accessed: 15-June-2026]}