Due date: Tuesday, September 11, 2007, 11:59pm.
Task
The above map describes road connections between some cities in Germany and
in England. Implement a search algorithm that can find a route between any
two cities. In particular, your implementation should include the following
function:
(find_route origin destination)
that computes a route between origin and destination,
and prints out both the length of the route and the list of all cities that
lie on that route. For example,
(find_route Bremen Frankfurt)
should have the following output:
distance: 455 km
route:
Bremen to Dortmund, 234 km
Dortmund to Frankfurt, 221 km
and
(find_route London Frankfurt)
should have the following output:
distance: infinity
route:
none
Grading
The assignments will be graded out of 50 points for CSE 4308 and out of 60
points for CSE 5360. Students registered in CSE 4308 are welcome to solve the
CSE 5360 part of the assignment for extra credit.
- 40 points: Design function (find_route source destination) so
that it always finds a route between source and destination, as long as
such a route exists.
- 10 points: In addition to the above requirement, make sure that
(find_route source destination) terminates and reports that no
route can be found when indeed no route exists that connects source and
destination (e.g., if source is London and destination is
Berlin).
- (CSE 5360 only) 10 points: In addition to the above requirements, make
sure that the route found by (find_route source destination) is
optimal, meaning that no shorter route exists between source and
destination.
In other words, if your program always finds a solution when a solution
exists, you get 40 points. If your program handles correctly cases were no
solution exists you get an extra 10 points. For the CSE 5360 part, if your
program always finds the shortest route you get an extra 10 points.
No late submissions will be accepted, as solutions will be posted on the
Web shortly after the submission deadline.
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.
Submit a zipped directory (no other forms of compression accepted) via
e-mail to athitsos AT uta DOT edu, with subject "CSE 4308/5360, assignment
1". THE ATTACHMENT SHOULD NOT EXCEED 800KB in size. The directory should
contain source code (no compiled binaries), and a file called readme.txt,
which should specify precisely:
- Where the code runs (i.e., on gamma or on omega).
- What programming language is used.
- How to run the code (including compilation instructions, if compilation
is needed).
Insufficient or unclear instructions will be penalized by up to 20 points.
Code that does not run on at least one of the gamma and omega machines gets
zero points.
Some hints
- Start immediately. No extensions will be given.
- Here are
some functions from my solution, that you may find useful.
- How to Submit Homeworks using gzip and tar.
1. Log into omega or gamma.
2. Create a homework directory CSE4308HWNo. (replace the No. by the
homework number being submitted.)
3. Now use the following command to create a zip file.
1. tar -cvf CSE4308HWNo.tar CSE4308HWNo.
2. gzip CSE4308HWNo.tar.
-To list all the files in the archive CSE4308HWNo.tar you can use tar
-tvf CSE4308HWNo.tar.
-To list all the files in the gzip CSE4308HWNo.gz you can use gzip -l
CSE4308HWNo.tar.gz.
-To extract all the files in the archive CSE4308HWNo.tar you can use
tar -xvf CSE4308HWNo.tar.
-To dcompress CSE4308HWNo.tar.gz you can use gzip -d
CSE4308HWNo.tar.gz.