In graph theory, a regular graph is a graph where each vertex has the same number of neighbors; i.e. every vertex has the same degree or valency.
In the given que, no. of vertices= n
deg of each vertices= d (no. of neighbor of each vertices)
total edges= n*(no. of neighbor)/2= (n*d)/2