AdjacencyList

AdjacencyList[g,v]

gives a list of vertices adjacent to vertex v.

AdjacencyList[g,patt]

gives a list of vertices adjacent to vertices that match the pattern patt.

AdjacencyList[g,patt,d]

gives a list of vertices that are at distance at most d.

AdjacencyList[{vw,},]

uses rules vw to specify the graph g.

Details

Examples

open allclose all

Basic Examples  (3)

A list of vertices adjacent to the vertex 1:

Find all vertices adjacent to vertices that match a pattern:

Highlight adjacent vertices:

Scope  (6)

AdjacencyList works with undirected graphs:

Directed graphs:

Use rules to specify the graph:

Use patterns to select a subset of vertices:

Find vertices at a distance 2 from vertex 1:

AdjacencyList works with large graphs:

Applications  (1)

A family network consisting of the closest relatives, including parents, siblings, and children:

Immediate family members of Nancy:

Highlight:

Properties & Relations  (2)

AdjacencyList can be found using NeighborhoodGraph:

AdjacencyList can be found using IncidenceList:

Introduced in 2012
 (9.0)
 |
Updated in 2015
 (10.3)
2018
 (11.3)