Adjacency; The degree of a vertex
Two vertices u and v in an undirected graph G are called adjacent
(or neighbors) if {u,v} is an edge of G.
If e={u,v} (more precisely, f(e)={u,v}), the edge e is called incident
with u and v. The edge e is also said to connect u and v.
The vertices u and v are called endpoints of this edge.
The degree of a vertex in an undirected graph is the number of edges
incident with it, except that a loop at a vertex contributes twice to the
The degree of the vertex v is denoted by deg(v).