LCF_graph#

LCF_graph(n, shift_list, repeats, create_using=None)[源代码]#

返回以 LCF 记法指定的立方图。

LCF (Lederberg-Coxeter-Fruchte) 记法[R8553aaaa836a-1]_ 是一种压缩记法,用于生成各种高对称性的立方哈密顿图。例如,参见 dodecahedral_graphdesargues_graphheawood_graphpappus_graph

节点取自 range(n)。每个节点 n_i 与节点 n_i + shift % n 连接,其中 shift 通过循环遍历输入的 shift_list repeat 次给出。

参数
nint

起始图是具有节点 0, ..., n-1n 圈。如果 n < 1,则返回零图。

shift_listlist

n 的整数移位列表,[s1, s2, .., sk]

repeatsint

一个整数,指定 shift_list 中的移位在 n 圈中对每个当前节点连续应用以生成 n_currentn_current + shift mod n 之间边的次数。

返回
G

从指定 LCF 记法创建的图实例。

参考文献

示例

效用图 \(K_{3,3}\)

>>> G = nx.LCF_graph(6, [3, -3], 3)
>>> G.edges()
EdgeView([(0, 1), (0, 5), (0, 3), (1, 2), (1, 4), (2, 3), (2, 5), (3, 4), (4, 5)])

赫伍德图

>>> G = nx.LCF_graph(14, [5, -5], 7)
>>> nx.is_isomorphic(G, nx.heawood_graph())
True