October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function is a helper function for a brute force method of finding the shortest path between a set of five points. If the five points are numbered 0 through 4, a route is a unique ordering of the numbers 0 through 4. There are 120 such orderings (5 * 4 * 3 * 2 * 1), including ones that are the reverse of others. Each of the five positions in a route is called a slot, and the number in a given slot is called a stop.
The routes are numbered 0 through 119 and a lower-numbered route always has lower stops in earlier slots, except that a route cannot repeat a lower-numbered route. For example, the first route will ...
Read now
Unlock full access