Given a graph G with m edges and ii nodes, a spanning tree T of G, and
an edge e that is being deleted from or inserted into G, we give effi
cient O(n) algorithms to compute a possible swap for e that minimizes
the diameter of the new spanning tree. This problem arises in high-spe
ed networks, particularly in optical networks.