def main():
'''
Create render and a graph, get some edge calling some graph
function and draw them, finally save the results in FILENAME
Bergamo = [.337125 ,.245148]
Roma = [.4936765,.4637286]
Napoli = [.5936468,.5253573]
'''
render = Render()
#coords = load_italy_coords()
g = Graph(
points=None, oriented=False, rand=True, n=300, max_neighbours=9)
edges = g.tsp(0)
render.draw_points(g.nodes)
render.draw_lines(g.coords_edges(g.edges))
render.sur.write_to_png(FILENAME)
import pdb
pdb.set_trace()
render.draw_lines(g.coords_edges(edges), color=True, filename='tsp/tsp')
#render.draw_lines(g.coords_edges(edges), color=True, filename='kruskal/kru')
render.sur.write_to_png(FILENAME)
评论列表
文章目录