data (#23) - Creating Data for traveling salesperson problem (#227) - Message List
Creating Data for traveling salesperson problem
Hi,
I am new to postgis and pgrouting. I need steps to Create Data for TSP and routing from tiger shape database.
Thanks
manojks
02/19/09 04:57:51 (21 months ago)
-
Message #802
You need the same data as you need for routing.
- First you have to compile pgRouting with TSP, create a database load all the functions you need (there are a couple of wiki pages about installation)
- Then you need to get your shape file data to PostgreSQL (shape2pgsql might be what you need for this)
- Next I recommend you to follow the workshop: WorkshopFOSS4G2007
- When you can get a shortest path, then TSP function should work as well.
daniel02/19/09 10:00:43 (21 months ago)-
Message #804
Hi Daniel,
Thank. I have gone through WorkshopFOSS4G2007. I did not find any field "COST" in victoria table.
manojks02/19/09 14:12:17 (21 months ago)-
Message #805
In the workshop we take "length" as cost (so "cheapest" becomes "shortest"), because this data doesn't have much attributes.
You have two options:
- Create a "cost" column column and update with some data (ie. length) or rename "length" to "costs, or
- Take "length" AS "cost":
SELECT * FROM shortest_path(' SELECT gid as id, source::integer, target::integer, length::double precision AS cost FROM victoria', 238, 1455, false, false);
daniel02/19/09 14:24:07 (21 months ago)
-