WLJS LogoWLJS Notebook

NeighborhoodGraph

NeighborhoodGraph[g, v] gives the graph neighborhood of a vertex v in the graph g.

NeighborhoodGraph[g, v, d] gives the neighborhood up to distance d.

Examples

Neighborhood of a vertex:

NeighborhoodGraph[GridGraph[{5, 5}], 13]

Up to distance 2:

NeighborhoodGraph[GridGraph[{5, 5}], 13, 2]

Please visit the official Wolfram Language Reference for more details.

On this page