In short, given a weighted undirected graph with a starting point of 1, ask the minimum "distance" from 1 to all other points, where this "distance" refers to the path length minus the largest side plus the smallest side.
Both points and edges are in the 2e5 range.
Ideas
The point can be expanded and layered like dp, and a point x is divided into 4:, x[mx][mn]where mx represents whether an edge is deleted from 1 to this, and mn represents whether an edge is added from 1 to this (regardless of the maximum and minimum) . Then the connected side is still connected normally, just judge when the shortest run is behind.
Then in this new figure, the last thing x[1][1]is actually the "distance" that the title seeks because it just subtracts the maximum and adds the minimum, so the weight is the smallest.
Analyze the time complexity: Dijkstra's shortest path algorithm, using heap optimization, O(4*N lg(N)) probably.