You are given an undirected tree consisting of \(n\) vertices. An undirected tree is a connected undirected graph with \(n−1\) edges. Your task is to add the minimum number of edges in such a way that the length of the shortest path from the vertex 1…