GATE 2021 CS (CS2) – Question 65
In the DAG shown with source s, a path’s quality is the product of its edge weights. A vertex’s quality is the maximum path quality from s; quality(s)=1. Find the sum of vertex qualities.

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 929 to 929
Explanation
Process vertices in topological order, propagating products and taking maxima. The qualities are s=1, a=9, b=9, c=1, d=9, e=81, f=9, g=81, t=729. For example d→e has weight nine, giving e=81; e→t has weight nine, giving t=729. Their sum is 1+9+9+1+9+81+9+81+729=929.
More Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions
- GATE 2026 CS (CS1) Q41
- GATE 2026 CS (CS1) Q49
- GATE 2026 CS (CS1) Q50
- GATE 2026 CS (CS2) Q37
- GATE 2025 CS (CS1) Q18
- GATE 2025 CS (CS1) Q43
All Graph Algorithms: Traversals, Minimum Spanning Trees, Shortest Paths questions →