0% found this document useful (0 votes)
52 views14 pages

Vehicle Routing Optimization Model

The document describes the objective function and constraints for a vehicle routing problem to minimize the total time taken for vehicles to travel from nodes to collect and deliver milk. The objective is to minimize the total time taken for vehicles to travel between farmer nodes, ECFs (milk collection centers), and depots, as well as between depots and milk plants. The constraints ensure that each farmer node is visited exactly once, the flow of vehicles in and out of each node is balanced, vehicle loads do not exceed capacities, and time constraints are met.

Uploaded by

ravi_radan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views14 pages

Vehicle Routing Optimization Model

The document describes the objective function and constraints for a vehicle routing problem to minimize the total time taken for vehicles to travel from nodes to collect and deliver milk. The objective is to minimize the total time taken for vehicles to travel between farmer nodes, ECFs (milk collection centers), and depots, as well as between depots and milk plants. The constraints ensure that each farmer node is visited exactly once, the flow of vehicles in and out of each node is balanced, vehicle loads do not exceed capacities, and time constraints are met.

Uploaded by

ravi_radan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Objective Function

Minimize

 jN  kN  vV xvjkT jk  i


A A

N wV
ciwTOi
I (1)

First term represents time taken for inbound vehicle to travel from node j to k, which may be farmer
node or ECF or Depot. Second term represents time taken for outbound vehicle to travel from depot to
milk plant. Objective is to minimize total time for inbound and outbound activities.

Subject to

 jN  vV xvjk  1


O
 kN
(2)

Each farmer node is visited once from depot.

(Your interpretation is slightly wrong.


Actual: Each farmer node is visited exactly once.
But may or may not be from depot.
A vehicle could go to a farmer from depot and then go to another depot.
Hence sum of j ϵ No.
N0 includes all nodes and depot.)

(Doubt: I understood that only one node is visited from depot, as the total summation is one)

 
jN vV
xkjv  1 K N
A (3)

Each farmer node is visited once by outbound vehicle (from farmer node to depot, it may include ECF
or not).
(Doubt: I understood that only one node is visited from depot, as the total summation is one)
(After visiting the node the vehicle should leave also)

So, practically above 2 constraints combined to say that every node needs to be visited once
x
k N A
v
jk   lN xljv  0
O
j  N , v V
(4)

First term signifies vehicle moves from farmer node to another farmer/ECF/Depot
Second term- vehicle moves from Farmer node/Depot to Farmer node (Flow conservation constraint)

(This is continuation of above 2 constraints.

Only the vehicle that comes to any farmer/node should leave too.
i.e. The vehicle that comes should leave.

Can be rewritten as:

x
k N A
v
jk   lN xljv
O
j  N , v  V

It is an if-only then constraint

So If RHS is 1, LHS is 1
if RHS is zero, then LHS is zero

Practically that means

if vehicle v visits node j, then it has to leave from node j.


if vehicle v does not visit node j, then it cannot leave.
)

jN
xojv  1 v V
(5)

From depot vehicle should visit once to farmer node.


(Doubt: How it can be < 1)

THIS CONSTRAINT IS FOR VEHICLES NOT FOR NODES. All nodes need to be visited but not
all vehicles need to be used.

Look at the v V . That means for all vehicles v in Set of ‘V’.

(it is <= 1 because, a vehicle will leave the depot only if it is used.
Sometimes, if demand is low and vehicles are more, then some vehicle may not be used.)
If you don’t put this constraint CPLEX will send the same vehicle multiple times (So it is <= 1 ).


iN
ciw  1 w V
I (6)

From depot vehicle should visit once to plant.


(Doubt: How it can be < 1)

(SIMILAR TO PREVIOUS CONSTRAINT) This constraint is also for all vehicles not nodes.

(  x kjk )  xkov  0 k  N c ,v V
jN
(7)

Vehicle moves from Farmer node to ECF then again ECF to depot.

Rewriting:

(  x kjk )  xkov k  N c,v V


jN

Again an if-only then constraint.

If LHS is =1, RHS is also =1. (If a vehicle goes to ECF, then from ECF it should go to depot)

If LHS is =0, RHS is also =0. (If a vehicle does not go to ECF, then it cannot go to depot from ECF)
y vj  ykv  G j  ( xkjv  1)Q v k  N A, j  N B , v V
(8)

