在Python中创建无向图 [英] Creating undirected graphs in Python
问题描述
我需要创建一个使用Python分析旅行商问题的程序。有谁知道一个好的资源,可以帮助我学习如何在Python中创建和使用无向图?任何可能帮助我使用TSP的信息都将不胜感激。
关于针对有向图和无向图的Python库,您可以查看 igraph 或 NetworkX 。至于TSP,有一点使用Google表示可以使用一些Python代码和讨论 here ,并在这些幻灯片中给出了一些背景,旅游推销员问题简史,并在此页面上旅游推销员问题。
I need to create a program that analyzes the traveling salesman problem using Python. Does anyone know of a good resource that will help me learn how to create and use undirected graphs in Python? Any info that may help me with the TSP would be greatly appreciated as well.
About Python library for directed and undirected graphs, you can take a look at igraph or NetworkX.
As for the TSP, a little googling indicates that some Python code and discussion is available here, and some background is given in these slides, A Short History of the Traveling Salesman Problem, and on this page, Traveling Salesman Problem.
这篇关于在Python中创建无向图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!