CS 540, Spring 2013: Assignment 1
Search and TSP
Locations due by Thursday 1/31 at noon MST
Distances due by Monday 2/4 at noon MST
Code and Questions Due Thursday 2/14/08 at noon MST
For this assignment, you are required to implement a search algorithm
to solve asymmetric TSPs. You have some latitude in your
selection of language and algorithm. For language, if you wish to
choose a language other than C, C++, Java or Lisp, you must obtain
instructor's permission. For algorithm, you should use one of the
algorithms (with tuning) described in class or in the text; if you
wish one other than that you need to obtain instructor's permission.
A New ATSP Dataset
The basics of the problem have been described already in class. You
will be using problems derived from the distance matrix for Fort Collins
locations which will be made available via RamCT in posting of
Assignment1 Part 2.
The current version has 60 locations in Fort Collins. Unfortunately,
60 locations is not particularly large. So everyone will be asked to
contribute to the data collection. An excel formatted spreadsheet (the
distance matrix mentioned above) will
be used. Each student will be asked to submit 2 locations in Colorado
(not necessarily Fort Collins) that are accessible by car and then
asked to add their driving distances to the spreadsheet. Locations are
designated by a name and an address. See top for
due dates for these parts.
Each location must be unique, so don't
repeat locations already HERE. Also, to encourage
uniqueness, we will add locations to below as we receive
them from students. The "due date" is an end date; locations can be
submitted at any time prior to that.
Student submitted locations:
- Donut Haus 342 Moraine Avenue, Estes Park, CO 80517
- ALAMOSA SAN LUIS VALLEY REGIONAL AIRPORT 2500 State Ave.,
Alamosa, CO 81101
- Dobson Ice Arena 321 E Lionshead Circle, Vail, Co 81657
- Fort Collins-Loveland Municipal Airport 4900 Earhart Rd,
Loveland, CO 80538
- Virginia Dale Community Church 284 West County Road 74e, Livermore, CO 80536
- Luther Park, Greeley, CO 80631
- Yuma County Court 310 Ash Street, Wray, CO 80758
- Routt County Clerk & Recorder Office, 522 Lincoln Avenue,
Steamboat Springs, CO 80477
- El Taco Loco - 644 S Main St, Brighton, CO
- Winter Park Resort - 85 Parsenn Road, Winter Park, CO 80482
- University Village 1700 W Plum St, Fort Collins, Colorado 80521
- Rocky Mountain National Park, 1000 US highway 36, Estes Park, Colorado 80517
- Mancos Public Library 211 West First Street, Mancos, CO 81328
- Parkview Elementary School 1105 Parkview Avenue, Lamar, CO 81052
- Photo Shop 1700 S College Ave Unit A, Fort Collins, CO
- Shanklin Camera Repair 1710 W Eisenhower Blvd Suite 3, Loveland CO
- Olive Garden Restaurant 3905 S College Ave, Fort Collins, CO
- Holiday Inn Express Hotel and Suites 1426 Oakridge Dr, Fort Collins, CO
- Cozzola's Pizza 241 Linden Street, Fort Collins, CO 80524
- Taj Mahal 148 W Oak St, Fort Collins, CO 80524
- Casa Bonita 6715 W. Colfax Ave., Lakewood, CO 80214
- APEX Movement 5757 Arapahoe Ave., Boulder, CO 80303
- Starbucks 558 Main Avenue, Durango, CO 81301
- Pier 1 Imports 3030 New Center Point, Colorado Springs, CO 80922
- Bombay Bazaar 3140 S Parker Rd, Aurora, CO 80014
- Taste of India 4820 Flintridge Dr, Colorado Springs, CO 80918
- UFO Watchtower, 201-249 Colorado 17, Center, CO 81125
- Cano's Castle E 10th Ave, Antonito, CO 81120
- Where The Buffalo Roam 535 16th Street, Denver, CO 80202
- Royal Gorge Bridge and Park 4218 County Road 3A, Canon City, CO
81215
- Nonesuch Theater 216 Pine Street, Fort Collins, CO 80524
- Windtracker Balloon Adventures LLC 315 S. Loomis Avenue, Fort
Collins, CO 80521
- Beaver Creek Ski Resort 40 Village Rd, Avon, CO 81620
- Telluride Ski Resort 565 Mountain Village Boulevard, Telluride,
CO 81435
- Bent's Old Fort 35110 Colorado 194, La Junta, CO
- Penrose Public Library, 20 North Cascade Avenue, Colorado Springs, CO 80903
- The Rabbit Hole, 101 N Tejon St Colorado Springs CO 80903
- Starbucks in Trinidad, 457 W Main St Trinidad CO 81082
- Happy Lucky's Teahouse, 236 Walnut St, Fort Collins
- Blackthorn Magic, 750 Citadel Dr E, Colorado Springs
- World Arena, 3185 Venetucci Boulevard, Colorado Springs, CO 80906
- Colorado Springs Fine Arts Center, 30 West Dale Street, Colorado Springs, Colorado 80903
- Centennial High School - Address: 330 E Laurel St, Fort Collins, Colorado
- Poudre High School - Address: 201 S Impala Dr, Fort Collins, Colorado
- Panda Express, 4600 S Mason St,Fort Collins CO 80525
- Panda Express, Lory Student Center, Fort Collins, CO 80523
- Address #1: 621 S College Ave Fort Collins, CO 80524
- Address #2: 210 S College Ave Fort Collins, CO 80524
- The Home Depot 4450 N Freeway Rd. Pueblo, CO 81008
- South Park High School, 640 Hathaway Street, Fairplay, CO 80440
- Del Norte Elementary School 870 Oak Street, Del Norte, CO 81132
- Colorado State Capitol 200 East Colfax Avenue, Denver
- Pepsi Center 1000 Chopper Circle, Denver
- Parker Fieldhouse 18700 East Plaza Drive Parker, CO 80134
- Glenwood Hot Springs Pool: 401 N River St Glenwood Springs, CO 81601
- Ranch-Way Feed Mills, 546 Willow St, Fort Collins
- Mishawaka Amphitheatre, 13714 Poudre Canyon Highway, Bellvue
Once the set of locations is finalized, an updated spreadsheet will be
provided via RamCT with the new locations. You will need to add distances for
the new locations to the spreadsheet. We recommend using your favorite route
calculator (google maps, mapquest...) to determine driving distance.
ATSP Code
The format for problems will be similar to that found in
the TSPLIB, but not exactly the same. An example looks like:
NAME: br17
DIMENSION: 17
EDGE_WEIGHT_SECTION
9999 3 5 48 48 8 8 5 5 3 3 0 3 5 8 8 5
3 9999 3 48 48 8 8 5 5 0 0 3 0 3 8 8 5
5 3 9999 72 72 48 48 24 24 3 3 5 3 0 48 48 24
48 48 74 9999 0 6 6 12 12 48 48 48 48 74 6 6 12
48 48 74 0 9999 6 6 12 12 48 48 48 48 74 6 6 12
8 8 50 6 6 9999 0 8 8 8 8 8 8 50 0 0 8
8 8 50 6 6 0 9999 8 8 8 8 8 8 50 0 0 8
5 5 26 12 12 8 8 9999 0 5 5 5 5 26 8 8 0
5 5 26 12 12 8 8 0 9999 5 5 5 5 26 8 8 0
3 0 3 48 48 8 8 5 5 9999 0 3 0 3 8 8 5
3 0 3 48 48 8 8 5 5 0 9999 3 0 3 8 8 5
0 3 5 48 48 8 8 5 5 3 3 9999 3 5 8 8 5
3 0 3 48 48 8 8 5 5 0 0 3 9999 3 8 8 5
5 3 0 72 72 48 48 24 24 3 3 5 3 9999 48 48 24
8 8 50 6 6 0 0 8 8 8 8 8 8 50 9999 0 8
8 8 50 6 6 0 0 8 8 8 8 8 8 50 0 9999 8
5 5 26 12 12 8 8 0 0 5 5 5 5 26 8 8 9999
EOF
The first name gives the name of the problem. The second is the number of "cities" (or in the case of Fort Collins, locations). The next line "EDGE_WEIGHT_SECTION" flags the start of the matrix of costs. By convention, locations are numbered from 1 to DIMENSION. So the second column in the first row indicates the distance between location 1 and 2.
A solution should be represented as shown below. The first line
indicates the total cost for the tour (sum of distances including from the last location back to the first). Subsequent lines show the ordering for the locations. To make it simple, each location will be on its own line and the lines together (after the cost) should form a permutation. So the first location should not appear at the end. For example, a solution to the problem above would look like:
167
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
To make sure that everyone has implemented it properly, we will
be verifying your solutions as formatted above to check your cost and that it is a legal tour (all locations once and only once). So it is very important that you follow the format EXACTLY.
For testing your program, you should run the problem above and another
based on the original Fort Collins locations.
You should name your program atsp. Your program should take
as its first 2 arguments: input file and output file. File formats
MUST conform to above. You may add arguments after those if you have
parameters you wish to vary. Note that locations are numbered
starting from 1.
Make sure that your README file
describes what parameter settings should be used (if you have
parameters beyond the two mentioned above) as well as what
compiler and settings you use. Include a MAKEFILE if needed to run
your program. In other words, make this as easy as possible for the
instructor and GTA to run the code.
Search Algorithm
You should implement your choice of search algorithm from what we
covered in class. You must also select parameters for implementation,
e.g., ordering heuristics, neighborhood, initialization. In comments
in your code, you should name the algorithm and cite your source for it.
The last 10 points will be awarded based on how well your program did
on four test cases, which the GTA and instructor will select from our
Colorado locations dataset and from the benchmark problems available
at TSPLIB (formatted to match my requirements). We will not tell you
in advance what tests we will be running. Each evaluation trial
will be allotted up to 10 minutes of CPU time. These points will be
awarded as a direct function of rank based on minimizing the tour
costs. Ranks for each will be combined for a final ranking. Your
program will be run on one of the machines in the first floor LINUX
lab (120-unix-lab); make sure your code runs on those machines and
produces some output before the end of 10 minutes. You can find a list
of those machines by running the command "more ~info/machines | grep
120-unix-lab" on one of the department's machines. Your program will
be terminated at 10 minutes.
Part of your grade will depend on how well you followed directions and
how high quality was your implementation: how well it implements the
method chosen, how efficiently it has been written, how easy it is to
read and how creative/well justified were your design decisions.
Questions
Answers to the questions are worth 24 points.
- Why did you implement the search algorithm that you did? How did you
choose parameter settings for it? Cite any relevant literature or
pilot experiments that you did.
- Is your solution suited for both ATSP and TSP? Why or why
not?
What knowledge is the program using in constructing its solutions?
- How did the time limit impact your implementation?
- On what problems did you test your code? What differences did you
notice in your program's performance on the different problems?
Each answer is expected be 1/2-1 page in length.
What to hand in
You can submit everything electronically.
- Output from two runs, one for each of the two test problems, in ASCII.
- Written answers to your questions in ASCII, PDF or PS.
- A file (tarfile or zip) containing the source code. You should submit this via RamCT by the due date/time for the assignment.
- A README file describing exactly how to compile and run your code and how
to set the parameters, if you have any. The README should include a
line that can be cut-and-pasted into the instructor's script for
running as batch.
- And if appropriate, a makefile for compiling your code and/or a
script file for running it.
Note: Your code MUST accept input in exactly the format
specified. Your code MUST produce an output file whose name can
be specified (no hardcoding!) as an argument and be in exactly the
format specified in this document. An automated test script will be
used to run your code and validate your answers. If your format does
not match, you may lose all points for program correctness and
quality of results!
If you are concerned about your output format, you may send an output
file to the GTA UP TO 24 hours before the assignment is due to
be checked for format correctness.
Details
- To expedite grading, you must name your submission file
mylastname.{zip,tar,gzip}. When the files are extracted, the
object file to be called should be no more than one directory down
from the tar or zip file.
- Your question answers should:
- be at least a half page in length (without using ridiculous
spacing),
- have been proof-read and run through a spell checker,
- reflect some thought beyond what we have discussed in class,
- include details as necessary to understand your implementation
without looking at code,
- support your points with evidence wherever possible,
- use some standard bibliographic format for references.