Not getting this.

Suppose you have visited node k and collected some milk from that farmer.

Now you have total Yk amount of milk in the vehicle.

Suppose after k you go to j node farmer.

If j node farmer has G litres of milk, then total milk will become,

Yj = Yk + Gj (Amount you already had + new farmer milk collected)

But this constraint is applicable if and only if you visit j node immediately after k. Otherwise
equation is not applicable.

So,

Now breakdown the original constraint as below:

When x kj = 1,( if you visit node j after k), then

y vj  ykv  G j  (1  1)Q v

y vj  ykv  G j
(As I explained above.)

If x kj = 0,( if you do not visit node j after k), then

y vj  ykv  G j  (0  1)Q v

y vj  ykv  G j  Q v
So,

Q v  ykv  G j
Now look at the RHS, Since Qv is the maximum capacity, ,

ykv  G j  Qv
will become a negative number (or a very small number )

y vj  0
So, (As the RHS is negative and Yj is binary, it cannot be less than zero).

So, if Xkj =0, this constraint becomes,

y vj  0
which is always satisfied as yj is binary (So it becomes a useless constraint (redundant)).
THIS WAS AN EXAMPLE OF A CONDITIONAL CONSTRAINT(IF_ELSE).
y vj  Q v j  N B , v  V
(9)

Accumulated load taken from farmer node/ECF should be less than its capacity.

y vj   kN  lN xlkv Gk  jN B ,vV


O
(10)

Accumulated load should less than or equal to the actual capacity (raw milk at farmer nodes)

  wV iN I
i
svw   kN  jN x vjk Gk
O
v V
(11)

Amount transferred in outbound vehicle should be less than equal to the milk picked up from inbound
nodes

  wV vV
i
svw  Di  0  i N I
(12)

Amount transferred in outbound vehicle should be greater than equal to demand at plants.

 iN I
ciw  1 w V
(13)

Outbound vehicle visited from to milk plants

(Does it mean only one milk plant is assigned to, but how can be less than one (as its summation of
binary variables))

Again this constraint is for w  V (for all vehicles not milk plants). A vehicle may or may not be
used. That’s why it is less than 1.

If you don’t put this constraint CPLEX will send the same vehicle multiple times.
 vF
i
svw  ciwQ w  w V , i  N I
(14)

Amount transferred from inbound to outbound should be less than equal to capacity of outbound
vehicles travel to plants

LHS = sum of all milk transported by vehicle w


RHS = capacity.
Above constraint is also an IF_ELSE constraint(but simple one).

When
ciw =1, constraint becomes

 vF
i
svw  Qw  w V , i  N I

When
ciw =0, constraint becomes

 vF
i
svw 0  w V , i  N I
Thus, Contraint 14 – The total milk transported by vehicle v is less than capacity of vehicle.

 iN I
i
svw  z wvQ v v, w V
(15)

(Is here similar meaning??) Only new variable z is to represent whether transfer takes place or not

DIFFERENCE BETWEEN CONSTRAINTS 14 and 15:

Vehicle ‘v’ brings milk from farmers to depot.

Vehicle ‘w’ takes the milk brought by ‘v’ to the milk plants.

So if there is transfer of milk between vehicle v and w, they will have the same amount of milk.

zwv =1, if all milk from v is transferred to w, then

 iN I
i
svw  Qv

zwv =0, if all milk from v is not transferred to w, then constraint becomes

 iN I
i
svw 0
akv  a vj  T jk  ( x vjk  1) M  k  N B , j  N A, v  V
(16)

Not getting

SIMILAR TO Equation 8.

Suppose vehicle reaches node j at time a vj .

Now from j it goes to node k. Let travel time for going from j to k = T jk .

So arrival time at k is

akv  a vj  T jk

But it is true only if we go to node k after j immediately, So we introduce, if-else using (Xjk - 1)*M,

Where M is a large number.

If we go from j to k,

x vjk =1  ( x vjk - 1)*M = (1-1)*M = 0

So the constraint will become:

akv  a vj  T jk  k  N B , j  N A,v  V

If we do not go from j to k,

x vjk =0  (0 - 1)*M = (0-1)*M = -M

So the constraint will become:

akv  a vj  T jk  M  k  N B , j  N A, v  V

As, M is a large number,

a vj  T jk  M
will become negative.

