How can I assess the constraint count of a routing model before solving the problem completely?

35 Views Asked by At

I have a routingModel in Java whose constraints I generated. I want to get the constraint count using the method routingModel.solver().constraints() and then use this number to generate the time limit for the problem. But the number I get before solving the problem doesn't match with what I see in the search logs. How can I overcome this?

I've tried calling the method before solving and it doesn't match up; calling the method after solving is no use. I think I'd like to be able to first tell the solver to generate the initialSolution for me and then I think I can access the correct constraint count. the search can then continue with the time limit that I'll set using the constraint count.

1

There are 1 best solutions below

1
Laurent Perron On

IMO, the number of constraint is a poor proxy of the complexity of the model.

I would rather look at number of visits, average distances, tightness of time windows...