Drivers Planning
Drivers Planning
Therefore, we can expect a biker to fulfill up to 4 delivery requests within one hour of his schedule.
Sets
I Set of possible shifts
J Set of hours
Parameters
𝑎𝑖𝑗 Presentation planning of hired biker 𝑖 ∈ 𝐼 at hour 𝑗 ∈ 𝐽
𝑑𝑗 demand for hour 𝑗 ∈ 𝐽
𝑋𝑖 ≤ 𝑀 𝑌𝑖 ∀𝑖 ∈ 𝐼 (2)
The objective function (1) tends to minimize the cost of hiring bikers and penalty of
extra or less presenting the bikers. Relations (2) determine the upper bound of hiring
bikers from kind 𝑖 ∈ 𝐼 . Relations (3) demonstrate the value of less or extra presenting
in each hour 𝑗 ∈ 𝐽 .
1
Sample date
Our demand in each hour is described as below:
𝑗9 𝑗10 𝑗11 𝑗12 𝑗13 𝑗14 𝑗15 𝑗16 𝑗17 𝑗18 𝑗19 𝑗20 𝑗21
20 30 40 20 10 30 5 15 5 0 0 0 0
Moreover, the presentation planning of paid bikers is shown in the below table.
shift 𝑗9 𝑗10 𝑗11 𝑗12 𝑗13 𝑗14 𝑗15 𝑗16 𝑗17 𝑗18 𝑗19 𝑗20 𝑗21
𝑖1 1 1 1 1 1 1 1 1 0 0 0 0 0
𝑖2 0 0 0 0 0 1 1 1 1 1 1 1 1
𝑖3 1 1 1 1 1 1 1 1 1 1 1 1 1
𝑖4 1 1 1 1 0 0 0 0 0 0 0 0 0
𝑖5 0 0 1 1 1 1 0 0 0 1 1 1 1
𝑖6 0 0 0 0 0 0 0 0 0 1 1 1 1
𝑖7 0 0 1 1 1 1 1 1 1 1 1 1 0
It says if you hire a biker from shift 𝑖1 ,he must be present for these hours
(𝑗9 , 𝑗10 , … , 𝑗16 )
Code
SETS
i /i1*i7/ ,
j /j9,j10*j21/ ;
table a(i,j)
j9 j10 j11 j12 j13 j14 j15 j16 j17 j18 j19 j20 j21
i1 1 1 1 1 1 1 1 1 0 0 0 0 0
i2 0 0 0 0 0 1 1 1 1 1 1 1 1
i3 1 1 1 1 1 1 1 1 1 1 1 1 1
i4 1 1 1 1 0 0 0 0 0 0 0 0 0
i5 0 0 1 1 1 1 0 0 0 1 1 1 1
i6 0 0 0 0 0 0 0 0 0 1 1 1 1
i7 0 0 1 1 1 1 1 1 1 1 1 1 0
2
;
PARAMETER
d(j) /j9 20,j10 30,j11 40,j12 20,j13 10,j14 30,j15 5,j16 15,j17 5,j18 0,j19 0,j20 0,j21 0/ ;
binary variable
y(i) ;
free variable
z;
integer variable
x(i) ;
positive variable
inv(j) , b(j), axilary(i,j) ;
equations
of
c1
c2
;
3
model ali /all/;
option reslim=3000000000000000 ;
option optcr=0;
option threads=0;
*option minlp = bonmin;
option mip = cplex ;