[pgrouting-dev] Problems testing VRP

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.

Hi Steve,
It is nice to hear that finally the vrp-basic is getting merged. I have may thesis defense ahead. I hope I will be free within next three weeks. I will have look at the issues regarding vrp then. Also, I remember some error checking and some improvement was pending.

  • Razequl
···

On Fri, Apr 25, 2014 at 3:44 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

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.