0 0 votes In a directed acyclic graph (DAG) with a source vertex $s$, the quality-score of a directed path is defined to be the sum of the weights of the edges on the path. For any other vertex v , its quality-score is the maximum quality-score among all possible paths from $s$ to $v$. The qualityscore of $s$ is 0 . What is the sum of the quality-scores of all vertices on the graph? Algorithms goclasses algorithms goclasses-cs-dpp goclasses-cs-dpp-day-91 goclasses-algorithms-practice-questions numerical-answers + – GO Classes 506 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes Quality-score = maximum sum of edge-weights on any path from s to that vertex. Compute path sums: score(s) = 0 score(a) = s->a = 3 score(b) = s->b = 1 score(c) = max( s->a->c = 3+2 = 5, s->b->c = 1+5 = 6 ) = 6 score(d) = max( s->a->d = 3+6 = 9, s->a->c->d = 3+2+1 = 6, s->b->c->d = 1+5+1 = 7 ) = 9 Sum of quality-scores = 0 + 3 + 1 + 6 + 9 = 19 BooleanLattice answered Sep 27, 2025 BooleanLattice comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Answer: 19 quality score of vertices are: s=0; a=3; b=1; c=1+5; d=3+6; sum of all quality scores=0+3+1+6+9 sum of all quality scores=19 Rajkumar Chaudhary answered Dec 12, 2025 Rajkumar Chaudhary comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Quality score of s= 0(given) Quality score of a= 3 (from weight edges) Quality score of b= 1 Quality score of c= max(3+2, 1+5)=6 Quality score of d= max(3+6, 1+7)=9 so sum of all quality scores= 0+3+1+6+9=19 (ans) antisocial_2005 answered Sep 11 antisocial_2005 comment Share Follow 0 reply Please log in or register to add a comment.