Question: Please execute code in C++. Data format is as follows: You are given a graph written as a sequence of edges with associated distance (travel

 Please execute code in C++. Data format is as follows: Youare given a graph written as a sequence of edges with associateddistance (travel time), as well as a start and destination node withan associated maximum allowed travel time. All edges can be traveled both

Please execute code in C++. Data format is as follows:

ways. Determine the single shortest path between the start and destination, and

You are given a graph written as a sequence of edges with associated distance (travel time), as well as a start and destination node with an associated maximum allowed travel time. All edges can be traveled both ways. Determine the single shortest path between the start and destination, and print the route if the distance of the path is equal or less than the maximum allowed travel time. Input Format Input is read from standard input and has the following characteristics: It is two lines; the first line describes the edges of the graph o Each edge is formatted as an opening bracket '[', the first node of the pair, a comma, the second node in the pair, another comma, the distance between the nodes, followed by a closing bracket T. Example: '[A,B,5] First line: [A,B,3] [B,C,5] [C,D,2] the second line describes the start and destination node, as well as the maximum allowed travel time the starting node, followed by an ascii arrow '>(two characters), the destination node, a comma, and the maximum allowed travel time. Example 'A- >D,5' Second line: A->D,15 16 max distance: 15 You are given a graph written as a sequence of edges with associated distance (travel time), as well as a start and destination node with an associated maximum allowed travel time. All edges can be traveled both ways. Determine the single shortest path between the start and destination, and print the route if the distance of the path is equal or less than the maximum allowed travel time. Input Format Input is read from standard input and has the following characteristics: It is two lines; the first line describes the edges of the graph o Each edge is formatted as an opening bracket '[', the first node of the pair, a comma, the second node in the pair, another comma, the distance between the nodes, followed by a closing bracket T. Example: '[A,B,5] First line: [A,B,3] [B,C,5] [C,D,2] the second line describes the start and destination node, as well as the maximum allowed travel time the starting node, followed by an ascii arrow '>(two characters), the destination node, a comma, and the maximum allowed travel time. Example 'A- >D,5' Second line: A->D,15 16 max distance: 15

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!