LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 8 Jan 2004 06:40:58 -0500
Reply-To:     SUBSCRIBE SAS-L Anonymous <swanson_d@BLS.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         SUBSCRIBE SAS-L Anonymous <swanson_d@BLS.GOV>
Subject:      Traveling Salesman Problem
Content-Type: text/plain; charset=ISO-8859-1

Iím looking for a macro similar to the TSP.

I have a list of n cities along with their geographic locations, i.e., their (x,y) coordinates. I want to find the route I should take in which I always travel to the nearest un-visited city. Does anybody have a macro that does it?

I donít know if it makes any difference, but I want to measure distances with the L1 distance function instead of the usual L2 Euclidean distance function. That is, I want the distance from (x0,y0) to (x1,y1) to be ABS (x0-x1) + ABS(y0-y1) instead of SQRT((x0-x1)**2 + (y0-y1)**2). The reason is that roads in the midwest form a grid.

Back to: Top of message | Previous page | Main SAS-L page