Re: Travelling salesman problem in C
- From: whitehatmiracle@xxxxxxxxx
- Date: 11 Sep 2006 03:49:36 -0700
No , this would be a huge waste of memory.
For every permutation you calculate the distance.
If it is smaller than the minimum distance you have
so far then you store the new minimum plus the
permutation which produced it. Continue like this
until you've examined all permutations.
But what if there is more tha one solution. 3 paths having the smae
distance.
I was thinking of storing all the possibilities and traverssing it in
an inteligent way.
Say i have
ABCDE 45
ABCED 72
ABDEC 55
ACBDE 102
ACBDE 135
I see that the combination ACB > ABC therefore i skip the whole ACB
series...
Its like if i have a tree or a graph, the branch that gives the longest
distance can be skiped... am i right?
If so how do i go about it... is it a simple string compare?
Please enlighten me......
Thanx once again
.
- Follow-Ups:
- Re: Travelling salesman problem in C
- From: Stephen Sprunk
- Re: Travelling salesman problem in C
- From: Spiros Bousbouras
- Re: Travelling salesman problem in C
- References:
- Travelling salesman problem in C
- From: whitehatmiracle
- Re: Travelling salesman problem in C
- From: Spiros Bousbouras
- Re: Travelling salesman problem in C
- From: whitehatmiracle
- Re: Travelling salesman problem in C
- From: Richard Heathfield
- Re: Travelling salesman problem in C
- From: whitehatmiracle
- Re: Travelling salesman problem in C
- From: Spiros Bousbouras
- Travelling salesman problem in C
- Prev by Date: Re: Passing a semicolon or comma as a Macro argument
- Next by Date: Re: Question about SYSTEMTIME
- Previous by thread: Re: Travelling salesman problem in C
- Next by thread: Re: Travelling salesman problem in C
- Index(es):
Relevant Pages
|