Decision Optimization

Decision Optimization

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

 View Only
  • 1.  CPLEX Single Deport Vehicle Routing Problem

    Posted Mon June 21, 2021 02:05 PM
    Hello everyone,

    I have been trying to solve a single depot vehicle routing problem, however, every time I run the model I get the solution 0E0. 
    Can anyone of you see my mistake in the mod and dat file I will provide below?

    //i,j node index
    //k truck index

    {int} V = ...; //Set of nodes Customers + Depots
    {int} K = ...; //set of vehicles k

    float Distance [V][V]= ...;
    float Capacity [K] = ...;
    float Demand [V] = ...;

    dvar boolean X [V][V][K];
    dvar float u[V];
    int n = ...;

    minimize

    sum (i in V, j in V, k in K )
    X[i][j][k] * Distance[i][j];

    subject to {

    // 16
    forall(j in V)
    sum (i in V, k in K)
    X[i][j][k] == 1;

    // 17
    forall (i in V)
    sum (j in V, k in K)
    X[i][j][k] == 1;

    // 18
    forall (k in K, h in V)
    sum (i in V) X[i][h][k] - sum (j in V) X[h][j][k] == 0;

    //19
    forall (k in K)
    sum (i in V, j in V)
    Demand[i] * X[i][j][k] <= Capacity[k];

    //21 -24
    forall(k in K)
    sum (j in V)
    X[1][j][k] <= 1;

    //Subtour elimination
    forall (k in K, i in 1..n, j in 1..n: i!=j)
    u[i] - u[j] + n*X[i][j][k] <= n-1;
    }


    Dat:

    V = {1, 2, 3, 4}; //set of all nodes
    K = {1, 2}; // set of trucks

    n= 4;

    Distance = [
    [0, 15, 10, 30],
    [15, 0, 24, 23],
    [10, 24, 0, 36],
    [30, 23, 36, 0]
    ];

    Capacity = [100, 120]; // capacity of vehicle k
    Demand = [0, 30, 50, 40]; // demand for product of customer i

    ------------------------------
    Saskia Kohler
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX Single Deport Vehicle Routing Problem

    Posted Mon June 21, 2021 04:52 PM
    You do not have any constraints requiring that demand be met. So the optimal solution to your model is for all the drivers to go to a bar and play cards, and no vehicles to go anywhere, at a cost of zero mileage on the vehicles.

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------