如果您从 R 中使用 igraph,请使用此选项
is_graphical {igraph} | R 文档 |
确定给定的顶点度(有向图的入度和出度)是否可以在图中实现。
is_graphical(
out.deg,
in.deg = NULL,
allowed.edge.types = c("simple", "loops", "multi", "all")
)
out.deg |
整数向量,无向图的度序列,或者有向图的出度序列。 |
in.deg |
|
allowed.edge.types |
图中允许的边类型。“simple”表示既不允许环也不允许多重边(即,图必须是简单的)。“loops”表示允许环边,但不允许多重边。“multi”表示允许多重边,但不允许环边。“all”表示允许环边和多重边。 |
可图性的经典概念假定简单图。当图中允许自环、多重边或两者时,此函数也可以执行检查。
一个逻辑标量。
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: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.
其他可图的度序列:is_degseq()
g <- sample_gnp(100, 2/100)
is_degseq(degree(g))
is_graphical(degree(g))