A question about chained planning variables (for using OptaPlanner for routing freight and trucks)

361 views
Skip to first unread message

Jaime Arboleda Castilla

unread,
Feb 24, 2015, 2:27:34 PM2/24/15
to optapla...@googlegroups.com
Hello!

First of all thanks for the impressive work... It's amazing!

I will ask first the question, and then I will explain the problem just to see if there are other possibilities. When you have a chained planning variable, then is it true that each planning entity can have only one predecessor? Or can the predecessor be different depending on the anchor? I guess the right answer is the first one, but then I don't know how to use a chained variable when the path depends on the anchor... Will I have to go over to the cartesian product space (Anchors x Entities)? I hope not, because it will enlarge too much the complexity! :D 

Or maybe the raise in complexity for considering the product is not that much, because only the chains with the same anchor in each step will be valid... I honestly do not know.

Well, I will briefly state the problem to see if it could be thought other way... 

I'm trying to improve the system of a company that delivers freight to different locations on a number of trucks. The trucks are fixed to a route (they always travel from A to B and viceversa). The main difference with the VRP problem that you have solved is that there are intermediate nodes where the trucks exchange their loads. So a packet can travel in multiple trucks, and the chain variable you have used (if the answer was the first one) cannot work, because, across each location, many different trucks can travel, and then the chain will not be linear. I thought that maybe instead of considering the locations I could consider the travels as the entities in the chain, but the problem will arise again (there is no single predecessor to each travel; it depends on the packet). 

If you could shed some light on this issue I will really, really appreciate it!

I would like to thank you for your time and patience.

Best regards, 

Jaime

Geoffrey De Smet

unread,
Feb 25, 2015, 1:02:16 AM2/25/15
to optapla...@googlegroups.com
Chained variables imply that there is only 1 previous, which indeed leads to the 1 anchor.
See docs about "chaining principles" etc.

That being said, currently we support 2 PlanningVariableGraphTypes:
- NONE
- CHAINED
So chained is the only special structure we currently support out-of-the-box.
In the future we'll add TREE etc, if those prove to be useful.

In your case, I 'd either not use chained (and add hard constraints to force the structure
and you probably will want to add a custom move factory near the end of development to get better results)
Or I 'd redesign the model to work with chained variables, if that's somehow possible.

With kind regards,
Geoffrey De Smet

--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To post to this group, send email to optapla...@googlegroups.com.
Visit this group at http://groups.google.com/group/optaplanner-dev.
For more options, visit https://groups.google.com/d/optout.

Jaime Arboleda Castilla

unread,
Feb 25, 2015, 2:10:37 PM2/25/15
to optapla...@googlegroups.com
Thanks a lot Geoffrey! :)

I think the tree could be useful in my case... :)

If I don't use a chained variable, I think that the only alternative will be to use an ArrayList (or similar) as a Planning Variable, but I'm not sure if that is supported or not... I ask it because I have not seen anything about that in the documentation (as far as I remember...).

Anyway, I will think over the matter more. 

Thanks again.

With kind regards, 

Jaime
Reply all
Reply to author
Forward
0 new messages