Look at the proof of Dijkstra's algorithm and see what happens when you make this change. Consider pathological cases, or trivial cases.
Consider also that if you remove the longest edge, you may also be removing the shortest path between two other nodes, which would throw the entire algorithm into disarray.
You need to use a function object representing sum of all edges so far. Also it would store longest edge so far and substract its value when sum is requested.
let me see if understand.
you've got a teletransporter that would make the distance between two points equal to 0 (if the points are connected), but you can only use it once.
solve `n' dijkstra, each one with a different teleport node