• No results found

CHAPTER 5 ARTICLE 2 : VEHICLE ROUTING PROBLEMS WITH SYNCHRONI-

5.3 Two-stage stochastic programming model

5.3.2 Second-stage model

To formulate the second-stage model, we use the following variables, sets, and parameters.

Variables:

urijtω : 1 if a type r vehicle starts serving customer i at time slot t immediately before serving customer j in scenario ω ; 0 otherwise.

vitω : 1 if the service to customer i starts at time slot t in scenario ω ; 0 otherwise. wrω : The total waiting time of all type r vehicles in scenario ω.

Parameters:

L : The length of the normal working hours for which no overtime cost is considered. In

our model, we consider this parameter in terms of time slots length. We also note that L ≤ |T | holds as set T defined in Section 3.1 includes some additional time slots for overtime periods.

ei : The earliest start time in the time window of customer i. li : The latest start time in the time window of customer i.

sriω : The duration of the service provided by a type r vehicle to customer i in scenario ω. trijω : The travel time of a type r vehicle from customer i to a customer j in scenario ω. coritω : The overtime cost of a type r vehicle if it starts serving customer i at time slot t

in scenario ω and then immediately returns to the depot. Superscript o stands for “overtime”. We compute it by co

ritω = c

0

overtime× max{t + sriω + tri0ω− L, 0} where c0overtime is the overtime cost for a single time slot beyond the session length L.

cd

it : The delay cost of serving customer i when the service to the customer starts at time

slot t. Superscript d stands for “delay”. We compute it by cd

it = c0delay× max{t − li, 0}

cw

r : The waiting cost of a type r vehicle for a single time slot. Superscript w stands for

“waiting”.

fritω : The time slot at which a type r vehicle arrives in the depot immediately after starting to serve customer i at time slot t in scenario ω. We have fritω = t + sriω+ tri0ω. grijtω : The amount of time in scenario ω that a type r vehicle is involved in serving customer

i and also in travelling to the next customer j. We have by grijtω = sriω + trijω. ξ(ω) : The vector of uncertain parameters including travel and service times in scenario ω. Sets:

T : The set of time slots at which the service to customer i may start in scenario ω. This

set is inclusive but not necessarily exclusive (Later in this section, we discuss how to compute this set).

Trijω : The set of times slots at which a type r vehicle may start serving customer i im-

mediately before customer j in scenario ω. This set is inclusive, but not necessarily exclusive (Later in this section, we discuss how to compute this set).

Ω : The set of random scenarios.

An assumption in modeling the second stage is that travel and service times are multiples of time slot length. This assumption may require small modifications in real data. However, we believe that the effect of this modification is negligible since the length of time slots that we consider in our applications is very small (5 minutes) compared to the length of the scheduling horizon (11 hours). In the previous notation, we suppose that sriω, trijω, and also all elements

of ξ(ω) are given in terms of time slot length. Using the given notation, we formulate the second-stage model for scenario ω ∈ Ω as follows.

(S2) Q(x, y, ξ(ω)) = min u,v,w     X r∈R X i∈Ir: (i,0)∈Ar X t∈Tri0tω coritωuri0tω+ X i∈I X t∈Tiω cditvitω+ X r∈R cwrwrω     (5.10) Subject to : X t∈Trijω

urijtω= xrij r ∈ R, i, j ∈ (Ir∪ {0}) : (i, j) ∈ Ar(5.11)

X i∈(Ir∪{0}): (i,j)∈Ar X t0∈Trijω: t0+s riω+trijω≤t urijt0ω ≥ X k∈(Ir∪{0}): (j,k)∈Ar& t∈Trjkω urjktω r ∈ R, j ∈ Ir, t ∈ Tjω (5.12) X j∈(Ir∪{0}):

(i,j)∈Ar& t0∈Trijω

wrω = X i∈Ir: (i,0)∈Ar X t∈Tri0ω frijωuri0tω − X i,j∈Ir∪{0}: (i,j)∈Ar grijωxrij − X i∈Ir X t∈Tridep tyrit r ∈ R (5.14)

ur0itω = yrit r ∈ R, i ∈ Ir : (0, i) ∈ Ar, t ∈ Tridep (5.15)

urijtω ∈ {0, 1} r ∈ R, i, j ∈ (Ir∪ {0}) : (i, j) ∈ Ar(5.16)

t ∈ Trijω

vitω ∈ {0, 1} i ∈ I, t ∈ Tiω (5.17)

Objective function (5.10) represents the second-stage cost in scenario ω and includes over- time, delay, and waiting costs. The second-stage cost Q(x, y) in objective function (5.1) is calculated by Q(x, y) = Eω∈Ω[Q(x, y, ξ(ω))] where Eω∈Ω[.] computes the expected value over

