dynamic programming - minimum path from top left to bottom right cell, where we can traverse in north, south, east, west directions -
how find minimum path top left bottom right cell in 2d-matrix costs can traverse in north, south, east, west directions.
if cost values constrained nonnegative, problem can solved dijkstra's shortest path algorithm. otherwise, problem not well-defined since cycles of negative length occur. more specific, weight edge cell a
b
set weight of a
; weight of terminal cell in bottom right corner included in every path.
Comments
Post a Comment