Question: A+ Computer Science GRAPH - POTHOLES Lab Goal: This lab was designed to teach you more about graphs, mazes, and recursion. Lab Description: Unfortunately,

A+ Computer Science GRAPH - POTHOLES Lab Goal: This lab was designed

A+ Computer Science GRAPH - POTHOLES Lab Goal: This lab was designed to teach you more about graphs, mazes, and recursion. Lab Description: Unfortunately, your city has neglected to keep up the roads and they are riddled with potholes. You are worried about damage to your car and want to create an algorithm that will get you to your destination, while driving over as few potholes as possible. Notes: Each location in your city is denoted by a single letter Location A will be the starting location You will search for a path from A to DESTINATION Each edge will have an integer weight, in potholes. There will only be one solution that contains the fewest potholes Files Needed :: Create your own class. potholes.dat provided. Here is an example: 9 H A 3 4 0 D 3 F 10 11 I 3 E 3 4 2 G Input: The first line of input will be a single letter, denoting the DESTINATION Each additional line describes a road between two locations and the number of potholes on that road The format for each road is: Location A/LocationB - numberOfPotHoles Output: Display the path that has the fewest number of potholes going from A to DESTINATION, listing the locations in the order they are visited. A+ Computer Science - Graphs - www.apluscompsci.com

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Mazejava import javaio import javautil public class Maze private MazeLocation entry private MazeLocation exit private boolean map public MazeString filepath try File infile new Filefilepath Scanner in... View full answer

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 Programming Questions!