Just another Perl shrine PerlMonks

### Re^2: Travelling problem (Anyone better 82991?)

by BrowserUk (Pope)
 on Dec 22, 2013 at 18:17 UTC ( #1068104=note: print w/replies, xml ) Need Help??

in reply to Re: Travelling problem (Anyone better 86850?)

There are better solutions than 84860:

```83907: 0 1 10 15 6 11 7 2 18 19 17 14 4 21 9 13 22 8 3 12 5 20 16
83666: 0 1 10 15 6 11 7 2 18 19 17 14 21 9 4 13 22 8 3 12 5 20 16
83633: 0 1 10 15 6 11 7 2 18 19 17 14 21 4 9 13 22 8 3 12 5 20 16
82991: 0 1 10 15 6 11 7 2 18 19 17 4 14 21 9 13 22 8 3 12 5 20 16

Replies are listed 'Best First'.
Re^3: Travelling problem (Anyone better 86850 84860?)
by Dirk80 (Monk) on Dec 22, 2013 at 21:07 UTC

Wow, I'm impressed about your ability to find that fast a very good solution. I don't know the perfect value. But 84860km seems to be a very short distance for the 24 places.

Of course I want to try to write my own code. But it would be interesting for me which algorithm you used. Until now I did not have success with the Graph module. See Re^3: Travelling problem

Now I'll try the minimal hamilton path.

I'm using a genetic algorithm (based loosely on Re^15: Divide array of integers into most similar value halves (Updated)), it gets close very quickly, but has no guarantee to ever find the best. Nor any guarantees about the quality of what it does find. (Nor even any criteria by which to judge that.)

It took less than a minute to find 86850, but much, much longer to refine that to 84860.

I threw the implementation I've been using together late last night and it is pretty crude and messy. Once I've cleaned it up I'll post it.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Travelling problem (Anyone better 82991 84860?)
by BrowserUk (Pope) on Dec 26, 2013 at 17:05 UTC

Ignore this!. Programmer error! There are better solutions than 84860:

```83907: 0 1 10 15 6 11 7 2 18 19 17 14 4 21 9 13 22 8 3 12 5 20 16
83666: 0 1 10 15 6 11 7 2 18 19 17 14 21 9 4 13 22 8 3 12 5 20 16
83633: 0 1 10 15 6 11 7 2 18 19 17 14 21 4 9 13 22 8 3 12 5 20 16
82991: 0 1 10 15 6 11 7 2 18 19 17 4 14 21 9 13 22 8 3 12 5 20 16
No, your lists only contain 23 items

I'll update above also.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Create A New User
Node Status?
node history
Node Type: note [id://1068104]
help
Chatterbox?
 [Eily]: well I had to google translate that [Eily]: let me inform you that the Dutch reek translate into the Czech páchnout [Eily]: very useful default translation :P [Eily]: BTW LanX, you should try typing a few random chars at the beginning of each message. This will prevent expansion :P [LanX]: qwiud you sthink so? [LanX]: zxwqbd good idea! :) LanX embraces his new habit spqopiwjdnq [ambrus]: qQUkZTmHTuKxStGT- BzTIK9gdudif7TkTLI t3mnF144UaAZjkknXY 8nN-QM19wHBsTrp5vB lEYU_Kksa7X1RIBB4x EWLD5X7SW3jGX5ryfN OMn_yL5FTdQxzjhtyX mKN9sjUCzBNHK5Rrp0 S2WMUvIb1i9aZFgjtq VR0GH1bjPMvm1G16iz hBqc1U6toPd4FbJOFj VsOeT745AN1_pO88rD SRAYKtBZwCZedESZmN mvutrOTHiSNwflB- pRfn_k [Eily]: so far it seems to work Your Mother reminds the monks they should be grateful not to share an office, lest they be subjugated to constant inanities like, "Czech please!"

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2017-03-27 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (320 votes). Check out past polls.