GATE Computer ScienceHardGATE CS (PYQ pattern)
A transformation is applied to a connected undirected graph with positive edge weights, and the result is compared with the original. Which statements are correct? I. Adding the same positive constant to every edge weight never changes the set of minimum spanning trees. II. Adding the same positive constant to every edge weight never changes the set of shortest paths between two vertices. III. Replacing every weight w by w² never changes the set of minimum spanning trees. IV. Replacing every weight w by w² never changes the set of shortest paths between two vertices.
- A. I and III only
- B. I, II and III only
- C. III and IV only
- D. I and IV only
Correct answer: A. I and III only
Every spanning tree has exactly n − 1 edges, so adding a constant shifts all tree weights equally (I), and any strictly increasing map keeps Kruskal's edge order (III). Shortest paths do not survive: paths with different numbers of edges are affected unequally by the shift (II) or by squaring (IV), as random testing against brute force confirms.
More Algorithms questions
- Which of the following statements about minimum spanning trees of a connected weighted undirected graph is/are correct? I. If all edge…
- A graph has V = 1000 vertices and E = 250000 edges. Two Dijkstra implementations are compared by counting basic steps (ignoring…
- What is the smallest m such that every simple undirected graph with 12 vertices and m edges is 2-connected (connected, and stays connected…
- Bellman–Ford is run from S on a directed graph with edges S→A 2, A→B 3, B→C −4, C→A 0, C→D 5, D→E 1, E→H 2, S→F 7, F→G −2, S→I 4, I→F 1…
- What is the smallest possible value of the largest edge weight on a path from E to D in the graph with edges AB 6, AC 1, AD 5, BC 5, BE 3…
- Kahn's topological sort uses a min-priority queue, so among available vertices the smallest label is always chosen. The DAG has edges 1→3…