You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add to ALGraph.java an implementation of depthFirstSearch and bestSearch. Use the Dijkstra algorithm as the implementation for bestSearch.
Step 2:
Add to the graph in TestGraph an edge from Detroit to Pittsburgh with a distance of 400.
Modify the TestGraph to print the path results from breadthFirstSearch, depthFirstSearch, and bestSearch for paths from Philadelphia to Detroit and Fort Wayne to Toledo.
Step 3:
Create a new test program, TestGraph2, using the same graph of step 3, only use a Road object for edges. The Road object must have a distance and a speed limit attributes. Use the same distances, only use 80 as the speed on the path from Pittsburgh, Cleveland, Columbus, Indianapolis, Fort Wayne, to Chicago, and 25 for all other edges. Then find and print the breadthFirstSearch, depthFirstSearch, bestSearch using distance, and bestSearch using time for the path from Philadelphia to Chicago.
Step 4:
Create a new test program, TestGraph3 for the directed graph in Figure 10.26 (shown below). Then find and print the breadthFirstSearch, depthFirstSearch, bestSearch for paths from 0 to 4 and from 1 to 0.