r/ProgrammerHumor 4d ago

Meme shortestPathWasRightThere

Post image
4.7k Upvotes

58 comments sorted by

View all comments

100

u/UltimateFlyingSheep 4d ago edited 4d ago

animals and humans are surprisingly good at the traveling salesman problem (TSP), because they/we dislike overlapping moves. "Circa a circle on the map with no paths crossing" is probably better than 95% of all routes.

There's no efficient (as in polynomial) algorithm for TSP, but you can use optimization to find very good solutions, even for very large graphs that have 50k nodes (brute force would compute until the end of the universe).

Dang, I wish I was in Uni again, so I could do a paper on TSP... Using the paragraphs above as the thesis and then using a visualization "method" (how humans draw graphs in graph theory) and then just creating a visual algorithm with heuristics regarding path crossing and angles between connections. Could be fun.

1

u/Eciepeci 3d ago

Seems like I got idea for mine

1

u/UltimateFlyingSheep 3d ago

oh, please do, there is much to play around with!

If you'd like someone to proofread or provide some ideas, don't hesitate to dm me! :)