Think about the n−1 gaps between consecutive vertices:
1∣2, 2∣3, …, (n−1)∣n.
If the final graph is connected, then for every gap k, there must be at least one chosen edge with one endpoint at most k and the other endpoint greater than k. Otherwise, the vertices 1,…,k would be completely separated from the vertices k+1,…,n.
For operation i, we can choose ui from [li,ri], while the other endpoint is fixed as vi. Since li≤vi≤ri, this operation is able to cross gap k exactly when
li≤k<ri.
So the problem is closely related to covering all gaps 1,…,n−1 by distinct operations.