tour - and followed by the numbers of the planets in the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 General GXMD's Tour ------- ------ ---- General GXMD, who lives in 5 dimensions, is responsible for the home defense force in a sector of the galaxy with N planets. The planets are conveniently named 1, 2, 3, . .., N. The general, who is on planet 1, wants to make an inspection tour. Specifically he wants to go from planet 1 to planet N, stopping along the way at every other planet, so he visits each planet only once. He wants you to find for him the shortest such tour, in terms of 5 dimensional distance. Input ----- For each of several instances: Line 1: The number N of planets. 2 <= N <= 16. Lines 2. .N+1: For each planet, one line containing the 5 coordinates of the planet. The input ends with a line containing a single 0. Output ------ For each instance, one line beginning with `Instance #:'
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and followed by the numbers of the planets in the order that the general is to visit them, so as to have the shortest tour. The first is always 1 and the last always N. Each planet number appears exactly once. a Sample Input------ -----4 0.2 0 0 0 0 4.9 0 0 0 0-0.3 0 0 0 0 4.0 0 0 0 0 5 1 2 3 4 5 2 3 4 2 1 8 4 5 7 2 3 4 2 1 4 8 4 3 2 2 Sheet1 Page 2 Sample Output------ ------Instance 1: 1 3 2 4 Instance 2: 1 4 2 3 5 I File:tour.txt Author:Bob Walton <[email protected]> Date:Thu Oct 11 15:13:01 EDT 2001 The authors have placed this file in the public domain they make no warranty and accept no liability for this file. RCS Info (may not be true date or author): $Author: walton $ $Date: 2001/10/11 19:15:54 $ $RCSfile: tour.txt,v $ $Revision: 1.2 $...
View Full Document

This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.

Page1 / 2

tour - and followed by the numbers of the planets in the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online