我需要帮助,因为我不是编程方面的专家.
对于具有n个节点和E边缘的给定图形,如何绘制平面图形(如果图形可以在平面中绘制,使得没有边缘交叉,则称为平面图形).然后翻转边缘以获得另一个平面图.(循环直到我们获得所有可能性).
在此先感谢,我感谢您的帮助.
PY
>>>#visualize with pygraphviz
A=pgv.AGraph()
File "<stdin>", line 6
A=pgv.AGraph()
^
SyntaxError: invalid syntax
>>> A.add_edges_from(G.edges())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'A' is not defined
>>> A.layout(prog='dot')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'A' is not defined
>>> A.draw('planar.png')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'A' is not defined
Run Code Online (Sandbox Code Playgroud)