(a vk > -ve number) is a useless constraint as it is a +ve integer variable. So this will not affect the
problem.

v
So, the constraint remains active if x jk is 1 or else becomes inactive if it is 0.
E j  a vj  L j j  N , v  V
(17)

Arrival time of inbound vehicle should be in between earliest and latest time.

Eio  biw  Loi j  N I , w  V


(18)

Arrival time of inbound vehicle should be in between earliest and latest time.

17 and 18 are time limit constraints for farmers and milk plants.

Vehicle should reach each farmer and plant within a time limit.

 jN C
x vjO  o v v  V
(19)

Variable representing visit from ECF to depot should be equal to variable representing whether
vehicle visits ECF.

19 is a constraint used to determine if vehicle goes to ECF or not.

If vehicle goes to ECF, Ov =1

If vehicle does not go to ECF, Ov =0

This is done by summing all


 jN C
x vjO
.

If
 jN C
x vjO
is = 1 then vehicle goes to depot from ECF. So Ov =1

If
 jN C
x vjO
is = 0 then vehicle goes to depot without going to ECF. So Ov =0

.
u v  ( x vjO  1) M  a vj  T jO (1  o v ) j  N B ,v V
(20)

Not getting

Again an IF-ELSE Constraint:

CASE 1) x kjo =1 and Ov = 0

Suppose j is the last node visited, then the vehicle will go back to depot.

So x kjo =1

Then, constraint becomes

u v  a vj  T jO (1  o v ) j  N B ,v V

Now if Ov = 0 (ECF is not visited, as explained in constraint 19 ), then

u v  a vj  T jO j  N B ,v V

CASE 2) If one of the constraint is not true i.e x kjo=0 or Ov = 1

The value of –M and Tjo will make the constraint redundant/ useless as in Equation 8 or 16.
u v  a vj  ( xOj
v
 1) M  H j  N ,v V
(21)

Not getting

Another IF-ELSE constraint:

If vehicle starts at depot and goes first to node j. Then starting time of tour is a vj .

We want total time of tour to be less than maximum limit(H)

u v  a vj  H u v  a vj  H
So, which can be written as

But we want this constraint as true if and only if j is the starting node.

So,

u v  a vj  ( xOjv  1) M  H

v
Now if x oj =1, (i.e. vehicle v goes from depot to node j first )

u v  a vj  H

Otherwise

u v  a vj  (0  1) M  H

u v  a vj  M  H

u v  a vj  H  M

u v  a vj
Since M is a large number, will always be less than RHS.

The constraint will become redundant.


p v  a vj  TjO  ( x vjO  1)M j  N B ,v  V
(22)

Not getting

If vehicle goes from node j to depot O.

p v  a vj  TjO

That is the reaching time at depot = arrival time at + Travel time from j to O

But again we want this constraint to be active only if vehicle goes from node j to depot O.

( x vjO  1) M
So, we introduce

Again similar to previous constraint

( x vjO  1)
If , then

p v  a vj  TjO j  N B ,v  V

( x vjO  0)
If , then

p v  a vj  TjO  M

Since M is a very large number, RHS will become negative.

But pv is a positive value number, so the constraint will become redundant/ inactive.
biw  TOi  p v  ( z wv  1) M v, w  V , i  N I (23)

Not getting

Suppose, if vehicle v brings milk from farmers at time pv to the depot.

After that it is transferred to vehicle w and the vehicle reaches the plant i

Then, the time at which vehicle reaches plant i is given by

biw  p v  TOi

Again this constraint is true only if vehicle w and vehicle v transfer milk.

( z wv  1) M
So, we introduce,

If Zwv is 1 constraint is active.

If Zwv is 0 constraint is not active/ redundant.

biw  TOi  p w  ( z wv  1) M v, w  V , i  N I (24)

Not getting

Similar to previous constraint. But there is some mistake in this constraint. So, I will check and let
you know.
x vjk  {0,1} v  V , j, k  N A
(25)

i
svw 0 v, w  V ,i  N I (26)

y vj , a vj  0 j  N , v V
(27)

biw  0 i  N I , w  V (28)

uv , pv  0 v  V (29)

pw  0 w V (30)

zwv  {0,1} v, w  V (31)

ciw {0,1} i  N I , w  V (32)

o v  {0,1} v  V (33)

You might also like