from_graph6_bytes#

from_graph6_bytes(bytes_in)[source]#

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

参数
bytes_inbytes

graph6格式的数据,末尾没有换行符。

返回
GGraph
引发
NetworkXError

如果 bytes_in 无法解析为 graph6 格式

ValueError

如果 bytes_in 中的任何字符 c 不满足 63 <= ord(c) < 127

另请参阅

read_graph6, write_graph6

参考资料

示例

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