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
。
另请参阅
参考资料
[1]Graph6 规范 <http://users.cecs.anu.edu.au/~bdm/data/formats.html>
示例
>>> G = nx.from_graph6_bytes(b"A_") >>> sorted(G.edges()) [(0, 1)]