GraphUtilities`
GraphUtilities`

NeighborhoodSubgraph

As of Version 10, all the functionality of the GraphUtilities package is built into the Wolfram System. »

NeighborhoodSubgraph[g,i,r]

gives a subgraph consisting of vertices that can be reached from vertex i within r hops.

NeighborhoodSubgraph[g,i]

gives a subgraph consisting of vertices that can be reached from vertex i.

Details and Options

  • NeighborhoodSubgraph functionality is now available in the built-in Wolfram Language function NeighborhoodGraph.
  • To use NeighborhoodSubgraph, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
  • NeighborhoodSubgraph returns a subgraph consisting of vertices that can be reached from a given vertex within certain hops.

Examples

Basic Examples  (2)

This defines a simple directed graph:

This finds a subgraph from vertices that can be reached from vertex 2 within 1 hop:

NeighborhoodSubgraph has been superseded by NeighborhoodGraph:

Wolfram Research (2007), NeighborhoodSubgraph, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html.

Text

Wolfram Research (2007), NeighborhoodSubgraph, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html.

CMS

Wolfram Language. 2007. "NeighborhoodSubgraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html.

APA

Wolfram Language. (2007). NeighborhoodSubgraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html

BibTeX

@misc{reference.wolfram_2024_neighborhoodsubgraph, author="Wolfram Research", title="{NeighborhoodSubgraph}", year="2007", howpublished="\url{https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_neighborhoodsubgraph, organization={Wolfram Research}, title={NeighborhoodSubgraph}, year={2007}, url={https://reference.wolfram.com/language/GraphUtilities/ref/NeighborhoodSubgraph.html}, note=[Accessed: 21-November-2024 ]}