mex Dijkstra's algorithm, simplify the LP