[pgrouting-dev] Problems testing VRP

Stephen Woodbridge woodbri at swoodbridge.com
Thu Apr 24 14:44:41 PDT 2014


Hi Razequl,

I am trying to merge your gsoc-vrp branch into develop and it seems to 
have come over without a problem, except I'm having a problem creating a 
repeatable test case for our test tools.

I need a way to create a test case that will always return the same 
result for the same input.

Things I have tried so far are:

1. set seed for the random number generator. Although rand() starts with 
a a seed of 1 so I'm not sure it matters but in 
CVRPSolver::getSolution() I have added srand(1726354); but this does not 
help.

2. in the test sql I changed it to:

select * from pgr_vrpOneDepot(
     'select * from vrp_orders order by id'::text,
     'select * from vrp_vehicles order by vehicle_id'::text,
     'select * from vrp_distance order by src_id, dest_id'::text,
     1 ) ORDER BY vid, opos;

So I order the inputs and the outputs so there is not chance that the 
queries to fetch data get loaded in a different order ot that the 
results re ordered differently.

Obviously there is some other randomness in the TABU search that is not 
obvious to me.

Can you help me understand this and point out how I might be able to get 
this to work to return consistent results from run to run?

Best regards and many thanks if you can help,
   -Steve

PS: I hope you are doing well. We just got 2 new students approved for 
GSoC again this year. I hope you will stop by the list and say how when 
you have some free time and let us know what you are doing these days.


More information about the pgrouting-dev mailing list