ScratchData LogoScratchData
Back to PutneyCat's profile

For gtoal: travelling salesman

PUPutneyCat•Created November 20, 2016
For gtoal: travelling salesman
27
18
558 views
View on Scratch

Instructions

Original instructions in original project. Thanks gtoal, I'm guessing travelling salesman has been so well studied that any technique is either already known or not very good. But anyway here's my stab at it.

Description

Basic strategy: 1. Sort by distance from centre; 2 Subject to 3 and 4, join each city (starting with furthest from centre) to its two closest neighbours. 3. Avoid creating loop till end. 4. Can't join to city already linked to two others. Then some improvement by (a) uncrossing crossed lines and (b) checking whether individual points would be better inserted into a line segment elsewhere.

Project Details

Project ID131906576
CreatedNovember 20, 2016
Last ModifiedSeptember 23, 2018
SharedNovember 20, 2016
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root