In a directed acyclic graph with a source vertex , the 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 .

The sum of the quality-scores of all vertices on the graph shown above is _______
View worked solution
Answer: 929 : 929
The quality-score of any vertex (other than the source ) is the maximum of the quality-scores of all paths from to . This can be computed dynamically using the relation:
With , we compute the quality-scores of the vertices in topological order:
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
- Vertex :
Summing the quality-scores of all vertices:
Free practice · Your answers on this page are not saved.
