CS286 -- Lab 3: Delivering |
|
Objectives Addressed
PurposeThis lab assignment is designed to provide stimulate creative solutions to graph theory problem that is difficult to solve efficiently. Upon completion of the assignment, students should have a better understanding of how graphs may be represented and manipulated within a software system. OverviewOne reason for studying algorithms is to find efficient ways to solve problems. While asymptotic analysis allows us to evaluate an algorithm's efficiency, it ignores other important issues like implementation complexity and time constants. In this assignment, you should focus on developing an algorithm that will solve the pizza delivery problem as quickly as possible. AssignmentSuppose the following:
You have been asked to determine delivery time guarantee for three potential service areas. BurmaEvidently there is currently a strong demand for pizza delivery service in fourteen cities in Burma. The location of each city is specified in burma.txt. The file contains some information at the beginning which you may ignore. The data starts on the line that begins with a 1 and ends one line before the line with EOF. The data consists of latitude and longitude values (format: DDD.MM where DDD is the degrees and MM is the minutes) for each city. For example, the first city in the file is located at 16 degrees 47 minutes North and 96 degrees 10 minutes East. The distance between two cities may be calculated by approximating the Earth as an idealized sphere with a radius of 6378.388 kilometers. When performing the distance calculation, you should first convert the
latitude and longitude from degree-minutes to radians as follows: The distance between to cities, i and j, is calculated by: q1 = cos( longitude[i]-longitude[j] ) q2 = cos( latitude[i] - latitude[j] ) q3 = cos( latitude[i] + latitude[j] ) distance = 6378.388*arccos(((1+q1)*q2-(1-q1)*q3)/2)+1 US CapitolsThe theory goes that legislators typically eat a lot of pizza. In this scenario, you are to determine the minimum delivery time for the capitols of the 48 contiguous United States. The distances between the capitols may be determined from the capitols.txt file. The format of the file is similar to burma.txt
except the coordinates are no longer latitude and longitude. The distance
between cities may be calculated as: World CitiesThis is the most ambitious plan in which you would deliver pizza to 535 different cities around the globe. The location of each city is specified in world.txt which has the same format as burma.txt. DetailsFor each scenario, you may choose to set up shop in any one of the cities. Once you have chosen a city, you will need to determine how quickly you can travel to all of the cities in the service area (and back to base). Since your pizza isn't very good, you should not revisit a city until all pizzas have been delivered, otherwise you may get stuck listening to an unhappy customer. While this may be extremely interesting, it could really mess up your delivery schedule. Lab report (due 4:00pm, the last day of classes)This assignment is optional. If submitted, the best 3 out of 4 lab grades will be used in calculating your final grade for the quarter. You may do this assignment individually or with a partner of your choosing. The lab report need not be self-contained. Your report should include:
Your grade will be based on (in order of priority) 1) closeness to optimal solutions, 2) speed of algorithm, 3) description of algorithm, 4) time complexity analysis, 5) narrative report. Template Lab ReportAs with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. If you have any questions, consult the instructor. |
© 2001-2003 Dr. Christopher C. Taylor | Office: CC-27C | Phone: 277-7339 | Last Updated: Mon Apr 21 17:07:09 2003 |
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to. |