Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_graphical

Is a degree sequence graphical?


Description

Determine whether the given vertex degrees (in- and out-degrees for directed graphs) can be realized in a simple graph, i.e. a graph without multiple or loop edges.

Usage

is_graphical(out.deg, in.deg = NULL)

Arguments

out.deg

Integer vector, the degree sequence for undirected graphs, or the out-degree sequence for directed graphs.

in.deg

NULL or an integer vector. For undirected graphs, it should be NULL. For directed graphs it specifies the in-degrees.

Value

A logical scalar.

Author(s)

Tamas Nepusz ntamas@gmail.com

References

Hakimi SL: On the realizability of a set of integers as degrees of the vertices of a simple graph. J SIAM Appl Math 10:496-506, 1962.

PL Erdos, I Miklos and Z Toroczkai: A simple Havel-Hakimi type algorithm to realize graphical degree sequences of directed graphs. The Electronic Journal of Combinatorics 17(1):R66, 2010.

See Also

Other graphical degree sequences: is_degseq()

Examples

g <- sample_gnp(100, 2/100)
is_degseq(degree(g))
is_graphical(degree(g))

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.