示例#1
0
文件: p082.py 项目: nonette/euler
def p082(matrix=None):
    if not matrix:
        matrix = p081.readmatrix(filename)
    g = buildgraph(matrix)
    return g.shortestpath('source', 'sink')
示例#2
0
文件: p083.py 项目: nonette/euler
def p083(matrix=None):
    if not matrix:
        matrix = p081.readmatrix(filename)
    g = buildgraph(matrix)
    return g.shortestpath((0,0), (len(matrix)-1,len(matrix[0])-1))
示例#3
0
文件: p082.py 项目: nonette/euler
def p082(matrix=None):
    if not matrix:
        matrix = p081.readmatrix(filename)
    g = buildgraph(matrix)
    return g.shortestpath('source', 'sink')
示例#4
0
文件: p083.py 项目: nonette/euler
def p083(matrix=None):
    if not matrix:
        matrix = p081.readmatrix(filename)
    g = buildgraph(matrix)
    return g.shortestpath((0, 0), (len(matrix) - 1, len(matrix[0]) - 1))