Re: Traveling Salesman Problem



On 05/27/10 03:41, olivier.scalbert@xxxxxxxxxxx wrote:
Hello,

In the context of the TSP (Traveling Salesman Problem), I would like
to have a good an efficient way of representing and manipulating the
route (joining all the towns).
What I would like, is to be able to remove one town from the "list" of
towns at a given position and reinsert it at an other given position,
in O(1). So I need something as a list for fast remove/insert and
something as an array for fast index access.Do you know if such an ADT
exists ?

HashMap (aka dictionary) is amortized O(1) (that is, it's O(1) unless
you've got collisions) for insertion, deletion, and indexing. However
using HashMap you will have to figure out a way to do fast O(1) hashing
and equality comparison.
.



Relevant Pages

  • Traveling Salesman Problem
    ... route (joining all the towns). ... So I need something as a list for fast remove/insert and ...
    (comp.programming)
  • Re: Traveling Salesman Problem
    ... to have a good an efficient way of representing and manipulating the ... route (joining all the towns). ... So I need something as a list for fast remove/insert and ...
    (comp.programming)
  • Re: Road work in VA, DE, NJ, NY?
    ... Any ideas if this is a through route to Atlantic ... Plan to stay the night at Atlantic City and see it, ... The towns on 36 are probably worth seeing, and the towns by Seaside are also neat, but 71 is probably not going to be worth your time. ...
    (misc.transport.road)
  • Re: Trip Report IN IL WI MN ONT IA
    ... Twin Cities to Dubuque, ... > Several of the towns we passed through seemed to have significant Hispanic ... > one left in rural parts of Iowa in a couple of decades to operate the farms. ... Well, your route did include going through Postville, which has a large ...
    (misc.transport.road)
  • Re: Niagra falls to Newark airport
    ... and then take three nights to drive to Newark airport (where we take ... so any suggestions of the best route to take, ... then drove north to the road which follows the Lake Ontario ... towns to look around. ...
    (rec.travel.usa-canada)