Neighbourhood of a vertex

The neighbourhood of a vertex in a graph is defined as its immediately connected neighbours:

Read: ”The neighbourhood of vertex is the set of all vertices , such that there is an edge from to in the set of edges or there is an edge from to in the set of edges .” (for undirected graphs, )
Sometimes this is denoted as .
The number of verticies in the neighbourhood is called the degree.

When itself is not part of the neighbourhod, we call it the open neighbourhood (default). If it is, then we call it the closed neighbourhood, denoted by (as opposed to ).

adjacency matrix representation

For undirected graphs:

For directed graphs:
The out-neighborhood:

The in-neighbourhood: