我需要帮助,因为我不擅长编程。Python,networkx
如何绘制具有n个节点和E边的给定图的平面图(如果可以在平面中绘制图,那么不存在边交叉)。然后翻转边缘以得到另一个平面图形(for循环,直到我们获得所有可能性)。
在此先感谢,我感谢您的帮助。
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
欢迎StackOverflow上的平面子图L(一networkx图形对象)。这是一个问答网站。请查看常见问题解答:http://stackoverflow.com/faq – NPE 2012-02-07 09:07:13
您是否需要绘制一个平面图形,该图形“视觉上”看起来是平面的? – 2012-02-07 11:00:53
相关问题:[有没有平面度测试的在线算法?](http://stackoverflow.com/questions/1605002/are-there-any-online-algorithms-for-planarity-testing) – 2012-02-07 14:29:46