Custumers in objective function

49 views
Skip to first unread message

Roberto nava

unread,
Sep 8, 2021, 1:04:17 PM9/8/21
to or-tools-discuss
Hi everyone, is there a way to add the number of the visited nodes (custumers) in the objective function? The idea behind is to create routes with the maximum number of visited nodes as possible.

Thanks.

hannes

unread,
Sep 8, 2021, 1:46:40 PM9/8/21
to or-tools...@googlegroups.com

By default, all nodes are visited.

Do you have some kind of drop penalty or node disjunction in place?



On 08.09.21 19:04, Roberto nava wrote:
Hi everyone, is there a way to add the number of the visited nodes (custumers) in the objective function? The idea behind is to create routes with the maximum number of visited nodes as possible.

Thanks.
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/b365c9f2-0565-4bcf-9501-397b9a88b850n%40googlegroups.com.

Roberto nava

unread,
Sep 8, 2021, 3:22:25 PM9/8/21
to or-tools-discuss

Thank you leev for your answer. Yes, I penalize some nodes, this is because nodes have restrictions and sometimes the routes do not converge, but is there a way to assiged as many nodes  (called k) as posible to a route/vehicle  by using penalization? it means, by taking into account  a number of nodes (called C), the nodes assigned to route follow k<=C by forcing k=C as possible.

blind.line

unread,
Sep 8, 2021, 5:29:56 PM9/8/21
to or-tools...@googlegroups.com
I am assuming you are talking about the routing solver. Is this correct?

So if you use disjunctions on nodes, and the disjunction are large, then almost always the solver will maximize the number of nodes included in the solution.

This is because the disjunction value is part of the objective that is being minimized. 

If the drop penalty is 1000000, then not dropping a node will benefit the solution by that much 

If you are not seeing this behavior—if it seems the solver could add more nodes—then you might have an error in your formulation. 

James

On Sep 8, 2021, at 12:22, Roberto nava <otrebor....@gmail.com> wrote:



Roberto nava

unread,
Sep 8, 2021, 9:40:23 PM9/8/21
to or-tools-discuss
Thank so much James, now everything make me sense
Reply all
Reply to author
Forward
0 new messages