# Initial Routes without Initial Routes

Hello,

I have a problem and I hope you can help me with it

I have a fleet of vehicles working for multiple days. For example I have a vehicle from 540 (540 minutes so 9 Oclock on the first day) to 8220 ( 1020 minutes (17 oclock) after 5 days (so 5 x 1440))
Now I have services that are from 0(+ 1440 * i) to 1440(+ 1440 * i) ( so 0 oclock to 24 oclock) on each day so they could be planed on every time of the day. This is not logical so I wanted to insert into the problem â€śat homeâ€ť jobs, that are on each time between the working time of the vehicle. This services have also a custom skill â€śvehiclenameâ€ť so only this vehicle can make this service.

So far so good. In my tests the planed routes donÂ´t have everytime this â€śat homeâ€ť services planed. Also if I make the timewindow for the â€śnormalâ€ť services not from 0 to 1440 but from 500 to 1000 it doesnÂ´t help. Somehow the algorithm thinks it would be better to wait from 1000 to 1900 on the location of the last services instead of driving to the â€śat homeâ€ť job.

So somehow I need to tell the algorithm, that these â€śat homeâ€ť services are better. For examle they have no costs or something like that.

To my question:

I actually thought about putting some kind of capacity in services and vehicles. So maybe I could give normal services less or more size then to the â€śat homeâ€ť services. But would be the use of capacity and size right? Does the size of an service change the mind of the algorithm? And if yes, how? If I have 2 services on the same location and one of the services has a bigger size then the other and they would both fill the vehicle so much, that the other will not match: What service would the algorithm take?

Would there be another option to make this services â€śfixedâ€ť?

If you ask yourself, why I do not use initial routes: It donÂ´t fits to my problem ^^ The â€śat homeâ€ť services are not completly fix. There could be a service that goes multiple days. So the route is either with a â€śat homeâ€ť service at night, or with a service that goes multiple days with ajusted servicetime and routingcosts (the driving to the services costs for a 2 day service 3 ways) But this is an other problem

I hope you can understand me

thanks

Hello again

I tested a little bit with the capacity and I think that it donÂ´t fits to my problem. Services that are nearer and have a bigger size dimension will be ignored. The nearest are the first that will be used. Butâ€¦

I am a little bit further with my problem. I used the following functions

VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance(â€śvehicleTypeâ€ť).setCostPerDistance(50.0).setCostPerServiceTime(0.0).setCostPerWaitingTime(50.0);

So I tell the algorithm, that driving and waiting costs the same and more then working on a service. This looks good. In my benchmarks nearly all â€śat homeâ€ť services are planed. nearlyâ€¦

For the beginning of the iterations it looks like that the â€śat homeâ€ť services are not planed, but from iteration to iteration more of them are in the solution so I think, that for the vrp is optimal(or better) with them then without these services. For example: With 100 iterations there where 10 â€śat homeâ€ť services unplaned, with 400 where 5 â€śat homeâ€ť services unplaned and with "1000 all where planed or 1-2 not.

My problem is now: I create the algorithm with the â€śfrom scratch methodâ€ť:

algorithm = Jsprit.Builder.newInstance(problem)
.setProperty(Jsprit.Parameter.VEHICLE_SWITCH, â€śfalseâ€ť)
.buildAlgorithm();

I think by default, it is a random ruin used. The problem would be that it can be that some corners of the vrp will not be ruined. So even if I make 1000 or 2000 iterations it can be, that these â€śat homeâ€ť services are unplaned.
My question now is: Excists a strategy that can guarantiee that every point of the problem is touched? I have a little problem with all the strategies that are in .setProperty(Jsprit.Strategyâ€¦)
I donÂ´t understand all the strategys that can be used there and I canÂ´t find any documentation for what problems that strategy is the best.

Maybe you can explain me them or give me a hint, where I can find infos about the different strategys. I found a page where you talk about the xml file, but you also donÂ´t explain for what problems what configuration is better.

Have you tried the priority feature? It might help solve your problem to keep the â€śat homeâ€ť jobs assigned.

Regarding the strategies, you can find the descriptions on random ruin, radial ruin and best insertion here on an earlier version of the â€śMeta-Heuristicâ€ť page. For regret insertion, the â€śWHATS_NEWâ€ť page under â€ś2014-12-12 new release v1.5â€ť (search for it and scroll down). For worst ruin and cluster ruin, I am afraid I cannot find any explicit description, and the best I can find is again the â€śWHATS_NEWâ€ť page under â€ś2015-03-12 new release v1.6â€ť.

Alternatively, you can directly go to their respective class pages, most of those pages contain description for the specific strategy - I say most, because, again, worst ruin and cluster ruin class pages donâ€™t have the correct description for them.

Best regards,
He

Hi,
Ok. Let us open a wiki page for strategies being used by Jsprit and we can all work at a reasonable description.

Should we put this here?

Best,
Stefan

Hello again.

@jie31best
I have a question about the priorities. Does the highest priority mean, that this services are planed first, then come the normal priority and then the lowest ones? If yes this would fit very good to my problem.

So I will try it. Do I have to update for the newest Jsprit version, right?

@stefan
Yes, this would be very nice if we could discribe somehow the ruin methods and wich of them fit better wo wich problem.

If you take a look at the implementation, you will find that, for best insertion, the jobs to be inserted are sorted based on their priority for half of the time - due to

``````sometimesSortPriorities(unassignedJobList);
``````

For regret insertion, it is not achieved that way. What is done in regret insertion is that, in the score function, the difference between the cost of the best alternative and that of the second best is multiplied by

``````(4 - unassignedJob.getPriority())
``````

In general I think you are right, because in both cases jobs with higher priority tend to be inserted first.

Best regards,
He

huhu.

@jie31best
Actualy I am making benchmarks testing different count of iterations and different strategys.
Is the creation of the inital solution also updatet to the priorities? Is some initial solution strategy better for this problem?