예제 #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))