scenarios ω ∈ Ω. Constraint (5.11) links first- and second-stage decision variables xrij and urijtω. Constraint (5.12) is the no-overlap constraint and indicates that if the service to custo-

mer j starts at time slot t, then the service to customer i visited immediately before customer

j by the same vehicle must have started by time slot t − sriω − trijω. Constraint (5.13) is

the synchronization constraint and ensures that required vehicles start serving the custo- mer at the same time. Constraint (5.14) computes total waiting times for different types of vehicles. In this constraint, P

i∈Ir:(i,0)∈Ar P

t∈Tri0ω

frijωuri0tω computes the total tour comple-

tion times, P

i,j∈Ir∪{0}:(i,j)∈Ar

grijωxrij computes the sum of total service and travel times, and

P

i∈Ir P

t∈Tridep

tyrit calculates the total departure times. We used auxiliary variables wrω for the

ease of presenting objective function (5.10). We can simply substitute wrω in objective func-

tion (5.10). In this case, it would be better to transfer the expected value of the second and the third terms on the right-hand side of constraint (5.14) to objective function (5.1) in the first-stage model. Constraint (5.15) introduces the departure times from the depot to the second-stage model. Constraints (5.16) and (5.17) represent integrality constraints for second-stage variables.

In the following we aim to explain how to compute sets T and Trijω, but before that we

need introduce two new parameter SRTrijtω and n-SRTrijtω by which we define these sets. SRTrijtω : The shortest amount of time from the beginning of time slot t that a type r

vehicle starts serving customer i until it reaches customer j in scenario ω. By reaching customer j we mean that the vehicle arrives the customer’s location and if needed it waits until the customer’s time window opens. As we suppose that the triangle inequality does not necessarily hold, the vehicle may visit

some other customers between customers i and j.

n-SRTrijtω : It is defined the same as SRTrijtω with a additional condition that the path

from customer i to customer j includes at most n arcs.

Algorithm 5.1 provides the pseudo code of the algorithm that we propose to compute SRTrijtω

for a fixed customer i, a fixed time slot t and all customers j ∈ I\{i}. This algorithm is the extension of Bellman-Ford algorithm where earliest start time constraints and service times are also considered. The following lemmas and Theorem 5.1 proves the correctness of Algorithm 5.1.

L

EMMA 5.1 In Algorithm 5.1, if dj < ∞, it is equal to the amount of time that it takes for a type r vehicle departing customer i at time slot t, until it reaches customer j and completes its service. The vehicle may visit and serve some other customers between customers i and j.

P

ROOF. Appendix B.1. This lemma is used in the proof of Theorem 5.1. 

Algorithm 5.1. Shortest path algorithm with the earliest start time constraints and service times

1: Set di = 0 and dj = ∞ for j ∈ I\{i}

2: for (n=1 to |I| − 1) do

3: for (each edge (j, k) in the set of arcs) do 4: if (dk> max{dj+ trjkω, ek− t} + srkω) then

5: dk = max{dj+ trjkω, ek− t} + srkω)

6: end if 7: end for 8: end for

9: Set SRTrijtω = dj− srjω for j ∈ I\{i}

L

EMMA 5.2 After performing the n-th iteration in the main loop of Algorithm 5.1, dj is equal to n-SRTrijtω.

P

ROOF. Appendix B.2. This lemma is used in the proof of Theorem 5.1. 

T

HEOREM 5.1 Algorithm 5.1 computes correct values of SRTrijtω.

P

ROOF. Appendix B.3. 

In order to calculate sets Trijω, T and Tridep, we also need to define a new time set Trijω0 as

T0

rijω : This time set is defined the same as Trijω. The only difference is that Trijω is a

refined version of Trijω0 and we have Trijω ⊆ Trijω0 . We compute T

0

rijω by T

0

rijω =

{t|t ≥ max{ei, SRTr0i0ω} & max{ej, t + sriω+ trijω} + srjω+ SRTrj0tω ≤ |T |} where

t= max{ej, t + sriω+ trijω} + srjω.

Based on Trijω0 and SRTrijtω we compute sets Trijω, T and T dep ri as follows. T = ∩ r∈Ri " ∪ j∈(Ir∪{0}\i T0 rijω # (5.18)

Trijω = T∩ Trijω0 (5.19)

Tridep = {t ∈ T |t + max

ω∈Ω{tr0iω+ sriω+ SRTri0(t+tr0itω+sriω)ω} ≤ |T |} (5.20)