News for hackers. Stuff that matters.
Re:Show HN: Interactive visual solver for the traveling sale... by n4r9 on Tuesday October 15, 2019 @05:59PM (#21264387)
Really cool visualisation, thanks for sharing.

Mentally I tend to further categorise heuristics into "construction" and "improvement" heuristics. Your "shortest path" is a construction heuristic that I normally call "nearest neighbour". Other common heuristics are "greedy" (iteratively add the shortest feasible edge) and "farthest insertion" (iteratively add the farthest point from the subtour to the best position). There's an interesting synergy between construction and improvement strategies, e.g. 2-opt might be more worthwhile after nearest neighbour than greedy. It would be extra awesome to be able to choose both construction as well as improvement and see how it pans out.

Re:Show HN: Interactive visual solver for the traveling sale... by intrepidev on Tuesday October 15, 2019 @06:41PM (#21264793)
Thanks so much! I haven't formally studied these so the terminology still gets me sometimes.

When you say "choose construction as well as improvement", I'm curious what you mean. It may not be clear, but if you run shortest path, the resulting best path is fed into whatever algorithm you run next. Is that what you mean?

Re:Show HN: Interactive visual solver for the traveling sale... by n4r9 on Wednesday October 16, 2019 @03:02AM (#21267805)
Ah I see, I didn't realise you could combine heuristics. I still think it would be cool if you could pick from multiple construction heuristics (shortest path, farthest insertion...), followed by which improvement heuristic/s you want to use (2-opt, 3-opt...).

The choice of which heuristics you use and what order you do them in is sometimes called your meta heuristic strategy.

Re:Show HN: Interactive visual solver for the traveling sale... by filleokus on Wednesday October 16, 2019 @05:14AM (#21268472)
Really nice!

If the optimal result is known maybe you could present that somehow? To see how good/bad the current solution is.

Re:Show HN: Interactive visual solver for the traveling sale... by oplav on Tuesday October 15, 2019 @11:37PM (#21266839)
Very cool! FYI, double clicking the map is throwing an error for me and crashes the app to a white screen.
Re:Show HN: Interactive visual solver for the traveling sale... by intrepidev on Wednesday October 16, 2019 @04:36PM (#21275266)
thanks for the heads up! should be fixed
Re:Show HN: Interactive visual solver for the traveling sale... by jdmg718 on Wednesday October 16, 2019 @10:36AM (#21270809)
I've been thinking about this problem for a while with a little twist. What if you wanted to run/walk all the streets in your city? What is the shortest path to do it? How do you calculate the number of kilometers of streets in a city?
Re:Show HN: Interactive visual solver for the traveling sale... by hxhxhrra on Wednesday October 16, 2019 @02:21PM (#21273612)
This problem is called Chinese Postman Problem and can be solved in polynomial time using matching algorithms:

https://en.m.wikipedia.org/wiki/Route_inspection_problem

Re:Show HN: Interactive visual solver for the traveling sale... by Hitton on Wednesday October 16, 2019 @11:06AM (#21271157)
Nice. If I can suggest a cosmetic improvement, you list number of possible paths, it would be cool to see how many paths algorithm tried so far until it finishes (and how many paths it tried in total).
Re:Show HN: Interactive visual solver for the traveling sale... by intrepidev on Wednesday October 16, 2019 @04:35PM (#21275248)
really like this idea - I'll look into it, maybe with a progress bar or something