Modify Graph Edge Weights
Park every unknown edge at a huge weight, then open them one at a time until the shortest distance lands exactly on the target.
Park every unknown edge at a huge weight, then open them one at a time until the shortest distance lands exactly on the target.