Php TSP Solver

2,266 views
Skip to first unread message

BTS

unread,
Mar 16, 2011, 2:19:11 PM3/16/11
to Google Maps TSP Solver
Hi

Your code is in php?
Can you send the source code for the TSP solver?

Chi

unread,
Mar 16, 2011, 4:43:57 PM3/16/11
to Google Maps TSP Solver
Here is a brute-force solution in php:

http://scrivna.com/blog/travelling-salesman-problem/

toh weichun

unread,
Oct 27, 2012, 2:05:22 AM10/27/12
to google-maps...@googlegroups.com
hey guys, i want to ask how to run it? because i facing so problem in running the code....

Chi Hoang

unread,
Oct 27, 2012, 7:04:42 AM10/27/12
to google-maps...@googlegroups.com
I think it pretty good explained. Whats your problem? You can try the
math combinatoric package from pear (php math combinatorics pear) if
you have problem with building a graph and trying all possible
solutions?

2012/10/27, toh weichun <weichu...@gmail.com>:
--
...::: Chi Hoang :::...
Webdesigner, Multimedia und Datenbank Programmierer
Festnetz: +49-221-9460023
Info: http://www.chihoang.de
E-Mail: info at chihoang.de
Skype: tetramatrix
Message has been deleted

toh weichun

unread,
Oct 28, 2012, 5:30:36 AM10/28/12
to google-maps...@googlegroups.com


Dear Chi Hoang :
i trying using the code from http://code.google.com/p/google-maps-tsp-solver....to run the function, how many file is needed to include in source code? is it just BpTspSolver.js and tsp.js? i try it using html file which download form http://code.google.com/p/google-maps-tsp-solver/source/browse/trunk/test.html?spec=svn4&r=4 ....but it cant work....is it need any server to make it work? and what is selenium test? i just want the function which i attach in the picture below.....i hope you can help me...thanks


regards;
Toh wei chun
Untitled.jpg

Chi Hoang

unread,
Oct 28, 2012, 7:56:29 AM10/28/12
to google-maps...@googlegroups.com
Hi,

I cannot help you much you must do it yourself. Follows the
introduction at code.google.com/p/google-maps-tsp-solver/ and it
should be fine. Building such a site is every expensive and the
economics is shit at the moment. I've done a similar site and it was 2
month of hard work. I don't recommend you to use this for learning or
professional anyway. You need to know what you do.
But I cannot recommend you other script either. This script is the
only free in the internet.
In short you need the bptspsolver.js because it contains the tsp
solver. You don't need tsp.js because it's just a copy from the
website optimap. You need to take some stuff from the tsp.js script to
make a similar website or what I saw in your image. Selenium is a test
framework for browser application. I don't thin that you will need it.
What you need is a good javascript debugger to step through the code
not more. Opera or chrome has good one.

I hope it helps.

Chi


2012/10/28, toh weichun <weichu...@gmail.com>:
> Dear Chi Hoang :
> i trying using the code from
> http://code.google.com/p/google-maps-tsp-solver....to
> run the function, how many file is needed to include in source code? is it
> just
> BpTspSolver.js<http://code.google.com/p/google-maps-tsp-solver/source/browse/trunk/BpTspSolver.js>
> and
> tsp.js<http://code.google.com/p/google-maps-tsp-solver/source/browse/trunk/tsp.js>?
>
> i try it using html file which download form
> http://code.google.com/p/google-maps-tsp-solver/source/browse/trunk/test.html?spec=svn4&r=4
> ....but
> it cant work....is it need any server to make it work? and what is selenium
>
> test? i just want the function which i attach in the picture below.....i
> hope you can help me...thanks
>
>
> regards;
> Toh wei chun
>
> On Thursday, March 17, 2011 2:19:11 AM UTC+8, BTS wrote:
>>
Message has been deleted
Message has been deleted

Chi Hoang

unread,
Oct 28, 2012, 9:14:07 AM10/28/12
to google-maps...@googlegroups.com
Dear Stephanie,

is your name Stephanie or Toh wei chun? I think the selenium test file is for test-driven developement instead of writing the application you write a test program before. Then you can run the test program with real thing. It's about software developement probably a design process. I wouldn't pay that so much attention. You can also design you program top-down and object-oriented.
Most people just don't know that programming is a design process and not hacking stupid codes into a box!! That's why a programmer has a low social position. Look at medecine or law jobs. I'm also not very interested in the code but more in the logic or the math. In tsp and graph algorithm there is important laws like triangle inequality. It think it's about visiting each edge only once then it's satisfy the triangle inequality and a round trip. Btw. Do you know that you can find a tsp also with a space filing curve? I've wrote a z curve and hilbert curve to do exactly this. The tsp tour isn't so good like this one but it's very fast! I  also suggest you to check your language requirement? Maybe you are more comfortable with other language? I think the selenium thing isn't really necessary.




Am Sonntag, 28. Oktober 2012 schrieb Stephanie loh <stephani...@gmail.com>:
> Dear Chi Hoang
>
> Thanks you so much, but my lecturer  proposed the title for me.....so i need to find out solution myself....but why the http://code.google.com/p/google-maps-tsp-solver/source/browse/wiki/SeleniumTests.wiki?spec=svn7&r=7 show the test procedure like that? Anyways, thank for your help, i will continue test it, if got any problem, can i ask you?

>
> regards
> Toh wei chun
> On Thursday, March 17, 2011 2:19:11 AM UTC+8, BTS wrote:
>>

Stephanie loh

unread,
Oct 28, 2012, 10:09:00 AM10/28/12
to google-maps...@googlegroups.com
Dear Chi Hoang

weichun is my group member in the project.....thank for your explanation and suggestion. Sorry for inconvenient...


from stephanie 

Chi Hoang

unread,
Oct 28, 2012, 11:13:02 AM10/28/12
to google-maps...@googlegroups.com
Dear Stephanie,

thank you for your clarification. So it's okay when I write Stephanie?
I also want to say that this isn't my source code. I also have some
source code but I'm not into the GPL licence that much. I thing GPL
licence is too ambigous. To me it's not a quality thing at all and not
really about sharing, either. I'm not into the politics either. But
it's my personal experience. But big exception is this project. It's
really nicely written. I like it :).

Chi

2012/10/28, Stephanie loh <stephani...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages