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:

In[1]:=
Click for copyable input
Out[1]=

Find all vertices adjacent to vertices that match a pattern:

In[1]:=
Click for copyable input
Out[1]=

Highlight adjacent vertices:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Scope  (6)

Applications  (1)

Properties & Relations  (2)

See Also

AdjacencyMatrix  VertexOutComponent  VertexInComponent  VertexComponent  IncidenceList  IncidenceMatrix  NeighborhoodGraph

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