main.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:PyGraphArt 作者: dnlcrl 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号