In an undirected graph, the degree d(u) of a vertex u is the number of neighbors u has, or
equivalently, the number of edges incident upon it. In a directed graph, we distinguish between the
indegree din(u), which is the number of edges into u, and the outdegree dout(u), the number of
edges leaving u.