Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only

Improving a model (knapsack + trucking)

  • 1.  Improving a model (knapsack + trucking)

    Posted 04/05/22 07:24 AM
    Edited by System Admin 01/20/23 04:22 PM
    Hello!

    I have a working CP model and would like to improve it:

    The problem is simple; I have several parcels, each with a weight, an origin, and a destination.
    I need to distribute those parcels on trucks in a way that does not exceed the capacity of the truck and minimizes the total costs. Trucks can't do more than 2 stops both at origin (parcel collection in different warehouses) and destination (client warehouses).

    min totalCosts = Nº Stops at origin * Cost Stop at origin + Nº Stops at destination* Cost Stop at destination+ KM to the furthest destination * Cost KM.

    Although it works, the way I calculate the number of stops does not seem very efficient to me (see model attached).
    I do not know if there is a better way to do it :)

    Also, I would like to make some notes:
    • It is fast in CP, but very slow in CPLEX.
    • I can get solutions in seconds, but I would like to obtain better ones.
    • If I retry the same problem multiple times I normally get better solutions. Retrying the same problem multiple times with different seeds doesn't seem to do the trick (flow control).

    Any suggestions for improving the model will be very welcome, thanks!

    ------------------------------
    Tomas
    ------------------------------
    #DecisionOptimization