random_cograph#

random_cograph(n, seed=None)[source]#

返回一个包含 \(2 ^ n\) 个节点的随机余图。

余图(cograph)是指不包含四个顶点的路径的图。余图或 \(P_4\)-自由图可以通过不交并和补运算从单个顶点生成。

这个生成器从一个单个顶点开始,并对其自身执行不交并和完全连接操作。选择哪种操作是随机的。

参数:
nint

余图的阶数。

seedinteger, random_state, or None (default)

随机数生成状态的指示器。参见 随机性

返回值:
G一个不包含四个顶点路径的随机图。

另请参见

full_join
union

参考文献

[1]

D.G. Corneil, H. Lerchs, L.Stewart Burlingham, “Complement reducible graphs”, Discrete Applied Mathematics, Volume 3, Issue 3, 1981, Pages 163-174, ISSN 0166-218X.