GATE CS 2021 Set 2 | Question 65

Algorithms › Graph Algorithms · NAT · 2 marks · Answer: 929

  1. Question 65Algorithmsnat2 marks
    In a directed acyclic graph with a source vertex , the quality-score of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex other than , the quality-score of is defined to be the maximum among the quality-scores of all the paths from to . The quality-score of is assumed to be 1. (See the figure for the weighted DAG.) The sum of the quality-scores of all the vertices in the graph shown is ______.
    GATE CS 2021 Set 2 Question 65 figure

    Answer: 929

    Solution

    Processing the vertices in topological order and taking, for each vertex, the maximum product of edge weights over all paths from , then summing these best scores across all vertices, gives 929.

More GATE PYQ on Graph Algorithms

All GATE CS Algorithms PYQ →

Attempt GATE CS 2021 Set 2 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →