|
||
Title: Two-Person Traversal of a Sequence of Cities Post by S4T4N on Jun 19th, 2009, 11:50am You are given an ordered sequence of n cities, and the distances between every pair of cities. You must partition the cities into two subsequences (not necessarily contiguous) such that person A visits all cities in the first subsequence (in order), person B visits all cities in the second subsequence (in order), and such that the sum of the total distances travelled by A and B is minimized. Assume that person A and person B start initially at the first city in their respective subsequences. Source : http://people.csail.mit.edu/bdean/6.046/dp/ |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by Grimbal on Jun 20th, 2009, 4:34am I can do it in O(n2) [hide]Compute for each i<j what is the minimum travel distance t[i,j] to visit cities up to j in order, where one traveler ends at i and the other ends at j. t[i,j] can be computed from the previous values. t[i,j] = t[i,j-1] + d[j-1,j] if i<j-1 (the same person visited the last 2 cities) t[i,j] = min[k<j-1](t[k,j-1] + d[k,j]) if i=j-1 (a different person visited the last 2 cities) [/hide] |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by towr on Jun 20th, 2009, 5:30am Do they have to visit their cities in the order of the sequence? Otherwise it sounds a lot like the traveling salesman problem; which can't be solved so easily. |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by Obob on Jun 20th, 2009, 9:53am Your interpretation sounds correct, towr. A key word here is to "partition" the cities into two subsequences, which suggests we can specify which cities they visit but that the order they visit them is already specified by the original ordering. |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by singh_sukhu on Sep 28th, 2009, 1:26am So does that mean we have to only list the partitions?? The following contains an approach to the problem using genetic algos. www.icgst.com/aiml/Volume6/Issue3/P1120632001.pdf |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by R on Sep 28th, 2009, 12:04pm What I understood from the question is that we are given n cities in a certain order: A1, A2, A3, ....An. Along with that we are given distance between each pair of cities, Ai,j for all 1http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/le.gifi,jhttp://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/le.gifn. We have to divide it in two sequences, Ai1, Ai2, Ai3, ....Aik. Aj1, Aj2, Aj3, ....Ajk. such that i1 < i2 < i3 < .... < ik and j1 < j2 < j3 < .... < jk. Which I think is quite different from and simpler than the Travelling salesmen problem. The source also suggests that a dynamic programming solution is expected for this problem. |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by Grimbal on Jan 10th, 2012, 9:35am (received this as PM) Quote:
I don't understand. What is the "travelling grid"? |
||
Title: Re: Two-Person Traversal of a Sequence of Cities Post by towr on Jan 10th, 2012, 9:46am If that's the same person I got a PM from (tetraktida), then what I think he has in mind is Manhattan distance, so all cities are on a 2D grid, and distance between cities is horizontal + vertical distance. I've exchanged a few PMs with him, here's the last PM I got. I haven't really found time to look at it, but it should give a better idea what he's working on (at least in as much as it reveals it has something to do with manhattan distance). Quote:
|
||
Powered by YaBB 1 Gold - SP 1.4! Forum software copyright © 2000-2004 Yet another Bulletin Board |