OA. free
Free
IBM Data Structures & Algorithms Data Structures & Algorithms Medium

Which of the following statement in FALSE.

IBM technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Which of the following statement in FALSE.

Choose one option.
Show answer & explanation
Answer: B. Graph with distinct edge weights have more than one shortest path between two nodes

When all edge weights in a graph are distinct (no two edges have the same weight), there can be at most one shortest path between any two nodes. The false statement is B because distinct edge weights guarantee uniqueness of the shortest path. Statement A is true—graphs with non-distinct weights can have multiple shortest paths. Statement C is true—all spanning trees of a graph with n vertices have exactly n-1 edges.

Step-by-step Derivation:
Evaluate each statement:

A) TRUE: In a graph with equal-weight edges or multiple paths of the same total weight, multiple shortest paths can exist. Example: triangle with all edges weight 1 has two paths of length 2 between opposite nodes.

B) FALSE: This contradicts a fundamental property. If all edge weights are distinct, Dijkstra's algorithm and mathematical proof show the shortest path is unique. No two distinct paths can have equal total weight when all individual edges differ.

C) TRUE: Every spanning tree of a connected graph with V vertices contains exactly V-1 edges. This is a defining property of trees and applies universally regardless of edge weights.