CSE 4308/5360 - Assignments - Programming Assignment 1

Due dates:
Interim report: Monday, September 8, 2008, 11:59pm
Full assignment: Monday, September 15, 2008, 11:59pm.


Figure 1: A visual representation of the road system described in file input1.txt.

Task

Implement a search algorithm that can find a route between any two cities. Your program will be called find_route, and will take exactly three commandline arguments (or three function arguments, if implemented in LISP), as follows:

find_route input_filename origin_city destination_city

An example command line is:

find_route input1.txt Munich Berlin

Argument input_filename is the name of a text file such as such as input1.txt, that describes road connections between cities in some part of the world. For example, the road system described by file input1.txt can be visualized in Figure 1 shown above. You can assume that the input file is formatted in the same way as input1.txt: each line contains three items. The last line contains the items "END OF INPUT", and that is how the program can detect that it has reached the end of the file. The other lines of the file contain, in this order, a source city, a destination city, and the length in kilometers of the road connecting directly those two cities. Each city name will be a single word (for example, we will use New_York instead of New York), consisting of upper and lowercase letters and possibly underscores.

IMPORTANT NOTE: MULTIPLE INPUT FILES WILL BE USED TO GRADE THE ASSIGNMENT, FILE input1.txt IS JUST AN EXAMPLE. YOUR CODE SHOULD WORK WITH ANY INPUT FILE FORMATTED AS SPECIFIED ABOVE.

The program will compute a route between the origin city and the destination city, and will print out both the length of the route and the list of all cities that lie on that route. For example,

find_route input1.txt Bremen Frankfurt

should have the following:

distance: 455 km
route:
Bremen to Dortmund, 234 km
Dortmund to Frankfurt, 221 km

and

find_route input1.txt London Frankfurt

should have the following output:

distance: infinity
route:
none

For full credit, you should produce outputs identical in format to the above two examples.

Interim report

The interim report is an e-mail message you have to send by Monday, September 08, 11:59pm, containing the following: For purposes of grading, it is absolutely fine if your interim report simply states that you have done nothing so far (you still get the 10 points allocated for the interim report, AS LONG AS YOU SUBMIT THE E-MAIL MESSAGE). At the same time, starting early and identifying potential bottlenecks by the deadline for the interim report is probably a good strategy for doing well in this assignment.

Grading

The assignments will be graded out of 100 points.

Late submissions incur an initial penalty of 10 points, plus additional 10 points for each full 24 hours between the deadline and the submission.

How to submit

Implementations in LISP, C, C++, and Java will be accepted. If you would like to use another language, please first check with the instructor via e-mail. Points will be taken off for failure to comply with this requirement.

Submit a ZIPPED directory called assignment1.zip (no other forms of compression accepted, contact the instructor or TA if you do not know how to produce .zip files) via e-mail to BOTH THE INSTRUCTOR AND THE TA, with subject "CSE 4308 - Assignment 1", or "CSE 5360 - Assignment 1", depending on the course you are actually registered for. THE ATTACHMENT SHOULD NOT EXCEED 800KB in size (contact the instructor if for some reason you find it hard to comply with the 800KB limit). The directory should contain source code. Including binaries that work on omega (for Java and C++) is optional and encouraged. The submission should also contain a file called readme.txt, which should specify precisely:

Insufficient or unclear instructions will be penalized by up to 20 points. Code that does not run on omega machines gets AT MOST half credit (50 points).

Submission checklist

  • Is the code running on omega?
  • Is the implementations in LISP, C, C++, or Java? If not, have you obtained written consent from the instructor?
  • Is the attached zipped file called assignment1.zip?
  • Has the submission been e-mailed to both the instructor and the TA?
  • Was the attachment under 800KB?
  • Was the subject of the e-mail message "CSE 4308 - Assignment 1" or "CSE 5360 - Assignment 1", accordingly?