Use this if you are using igraph from R
Determine whether the given vertex degrees (in and outdegrees for directed graphs) can be realized in a simple graph, i.e. a graph without multiple or loop edges.
is_graphical(out.deg, in.deg = NULL)
out.deg 
Integer vector, the degree sequence for undirected graphs, or the outdegree sequence for directed graphs. 
in.deg 

A logical scalar.
Tamas Nepusz ntamas@gmail.com
Hakimi SL: On the realizability of a set of integers as degrees of the vertices of a simple graph. J SIAM Appl Math 10:496506, 1962.
PL Erdos, I Miklos and Z Toroczkai: A simple HavelHakimi type algorithm to realize graphical degree sequences of directed graphs. The Electronic Journal of Combinatorics 17(1):R66, 2010.
Other graphical degree sequences:
is_degseq()
g < sample_gnp(100, 2/100) is_degseq(degree(g)) is_graphical(degree(g))