Traveling Salesman Problem!!! (unfinished)



Dubbed EPGYTraveler, this program takes

i) the location of my classmates’ hometown,

ii) draws a black GOval around each point,

iii) and Traveling Salesman Problem! Find the shortest travel route possible.


Getting the location was a bit tedious (and messy, even). I enabled getMouseClicked and clicked on the appropriate places(while leaving the google maps on to find out where these places actually were.) In the console I got a list of x and y positions of multiple locations.

I copied and pasted that into a txt file, and tried to read it for the array of Point classes that would take its location. But so much bugs! I think txt file reading in C is more simpler. Because of the reader part my code got real messy.

I also created an array of GOvals to draw them.


and… the TSP! I either had to try every case possible (connect every spot to other and compare the distances, which would eat up an immense amount of processing power) or try the ones on the internet, which were either

i) easy but creates a few errors

ii) difficult to program.


I’m still working on the last part. For now  I thought of creating the biggest polygon possible (Making it that the dots connect in a widest angle possible) and then connecting the leftovers (inside the polygon itself) to the shortest distanced dots in the polygon’s lines. Maybe it’d work?



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s