Question: Problem Description Given a graph consisting of N vertices and M edges. There is a treasure on every vertex of the graph which has a

 Problem Description Given a graph consisting of N vertices and M

edges. There is a treasure on every vertex of the graph which

has a price of A[i] and weight of B[i]. For each vertex

v. 1. The price A[u] of the treasure at vertex u. 2.

Problem Description Given a graph consisting of N vertices and M edges. There is a treasure on every vertex of the graph which has a price of A[i] and weight of B[i]. For each vertex v. 1. The price A[u] of the treasure at vertex u. 2. The sum of weights of all the edges in the path from v to u. 3. The sum of weights of all the edges in the path from u to v. 4. An additional cost of XB[u] is also added, where X is the number of edges traversed on the path from u to v. Notes 1. The ith bidirectional edge goes from C[i][0] to C[i][1] and has a weight of C[i][2]. 2. The path to go from v to u and to comeback to v from u may or may not be same. 3. There might be multiple edges and self loops. Problem Constraints 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!