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.
|