Held: Thursday, January 22, 1998
1. List all the permutations (orderings) of the cities that are
not the starting city.
2. For each permutation,
2.a. Determine the cost of a trip based on that permutation
(starting at the starting city and going to each of the
cities in the permutation in order).
3. Pick the smallest of those costs.
1. Assume that the first element is the smallest.
2. Look at each of the other elements in the list.
2.a. If the current element is smaller than the one we thought was
smallest, assume that the current element is the smallest.
3. When you run out of elements, use the element you most recently
assumed was smallest.
All of today's exercises focus on defining or working with algorithms.
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Thu May 7 10:53:50 1998.
This page generated on Thu May 7 10:58:45 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu