from_graph6_bytes#

from_graph6_bytes(bytes_in)[源代码]#

从字节中读取graph6格式的简单无向图。

参数
bytes_in字节数

数据为GRAPH6格式,没有尾随换行符。

返回
G
加薪
NetworkXError

如果无法以graph6格式分析中的字节

ValueError

如果有任何字符 c 以字节为单位不满足 63 <= ord(c) < 127

工具书类

1

图6规格<http://users.cecs.anu.edu.au/~bdm/data/formats.html>

实例

>>> G = nx.from_graph6_bytes(b"A_")
>>> sorted(G.edges())
[(0, 1)]