New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSP with fixed source & destination #49
Conversation
Extending TSP solver to support the case where both the source and destination nodes are specified.
Hi Levi, |
Correct, omitting the destination param will fall back to the existing tsp
|
Will it work if I just install the routing_tsp.sql file or what do I have to do more to get it to work? |
You will need to grab the modified C src files, build the updated pgrouting library from source, then apply the routing_tsp.sql patch to your database. |
Thanks for quick answer! I will test that on monday! 9 mar 2012 kl. 14.25 skrev Levi Felling: You will need to grab the modified C src files, build the updated pgrouting library from source, then apply the routing_tsp.sql patch to your database. Reply to this email directly or view it on GitHub: |
I've managed to get it to work but the tsp is working for about 2 seconds when run it with 25 nodes and I think the result isnt that great. I had the same problem with the original tsp. |
Hi Timmy, In order to use tsp wrappers you have to either change in them table name from "tsp_test" to " ' || quote_ident(geom_table) || ' " (but there is problem with dead nodes) or prepare separate table with nodes ids and its coordinates. According to tsp documentation: |
I just replaced the TSP solver so we are no longer dependent on the GAUL libs, see SHA: 0876b70 The new solver assume that the nodes will be in a loop. You can specify a start point like before. I'll have to look into how make it work with an endpoint. If anyone wants to take a pass at that I would love the help, as I have a lot of other 2.0 issues to deal with. |
I just committed change to develop that now support an optional end point if you want to optimize a point to point route instead of a loop from a depot. |
Extending TSP solver to support the case where both the source and
destination nodes are specified.
I'm not sure if this case is covered somewhere already, but I didn't see a way to do it. I needed to solve TSP for multiple locations between a fixed start and end point. My solution is fairly trivial, I simply added new seed (tspd_seed) and score (tspd_score) functions to tsp_solver to handle the case where a destination is specified. There is probably a cleaner way to do this, but my C programming skills are limited.