Course Grained Moves with Chain Variables

219 views
Skip to first unread message

Julianne Bowles

unread,
Nov 4, 2016, 4:08:00 PM11/4/16
to OptaPlanner development

I have a modified version of the vehicle routing problem. Rather than only dropping off packages, vehicles are picking up packages from various locations and then dropping them off. I implemented this like the vehicle routing problem with a package being duplicated for the pickup and dropoff. I used a hard constraint to guarantee the package pickup and dropoff are in the same vehicle. So, if there are 10 packages, there ends up being 20 customers in the system. (PlanningEntity = Customer, PlanningVariable = previousStandStill)

 

It is working fine for most of my sample problems, but some of them get caught in a score trap. The chained move helps little because it separates the dropoff from the pickup. So, I need a course-grained moved other than a chain move. I tried pillar moves, but it appears that move type does not work for chained variables. Ideally, I’d like a move that will move the pickup standstill and the dropoff standstill to a different vehicle together. I considered a Cartesian move of 2 change moves using mimic, but I do not think mimic can be applied to a problem fact. Do I need to build a custom move, or is there a way to build a pillar-type of move using a union or cartesianProduct Selector? Or any other ideas to prevent score traps in this modified VRP?


Geoffrey De Smet

unread,
Nov 5, 2016, 4:52:49 AM11/5/16
to optapla...@googlegroups.com

Just thinking aloud:

A) Using a custom move is a good idea on your current model, but it's indeed complex.
Users have done it before (see SO archive) but we could use an example of VRPPD to make it easier.

B) But there's also the idea of using a radically different domain model:

@PlanningEntity class PickUp {

  DropOff dropOff;

  @PlanningVariable previous; // just like in normal VRP

}

@PlanningEntity class DropOff {

  PickUp pickUp;

  @PlanningVariable int hopCount; // between 0 and 100

  @CustomShadowVariable(source = pickup & hopCount) ??; // hmmm, this might not work, let's try C)

}


C) Another idea of using a radically different domain model:

@PlanningEntity class Customer {

  @PlanningVariable previousPickup; // just like in normal VRP, determines pickup
  @PlanningVariable int hopCountDropOff; // between 0 and 100, determines dropoff

  @CustomShadowVariable(source = previousPickup & hopCountDropOff) indexInVehicle; // or previousGeneral and nextGeneral?

}

The idea is that we're not scheduling the dropOff in an absolute manner, but in a relative to the pickup manner,
so it's always the same vehicle and after the pickup. The hopCount determines how many pickups/dropoffs to skip before doing it.
The shadow variable calculates the effect of the hopCount on the route so it the actual route is easily available for the score rules etc.

I haven't tried or seen B) or C) yet, but it would make an interesting idea to research.

With kind regards,
Geoffrey De Smet

On 04/11/16 21:08, Julianne Bowles wrote:

I have a modified version of the vehicle routing problem. Rather than only dropping off packages, vehicles are picking up packages from various locations and then dropping them off. I implemented this like the vehicle routing problem with a package being duplicated for the pickup and dropoff. I used a hard constraint to guarantee the package pickup and dropoff are in the same vehicle. So, if there are 10 packages, there ends up being 20 customers in the system. (PlanningEntity = Customer, PlanningVariable = previousStandStill)

 

It is working fine for most of my sample problems, but some of them get caught in a score trap. The chained move helps little because it separates the dropoff from the pickup. So, I need a course-grained moved other than a chain move. I tried pillar moves, but it appears that move type does not work for chained variables. Ideally, I’d like a move that will move the pickup standstill and the dropoff standstill to a different vehicle together. I considered a Cartesian move of 2 change moves using mimic, but I do not think mimic can be applied to a problem fact. Do I need to build a custom move, or is there a way to build a pillar-type of move using a union or cartesianProduct Selector? Or any other ideas to prevent score traps in this modified VRP?


--
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 https://groups.google.com/group/optaplanner-dev.
For more options, visit https://groups.google.com/d/optout.

Julianne Bowles

unread,
Nov 7, 2016, 10:52:44 AM11/7/16
to OptaPlanner development
Thank you for the ideas! I will look into them.

eshv...@gmail.com

unread,
Feb 9, 2017, 12:46:45 AM2/9/17
to OptaPlanner development
Hey Julianne,

I'm working on the same issue and was wondering if you've had any luck with these approaches? I am a little hesitant to change around my entire domain model but the custom chained move seems pretty complicated. 

Were you able to implement and work with one of these approaches? 

Thanks
Eugene 
Reply all
Reply to author
Forward
0 new messages