• No results found

Optimizing Taxi Fleet Management

N/A
N/A
Protected

Academic year: 2021

Share "Optimizing Taxi Fleet Management"

Copied!
44
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

MSc Stochastics and Financial Mathematics

Master Thesis

O

p

t

i

m

i

z

i

n

g

T

a

x

i

F

l

e

e

t

M

a

n

a

g

e

m

e

n

t

Author: Supervisor:

Sjoerd Janse

Prof. dr. Sandjai Bhulai

Examination date: Second examiner:

4 September 2018

Dr. Jan-Pieter Dorsman

Korteweg-de Vries institute for mathematics

(2)

Abstract

Optimizing taxi fleet management has already been done via Markov decision processes. Recently, there has also been a taxi fleet management optimization using path covers in graph theory. This thesis will elaborate on both methods and is able to bring these solutions close to each other. First, an introduction in graph and flow theory is given. Second, we will elaborate on the graph interpretation which optimizes this problem. Third, the solution regarding the Markov decision theory is explained. Surprisingly, the two methods, which take place in two different fields, seem to both have a solution in the graph theory.

Title: Optimizing Taxi Fleet Management

Author: Sjoerd Janse, sjoerd.janse@gmail.com, 10246134 Supervisor: Prof. dr. Sandjai Bhulai

Second examiner: Dr. Jan-Pieter Dorsman Examination date: September 4, 2018

Korteweg-de Vries Institute for Mathematics University of Amsterdam

Science Park 105–107, 1098 XG Amsterdam http://kdvi.uva.nl

Department of Mathematics Vrije Universiteit Amsterdam

De Boelelaan 1081a, 1081 HV Amsterdam https://www.math.vu.nl

(3)

Acknowledgements I would like to thank my supervisor Sandjai Bhulai for his enthusiastic supervision during this project. We have had really nice brainstorm sessions about the problems that I encountered during my thesis. I always felt welcome to also ask the simple questions, what made it easy to gain an intuition for every subject.

Furthermore, I would like to thank my girlfriend Lobke for always listening to my ideas of formulations in my thesis, and for motivating me when I got stuck; my brother Arnout who, although he is not very familiar with the mathematics I do, still was able to give me advice for my thesis; my fellow mathematicians who were there to help me to state the correct formulations, and to help me drawing the pictures; and Jan-Pieter Dorsman for being my second reader.

(4)

Contents

1 Introduction 6 1.1 Motivation . . . 6 1.2 Background . . . 6 1.3 Thesis outline . . . 7 2 Definitions 9 2.1 Graph . . . 9 2.2 Paths . . . 10 2.3 Flow networks . . . 12 2.4 Maximum flow . . . 12

2.4.1 Finding the maximum flow . . . 12

2.5 Maximum reward flow . . . 13

2.5.1 Finding the maximum reward flow . . . 15

3 Minimizing the taxi fleet 16 3.1 Problem formulation . . . 16

3.2 Vehicle-shareability network . . . 17

3.3 Matching . . . 18

3.3.1 Finding a maximum matching . . . 20

3.4 Minimum path cover . . . 20

3.4.1 Bounding the minimum number of paths . . . 21

3.4.2 Finding a minimum path cover . . . 21

3.5 Online matching taxis and trips . . . 25

3.5.1 On-the-fly . . . 25

3.5.2 Batch . . . 25

3.6 Summary . . . 27

4 Optimizing the taxi dispatching 28 4.1 Preliminaries . . . 28

4.2 Optimizing sets . . . 30

4.3 Tractability of the value function . . . 31

4.4 Update scheme . . . 32

4.5 Linear value function approximations . . . 32

4.5.1 Subproblem solution for a linear approximation . . . 33

4.5.2 Updating the linear approximation . . . 34

4.6 Piecewise linear value function approximations . . . 34

(5)

4.6.2 Updating the piecewise linear approximation . . . 35

4.7 Hybrid value functions approximation . . . 36

4.7.1 Subproblem solution for a hybrid approximation . . . 37

4.7.2 Updating the hybrid approximation . . . 38

4.8 Summary . . . 38 5 Conclusion 39 5.1 Extensions . . . 39 5.2 Numerical experiments . . . 39 5.3 Ambition . . . 40 Bibliography 42

(6)

1

Introduction

1.1

Motivation

Many modern cities have a big infrastructure with complex transportation networks using this infrastructure intensively. Sometimes the infrastructure cannot process all the vehicles using it, causing traffic jams which compel users to wait or to decide to take a detour to avoid the busy crossings. With the world population still growing [11], we will encounter only more pressure on the infrastructure causing even more jammed roads if we will not change anything.

There are mainly two ways of solving this congestion problem. One method is to enlarge the infrastruc-ture, thus constructing more roads. Most of the cities, however, are already overpopulated and do not have any room for more roads. Therefore, the second, and more desirable, method is to decrease the number of vehicles driving on it.

Taxi services play an important role in these public transportation networks and, therefore, contribute to the congestions in these cities. With nowadays technology we have companies as Uber[14], Lyft[9] and DiDi [5] which overlook all the taxi-trip requests coming on via their app and, hence, are able to optimize their taxi fleet management. Consequently, optimizing the fleet management of big taxi companies will contribute to decreasing the pressure on the infrastructure.

Ratti [7] nicely points out the opportunity to use fleet management as a solution: “This shows that to-morrow’s urban problems regarding mobility can be tackled not necessarily with more physical infrastructure but with more intelligence, or in other words: with more silicon and less asphalt.”, and that is exactly what this thesis is about.

1.2

Background

Optimizing taxi fleet management can be done on different levels in the fleet, which will be shortly introduced here. Although we do not go into detail, terms will be used that are introduced in Chapter 2.

Individual optimization Rong, Zhou, Yang, Shafiq, and Liu[10] were motivated to develop the urban economy and to lower the gas emission and did set up a model to improve the business efficiency of taxi drivers. Based on the taxi drivers income, they divided them into three groups: the best 10%, the worst 10%, and the average drivers. For every single taxi driver they constructed a Markov decision process where each decision refers in which direction the taxi could go. They were able to construct a value function and therefore could find the optimizing policy indicating for every intersection in Manhatten, New York, the best direction that a taxi should go to optimize his reward.

(7)

Later, Li, Bhulai, and van Essen[8] simplified the model to make it faster. They still were able to find an optimal driving strategy for a taxi. The big withdrawal, however, is that Rong et al. and Li et al. needed to restrict the situation to only one taxi. This is due to the fact that otherwise the state space of the Markov process could grow intractably large. Although one taxi reduces the gas emission a lot, one taxi cannot serve more than 0.01% of the trip request and, hence, does not optimize the total reward of a taxi fleet. Therefore it is desirable to have a scalable model.

Overall optimization To be able to not make an individual optimization, but scale it to an overall optimization, Topaloglu and Powell[13] come up with a whole other Markov decision process. Although the optimization is scaled to the whole fleet, the value function has become too hard to calculate explicitly. Therefore, we will in Chapter 4 explain how we find an approximating value function, together with a way how to update this approximation. This gives a solution to the Markov process with which we are able to assign numbers of taxis to specific intersections.

Translation Before solving the approximation done by Topaloglu and Powell, we will introduce graph and network-flow theory in Chapter 2. Another approach to optimize the dispatching of taxis, done by Vazifeh, Santi, Resta, Strogatz, and Ratti[15], turns out to remain much closer to the graph setting.

Assignment optimization The method constructed by Vazifeh et al. does not use any of the Markov processes defined before, but stays really close to the network-flow theory. Instead of attaching to every location a number of taxis, it specifies how a taxi should drive and which trip request it should operate.

We are able to make an ordering by enumerating the solutions as follows.

(1) Overall optimization: solve in combination with the demand of how many cars you need at every place and with this information you say how many taxis will have to drive between different places to satisfy this demand.[13]

(2) Assignment optimization: optimize the number of taxis to serve all the requests by finding an optimal order of trips for every taxi.[15]

(3) Individual optimization: determine for a taxi at every intersection the optimal direction to go to, to maximize his reward. [8] [10]

It can be ordered from a global to an individual optimization.

global −−−−−−−−−−−−−−−−−−−−→(1) (2) (3) individual

1.3

Thesis outline

I shortly described three methods to tackle the congestion problem mentioned in the beginning by trying to solve three different taxi problems. The beginning of Chapter 2 will be a basic introduction to the concepts of graph theory. Next to some of the terms, we will also state some conventions for the rest of the thesis. In Section 2.3 we will formally define the flow on a graph, next, in Sections 2.4 and 2.5 we will introduce and solve two flow problems which both will turn out to be very useful.

In Chapter 3 we will discuss the article by Vazifeh et al.[15]. First we will introduce definitions to be able to formulate the problem. In Section 3.2 we translate the given problem into a graph problem and explain how a solution in graph theory will give a solution to our fleet management optimization. Then, we will solve state and solve the maximum matching problem, which enables us to find the needed minimum path cover in graph theory.

(8)

Next, we will elaborate on the article written by Topalogly and Powel [13]. With the knowledge of Chapter 2 we will in Chapter 4 fully explain the approach using Markov decision processes. We will again start with defining notations to construct sets and be able to set up a Markov decision process. Then we will define an approximating function for the value function and explain briefly how we would like to update this approximation. Next we will introduce and update in Section 4.5 a linear value function approximation, in Section 4.6 a piecewise linear value function approximation and in Section 4.7 a hybrid value function approximation.

In the last chapter, we will summarize the advantages and disadvantages of the problem solutions dis-cussed in Chapter 3 and Chapter 4.

(9)

2

Definitions

To be able to introduce the congestion problem introduced in Chapter 1 mathematically, and to be able to write down the optimization problems properly, we introduce in this chapter the concepts of graph and network-flow theory. Some extensions and additions regarding the definitions are written in the chapter itself where they are needed.

If not else stated, we are dealing with finite sets which can be ordered. For a set X with m elements we, therefore, write

X = {x1, . . . , xm}.

2.1

Graph

We will start with introducing a graph and some definitions regarding graphs.

Definition 2.1. A graph G = (N, E) is a set of nodes N and a set of edges E between the nodes n ∈ N . A graph is finite if both its node set and its edge set are finite. As mentioned in the introduction of this chapter, we are only dealing with finite graphs, to which we refer as graphs. We therefore can write

N = {n1, . . . , nl} and E = {e1= (n1, k1), . . . , em= (nm, km)}.

We call two nodes n, k ∈ N connected if there is an edge between them, thus if (n, k) ∈ E or (k, n) ∈ E. The points n and k are called the endpoints of edge e ∈ E. An edge is a loop if its endpoints are the same and two or more edges are called parallel if the endpoints are the same.

An example of a graph G = (N, E) = ({n, m, l, k, j}, {a, b, c, d, e, f }) is shown in Figure 2.1a. Some graphs with specific properties which we will use extensively are introduced now.

n m l k j a c d e f b

(a) A graph G with a loop b and parallel edges d and e

n m l k a c d (b) A simple subgraph G0of G

(10)

Definition 2.2. A graph G0= (N0, E0) is called a subgraph of G = (N, E) if N0⊂ N and E0⊂ E. We call a

graph simple if it does not contain any loops and no two nodes have more than one edge. A bipartite graph is a graph G = (N, E) where N can be separated into two disjoint subsets N1, N2, such that every edge has

one end node in N1 and one in N2.

As we are only dealing with finite, simple graphs, we will refer to this with just the term graph. An example of a simple subgraph G0 = (N0, E0) = ({n, m, l, k}, {a, c, d}) of graph G is shown in Figure 2.1b. Note that G0 is a bipartite graph with N1= {n, l} and N2= {m, k}.

Remark 2.3. As every edge has two endpoints in N we have E ⊂ N × N . It depends on the situation, but we will arbitrarily switch between e and (n, k) for notation of edges. If not stated otherwise ei and (ni, ki)

will represent the same edge.

As we will often encounter graphs where the edges (k, n) and (n, k) represent two other edges, we introduce the directed graph.

Definition 2.4. A directed graph G = (N, E) is a graph were the edges in E have an orientation. Every edge e = (n, k) ∈ E is an ordered pair from N × N and we call n and k the head and tail of e respectively. A directed graph which does not contain loops and parallel edges is called a strict directed graph.

To extend the convention made in Definition 2.1, unless stated otherwise, we will refer with graph to a finite simple directed graph. A graph G which is not directed is therefore explicitly called an undirected graph. In line with Remark 2.3 we will denote for a directed edge ei the head by ni and the tail by ki.

Remark 2.5. You could represent a graph also as G = (N, E, φ) with E a set of edges and φ : E → N × N assigning a direction to every edge. Thus φ(e) = (n, k) gives the edge e a direction from n to k. Often, we will state a directed graph as G = (N, E) with E only directed edges.

On a directed graph we introduce some notation regarding the nodes.

Definition 2.6. For nodes n in a graph, the outdegree is the total outgoing edges, denoted by dout(n) and

the indegree is the total incoming edges, denoted by din(n). So

dout(n) = #{k ∈ N |(n, k) ∈ E};

din(n) = #{k ∈ N |(k, n) ∈ E}.

If we have in a graph G nodes s, t which satisfy

dout(s) > 0 = dout(t) and din(s) = 0 < dout(t),

we call s a source (node) and t a tail (node). We let Dout = {dout(n)|n ∈ N } and Din= {din(n)|n ∈ N } be

the sequences of the outdegrees and indegrees for all nodes respectively.

An example of a graph G with source n and tail j is shown in Figure 2.2a, with Dout= (3, 1, 2, 1, 0) and

Din= (0, 1, 2, 1, 3).

2.2

Paths

An interesting subgraph of a graph G is the one with out- and indegree sequence Dout = (1, . . . , 1, 0) and

Din= (0, 1, 1, . . . , 1), thus having one source and one tail node and every other node being one end and one

(11)

n m l k j a b c d e f g

(a) A graph G with a loop b and parallel edges d and e

n m l k j a b c d e f g p1 p2 p3 p01 p02 p03

(b) The graph G with two paths P and P0

Figure 2.2: A (simple finite directed) graph G

Definition 2.7. In a graph G = (N, E), a path is a sequence of nodes with each two consecutive nodes connected via an edge. The length of a path, denoted |P |, is the the number of edges and the node set of P , denoted N (P ), is the subset of nodes in N that belongs to P .

In this thesis we will mainly represent a path P by the node set N (P ). You could also represent the path by the edges which connect the nodes, or by both the edges and the nodes. Thus if we write for the edges ei= (ni−1, ni), we have the following representations of the same path:

P = {n0, n1, . . . , nm} (as a subset of N )

= {e1, . . . , em} (as a subset of E)

= {n0, e1, n1, e2, . . . , em, nm}. (as a subset of N × E)

The length of P equals m and N (P ) = {n0, n1, . . . , nm}. A path in a graph G is an example of a simple

subgraph G0 ⊂ G, two paths P = {p1, p2, p3} and P0 = {p01, p02, p03}, both with length three, are shown in

Figure 2.2b. As we will deal mainly with a specific path, we will introduce it, together with a graph that will naturally arise with it.

Definition 2.8. A cycle is a path from a node n to itself, a graph with a cycle is called cyclic. If a graph does not contain any cycle it is called acyclic and if a path does not contain a cycle it is called a simple path. Remark 2.9. Note that we introduced in Definition 2.2 a simple graph. The notion of simple mean two different things. A graph is already simple if it does not contain a loop, where a path is only simple if it does not contain any cycle at all. Therefore the distinction between a path and a simple path is more similar to that of a graph and an acyclic graph.

In this thesis, we will only use simple paths, where we will refer to just as a path. As paths are subgraphs of a graph G, it is interesting to see if we can find a partition of a graph in subgraphs of G. That is, can we find a set of subgraphs G1, . . . , Gmsuch that ∪mi=1Gi= G. The trivial solution is to take G1 = G ⊂ G and

Gi= ∅ for i = 2, . . . , m. Therefore, we will be interested in obtaining a partition of the node set N of G, by

finding subgraphs P1, . . . , Pm of G which only can be paths. This will also contribute to a solution of the

problem stated by Vazifeh et al. in [15], what will be elaborated in Section 3.4.

Definition 2.10. Given a directed graph G, a path cover for G is a collection P = {P1, . . . , Pm} of paths

such that

∪m

i=1N (Pi) = N.

The number of paths in a path cover is denoted by |P|. If we in addition have

N (Pi) ∩ N (Pj) = ∅ for all i 6= j ∈ {1, 2, . . . , m},

we call P a node-disjoint path cover. We will say that P covers G, or G is covered by P.

We will only be interested in node-disjoint path covers, whereto we refer with path cover. An optimization problem regarding path covers is established in Section 3.2, where its solution is given in Section 3.4.

(12)

2.3

Flow networks

After the introduction of graphs and paths, we will now introduce some functions defined on graphs. This will turn out to be very useful, as you then can optimize on a graph with respect to these functions. We first consider graphs G with a source node s and a tail node t.

Definition 2.11. Given a graph G = (N, E) we define the capacity function as the function c : E → R≥0

that assigns to every edge e = (n, k) ∈ E a maximum capacity c(e). A graph with a capacity function is said to be a network G.

We will also say that G induces G, or that G is induced by G. Without raising any ambiguity we will interchangeably refer with G to the graph that induces a network, and to the network itself. To define the next function, we set, without loss of generality, the capacity of an edge (n, k) ∈ N × N \ E to be 0.

Definition 2.12. Given a network G with capacity function c we define the flow function as the function f : N × N → R; (n, k) 7→ f (n, k) that determines how much flow is send over edge (n, k) and that satisfies:

The capacity constraint f (n, k) ≤ c(n, k) ∀(n, k) ∈ N × N (2.1) The skew symmetry f (n, k) = −f (k, n) ∀(n, k) ∈ N × N (2.2) The flow conservation X

k∈N f (n, k) = X k∈N f (k, n) ∀n ∈ N \ {s, t}. (2.3) The sums P (n,k)∈Ef (n, k) and P

(k,n)∈Ef (k, n) is referred to as the (total) outgoing flow out a node n

and the (total) incoming flow into a node n respectively. We define the flow value |f | of f to be the total outgoing flow out node s.

2.4

Maximum flow

Later, we will convert our problem on optimizing the taxi dispatching to a more known problem. First, we will state for any graph an interesting problem.

Problem 2.13. (Maximum flow) Given a directed graph G = (N, E) with source node s and a tail node t, capacity function c : E → R≥0, find the maximal flow from s to t, the so called s, t-flow. This translates to

max ( X n∈N f (s, n) f is a flow ) = maxn|f | f satisfies (2.1), (2.2) and (2.3) o .

Remark 2.14. By the flow conservation (2.3) we have equality between the outgoing flow out of s and the incoming flow into t.

|f |= X n∈N f (s, n) = X n∈N f (n, s) = X k∈N f (k, t).

2.4.1

Finding the maximum flow

Before we are able to maximize a flow, we present some more definitions.

Definition 2.15. For a network G = (N, E) with flow f we define for every edge the residual capacity with respect to f as the extra flow that can be send through this edge without exceeding the capacity, denoted by

(13)

The residual capacity of a path P = {e1, . . . , ep} is the maximum residual capacity that can be send through

P without exceeding any of the capacities c(ei), i = 1, . . . , p

γf(P ) = max{γ|f (e) + γ ≤ c(e) ∀e ∈ P }

= min{γf(e)|e ∈ P }.

With this residual flow we can introduce more terminology and construct interesting subgraphs.

Definition 2.16. An edge e is called a residual edge if γf(e) > 0 and saturated else. The residual graph

Gf = (N, Ef) is the subgraph of G with Ef only containing residual edges, Ef = {e ∈ E|γf(e) > 0}. An

f -augmenting path is then a simple path in a residual graph Gf.

A saturated edge e has residual capacity γf(e) = 0 and, therefore, the flow f is already maximal in this

edge. If we have a path P with γf(P ) > 0, we can send exactly γf(P ) extra flow through this path. Thus we

have a path with only residual edges, and therefore we are able to increase the flow f over P . That is why γf(P ) > 0 implies that P is an f -augmenting path. This gives rise to the definition about how we change

the flow.

Definition 2.17. For a flow f and an augmenting path P ⊂ Gf we can augment flow f along path P to a

new flow f0 by:

f0(n, k) =      f (n, k) + γf(P ) if (n, k) ∈ P f (n, k) − γf(P ) if (n, k) ∈ P f (n, k) else. (2.4)

Finding a maximum flow, so solving Problem 2.13, is indeed, for example, done by augmenting an initial flow. It is known as the Ford-Fulkerson algorithm.

Algorithm 1: The Ford-Fulkerson algorithm

Input: Directed graph G = (N, E), capacity function c : E → R≥0, source and tail nodes s, t ∈ N .

Output: Maximum flow f : E → R

1 Initialize: Set flow f such that f (e) = 0 ∀e ∈ E; 2 while There exists an augmenting path P in Gf do 3 find the augmenting path P ;

4 augment flow f along path P 5 end

6 return f

This algorithm solves the maximum flow problem, as stated in [12], Theorem 5.1.

Theorem 2.18. The Ford-Fulkerson algorithm solves the max-flow problem with integer capacities in time asymptotically less than |E|·|f∗|, where |E| is the number of edges and |f∗| is the flow value of a maximal flow f∗.

Proof. For an analysis of the Ford-Fulkerson algorithm which provides the asymptotic bound, see paragraph 26.2 in Introduction to algorithms [4].

2.5

Maximum reward flow

To be able to handle another problem we will change the flow function defined on a graph in Definition 2.12, and we will introduce other functions which will induce the optimization problem where we are interested in. We drop the assumption made at the beginning of Section 2.4 that G has a source and a tail node.

(14)

Definition 2.19. For a graph G = (N, E) we define for edges e ∈ E the non negative flow function f : E → R≥0; e 7→ f (e) and the reward per flow unit, which is given by the reward function r : E → R; e 7→ r(e).

The reward of sending flow f (e) over edge e will then be f (e)r(e). For nodes we define the balance function b : N → R; n 7→ b(n) as the balance that a node needs to have.

b(n)      < 0 if n has a demand; > 0 if n has a supply; = 0 else .

The next remark link the non negative flow and the previous defined flow to each other.

Remark 2.20. In Definition 2.12 we defined the flow on a undirected graph as a function from the Cartesian product of the nodes to the reals. In Definition 2.19 we restricted f to be the function from the edge set of a directed graph to the non negative reals. Therefore, transforming an undirected graph into a directed one, will not conserve the skew symmetry (2.2) and the flow conservation (2.3). An analog of these constraints is constructed below. Let for a graph G0 = (N, E0) with a source and a tail node s, t respectively the flow f0: N × N → R be given as in Definition 2.12. Equation 2.3 states

0 = X k∈N f0(n, k) = X k∈N 1{f0(n,k)≥0}f0(n, k) +1{f0(n,k)<0}f0(n, k) = X k∈N 1{f0(n,k)≥0}f0(n, k) − X k∈N 1{f0(k,n)≥0}f0(k, n) (2.5)

has to hold for all n ∈ N \ {s, t}. Remember the notation mentioned in Remark 2.5, and let the set E be the set {φ(e)|e ∈ E0}. Now we define f : E → R≥0; e → f (e) with

f (n, k) = (

f0(n, k) if f0(n, k) ≥ 0 and φ(n, k) = (n, k); −f0(n, k) if f0(n, k) < 0 and φ(n, k) = (n, k).

Now, instead of having a balance in every node of zero, we change it for every node n to b(n). Equation (2.5) now transforms naturally into the flow balance constraint

X

(n,k)∈E

f (n, k) − X

(k,n)∈E

f (k, n) = b(n) ∀n ∈ N. (2.6)

Transforming a directed graph to an undirected one is only possible if we do not have two directed edges (n, k) and (k, n), as they will become a parallel edge in the undirected graph, causing a conflict with the assumption that the graph is simple. Let f : E → R≥0 be a non negative flow and b the balance function.

Define f0 : N × N → R; (n, k) 7→ f (n, k) with f0(n, k) =

(

f (n, k) if (n, k) ∈ E; −f (n, k) if (n, k) /∈ E.

The skew symmetry is satisfied by construction, and for the flow conservation it holds:

X k∈N f0(n, k) = X (n,k)∈E f0(n, k) + X (n,k) /∈E f0(n, k) = 0

(15)

Definition 2.21. If a flow f satisfies both the capacity constraint (2.1) and the flow balance constraint (2.6), we call f a feasible flow with respect to b. As it is often clear to which balance we refer, we omit “with respect to b" and just write that f is a feasible flow. If f is a feasible flow for a balance function b(n) = 0 ∀n ∈ N , we call f a circulation.

Instead of maximizing the flow in a graph we can now maximize the reward in a graph which is stated in the next problem.

Problem 2.22. The maximum reward flow problem for a network G = (V, E) with flow function f , capacity function c, balance function b and reward function r is defined as:

max ( X e∈E r(e)f (e) f is a feasible flow ) = max    X e∈E r(e)f (e) capacity constraints z }| {

0 ≤ f (e) ≤ c(e) ∀e ∈ E,

and

flow balance constraint

z }| { X (n,k)∈E f (n, k) − X (k,n)∈E f (k, n) = b(n) ∀n ∈ N      . (2.7)

2.5.1

Finding the maximum reward flow

Solving Problem 2.22 is equivalent to solving a very common problem. Therefore, we have to introduce next to the reward r a slightly different function.

Definition 2.23. For a graph G with capacity function, flow function and balance function, we define the cost per flow unit over an edge given by the cost function t : E → R; e 7→ t(e). The cost of sending flow f (e) over edge e will then be f (e)t(e).

Problem 2.24. The maximum reward flow problem for a graph G = (V, E) with flow function f , capacity function c, balance function b and cost function t is defined as:

min ( X e∈E f (e)t(e)

f (e) ≤ c(e) ∀e ∈ E and X

k∈N f (n, k) −X k∈N f (k, n) = b(n) ∀n ∈ N ) . (2.8)

Now we can state a really nice equivalence.

Theorem 2.25. The maximum reward flow problem is equivalent to the min cost flow problem.

Proof. As the flow function is defined to be positive, Problem 2.22 and Problem 2.24 have the same con-straints. It rests us to show that the arguments of the optimization are the same. Take the cost to be the negative reward, thus t(e) = −r(e) for all e ∈ E. Because the sum is finite and the flow over an edge is a real value we have:

X e∈E f (e)t(e) =X e∈E f (e)(−r(e)) = −X e∈E f (e)r(e).

Noticing that min{−x|x ∈ R≥0} = max{x|x ∈ R≥0} finishes the proof.

Now we can solve our maximum reward flow problem by finding a solution for the min cost flow problem. The latter one is a very famous problem and solved by many algorithms, see for three examples paragraphs 7.3, 7.4 and 7.5 of the lecture notes on Discrete Optimization [12].

(16)

3

Minimizing the taxi fleet

In this chapter, we focus on representing all the rides of taxis in a network, as suggested by Vazifeh et al.[15]. As mentioned in Section 1.2, Vazifeh et al. used a totally different approach than Rong et al. and Li et al. to find a solution to the optimization of taxi rides that would solve the congestion problem. They already changed the problem they wanted to solve into a graph optimization problem. In the biggest part of this chapter we will assume to know all the trips which occurred in our time frame of interest, only in Section 3.5 we will only assume knowledge of trips in the near future. We will, therefore, first look up where all the trips took place, and based on this information we will be able to find a fleet management optimization.

3.1

Problem formulation

Although we are mainly going to look at trips, and how to connect these, we need some sets for the taxis as well.

Definition 3.1. Let the finite set T0 = {1, . . . , T } consisting of time points t. Let Jtdenote all the possible

locations a taxi can be at at time t ∈ T0. Define the two subset Jte, Jtf of J as all the locations of all the empty and loaded taxis respectively at time t.

As we assume to know all the trips, we introduce some notation regarding these trips.

Definition 3.2. Let the time interval of interest 1, . . . T be given, let N the number of trips that occurred and define N = {1, 2, . . . , N }. Set T = {T1, T2, . . . , TN} to be the collection of trips during this time interval

with Tn representing a single trip. For all n ∈ N , Tn is the tuple (tpn, lpn, tdn, lpn), where tpn, lpn, tdn and ldn

denote the pick-up and drop-off times and locations, respectively. Define the collection of all the pick-up and drop-off locations as I ⊂ J .

With all these trips in T known, we will formulate the problem that we need to optimize.

Problem 3.3. The minimum fleet problem is defined as: given a set of trips T , find the minimum number of taxis needed to serve all trips in T , given that a taxi is available at each location lpn on or before time tpn.

If all the trips would have occurred on the same time, the minimum fleet size will be N . This will often not be the case and, therefore, we introduce some notation and conditions for a taxi to be able to operate two trips Tn and Tk.

Definition 3.4. For the distance between two points n, k ∈ J we denote the shortest distance via the road as the connection distance l(n, k). The shortest time to travel between these two points via the road is denoted by the connection time t(n, k). For two trips Tn, Tk ∈ T we define the trip connection distance and

trip connection time as ltrip(Tn, Tk) := l(ldn, l p

k) and ttrip(Tn, Tk) := t(tdn, t p

(17)

As it will be clear from the context whether we calculate the distance and time between two trips or two locations, we will often just write l(Tn, Tk) and t(Tn, Tk) for the trip connection distance and time

respectively, which we will also just call connection distance and connection time. For a taxi to be able to operate trip Tk after trip Tn, he should be able to drive from the drop-off location lnd to the pickup location

lkp before trip Tk starts. For the connection time there should hold

t(lnd, l p

k) ≤ t(Tn, Tk).

Although it is possible to have two trips Tn and Tk be served by one taxi, we may, due to for example

environmental considerations, want to put a restriction on the connection time.

Definition 3.5. Let δ ∈ R≥0be a real number. We call two trips Tn, Tk ∈ T δ-connected, or just connected,

if a taxi is able to drive either from Tn to Tk, or from Tk to Tn in less than δ time. Thus we have

t(ldn, lpk) ≤ t(Tn, Tk) ≤ δ or t(ldk, l p

n) ≤ t(Tk, Tn) ≤ δ. (3.1)

We will refer to δ as the restriction parameter.

First a brief explanation why we will not distinguish between the order of mentioning two connected trips.

Remark 3.6. By the construction of a trip i we always have lpi < lid. Together with (3.1) this means that for two connected trips Tn and Tk only one of the two inequalities

tpn< tdk or t p k < t

d n

can hold. Therefore we assume that saying trips Tn and Tk are connected, can both mean that first Tn is

served and then Tk, or the other way around. It will be clear from the context what would be the case.

Problem 3.3 is extended to:

Problem 3.7. The minimum fleet problem is redefined as: for a given set of trips T , find the minimum number of taxis needed to serve all trips in T , given that

1. a taxi is available at each lp

n on or before tpn for all n ∈ N ;

2. every two consecutive trips served by one taxi should satisfy one of the inequalities in equation (3.1).

3.2

Vehicle-shareability network

To optimally solve the minimum fleet problem, we will represent Problem 3.7 in a network.

Definition 3.8. Let G = (N, E) be the directed graph with nodes Tn ∈ T and edges e = (Tn, Tk) ∈ E if

and only if two trips Tn and Tk are connected. A vehicle-shareability network is a network induced by G

with a capacity of one assigned to every edge.

Vehicle-shareability does not refer to a taxi that is shared by customers, but to two or more rides that can be served by a taxi consecutively. We proof a nice property of the vehicle-shareability network.

(18)

Proof. Let G = (T , E) induce a vehicle-shareability network and assume we have a cycle. Due to Remark 3.6 there is no ambiguity for the direction between two trips and we represent our cycle as P = {T0, . . . , Tn, T0}.

By construction of the shareability network we have:

tdn+ t(Tn, Tn+1) ≤ t p n+1

for all trips in P . Repeating this gives

tp0 < td0≤ td

0+ t(T0, T1) ≤ tp1

< td1≤ . . .

< tdn≤ tdn+ t(Tn, T0) ≤ tp0,

which is a contradiction. So G has to be an acyclic graph.

Recall Definition 2.10 of a path cover. This will be a fundamental concept in solving the minimum fleet problem. We first show that finding a path cover implies a number of taxis we need in our network to serve all the trips.

Theorem 3.10. Let P = {P1, . . . , Pm} be a path cover of the vehicle-shareability network G = (T , E).

Then, all the trips in T can be served by m taxis.

Proof. Let P = {P1, . . . , Pm} be a path cover of G = (T , E). Consider an arbitrary path P = {e1, . . . , ep}

from P with node set N (P ) = ∪pn=0Tn, thus en = (Tn−1, Tn) for n = 1, . . . , p. Therefore, any two trips Tn

and Tn−1 can be served consecutively. Consequently, all the trips in P can be served one after the other

by one taxi. As there are only m paths needed to cover G, the shareability network can be served by m taxis.

With the previous theorem, the minimum fleet problem 3.7 is now equivalent to the next problem.

Problem 3.11. For a graph G = (N, E), find a path cover with the minimum number of paths:

minn|P|

P covers G o

.

Remark 3.12. In the worst case, no trips are connected. This gives the solution

P = {P1, . . . , PN} =

n

{n1}, . . . , {nN}

o ,

which results in the natural upper bound |P|≤ |N |.

Before solving the minimum path cover in general we introduce the next important concept.

3.3

Matching

Definition 3.13. In a graph G = (N, E), a matching M is a subset of edges in E such that every two edges ei, ej ∈ M do not share a node. Two nodes n, k ∈ N such that (n, k) ∈ M are said to be matched by M .

Each individual end node of an edge in M is said to be covered by M . If we can find a matching M which covers all the nodes n ∈ N , we call M a perfect matching. If M matches as many nodes as possible, M is a maximum matching.

(19)

In the optimization of a fleet management, a matching naturally arises as you want to match j taxi to i > j trips, this will be discussed in Section 3.5. It also proves to be useful in finding a minimum path cover, which is shown in Section 3.4.1. For now, we introduce an instinctive problem which arises with a matching.

Problem 3.14. Given a graph G, find a maximum matching M .

To solve this problem or for example, conclude that a perfect matching is not possible, we define paths with respect to a certain matching.

Definition 3.15. For a matching M , a path P is called M -alternating if two consecutive edges are not both in M .

Remark 3.16. For an alternating path P = {n0, n1, . . . , np}, we make four distinctions: If p is odd:

1. The first edge e1 is in M ;

2. The last edge ep is in M ;

If p is even:

3. Both edge e1 and ep are in M ;

4. Neither edge e1 nor ep are in M .

Case 4 is the one we need for finding the maximum matching, and which we will give a specific name.

Definition 3.17. An M -alternating path with both the first and the last edge are not in M is called an M -augmenting path. If we have an M -augmenting path P , we can increase the matching M to M0 by taking the symmetric difference

M0= (M \ P ) ∪ (P \ M ). We say we augment M via P .

Just as with augmenting a flow, we are ensured that if we can find an M -augmenting path, we will be able to construct a matching M0, which matches more nodes than M .

Lemma 3.18. For a matching M with m matches, the augmented matching M0 has m + 1 matches.

Proof. Let M be a matching with |M |= m and P be an augmenting path with |P |= p. Then we have for the augmented matching M0

|M0|= |M \ P |+|P \ M |=  m − p − 1 2  +  p −p − 1 2  = m + p − 2p − 1 2 = m + 1.

Recall that for a flow f we defined an f -augmenting path in Definition 2.16. We will omit the attachment f or M if it is clear from the context that to which flow or matching we are augmenting.

(20)

3.3.1

Finding a maximum matching

Finding a matching in an arbitrary graph is normally NP-complete. It turns out that in a bipartite graph, finding a maximum is linear in the number of edges.

Theorem 3.19. Finding a maximum matching in a bipartite graph with homogeneous capacity, is found by solving the maximum flow problem in this graph.

Proof. Let G = (N1∪ N2, E) be a bipartite graph. Without loss of generality we assume that the capacity

c for every edge e ∈ E is one. Extend N with a super source s and a super tail t which are connected with all the nodes of N1and N2, respectively. Furthermore, extend the capacity to

E0 := E ∪ {(s, n1)|n1∈ N1} ∪ {(n2, t)|n2∈ N2}

by assigning one to every edge {(s, n1)|n1 ∈ N1} and {(n2, t)|n2 ∈ N2}. Let G0 := (N0, E0)and apply the

Ford Fulkerson algorithm to find a maximum s, t-flow f∗ with flow value |f∗|= p. By Remark 2.14 and the homogeneous capacity, this implies that s is connected with p nodes from N1, that t is connected with p

nodes from N2, and that these k nodes from N1 are connected with the p nodes from N2. Let M be the

union of these p edges between N1 and N2

M = {(n1, k1), . . . , (np, kp)}.

By the homogeneous capacity, all the edges have no endpoints in common, thus M is a matching in G0 and G on p edges. If there is a matching M0 with p + 1 matched edges, their would be a possible flow f0 with |f0|= p + 1. This contradicts with the maximum flow algorithm, wherefore we conclude that M is a maximum matching.

With Theorem 2.18 we are now able to state the next corollary.

Corollary 3.20. Finding a maximum matching in a bipartite graph with homogeneous capacity is done in polynomial time.

3.4

Minimum path cover

Theorem 3.10 gives an equivalence between the minimum fleet problem and the minimum path cover problem. In this section we will solve the minimum path cover problem stated in Problem 3.11 in a graph G = (N, E), which will naturally induce a vehicle-shareability network.

Recall the definition of the degrees in Definition 2.6. Before obtaining some bounds on the size of a minimum path cover with the in and out degree of nodes, we will for a directed acyclic graph first state a useful lemma.

Lemma 3.21. For an acyclic directed graph G it holds

0 ∈ Din∩ Dout

Proof. Let G = (N, E) be an acyclic graph on l nodes and assume without loss of generality Dout =

Din = {1, 1, . . . , 1}. We will construct a path P to obtain a contradiction. Let P = ∅ and choose an

arbitrary n1 ∈ N . Add n1 to P and go to the node adjacent to n1, say n2. Likewise, add n2 to P and

go to the adjacent node n3. Continuing like this we can construct a path cover only consisting of one path

P = {n1, n2, . . . nl−1, nl}. By the construction of a path, every node has one incoming edge, except for n1.

(21)

We, therefore, should have 0 ∈ Dout. Every directed edge has a begin node and an end node, so it holds that l X i=1 din(ni) = l X i=1 dout(ni). (3.2)

To satisfy this equation, we should also have one incoming degree to be zero. Therefore 0 ∈ Din∩ Dout,

which finsihes the proof.

We define

Definition 3.22. For a graph G = (n, E), define D0out = {n ∈ N : dout(n) = 0} and D0in = {n ∈ N :

din(n) = 0} be the subsets of nodes which has no outgoing or incoming edges, respectively.

The previous theorem states that in an acyclic directed graph both sets D0

out and Din0 are nonempty.

3.4.1

Bounding the minimum number of paths

We can state a slightly sharper upperbound than stated in Remark 3.12.

Proposition 3.23. For a path cover P of an acyclic graph we have the upperbound

|P|≤ max{i ∈ Dout, j ∈ Din}

This proposition is proven by constructing paths slightly different to the proof of Lemma 3.21. Now the begin node n for a path is chosen to be the node with

dout(n) = max i ∈ Dout.

and you will enlarge the path via the a node k that is connected with n and has the biggest outdegree:

k = arg max{dout(k) | (k, n) ∈ E}.

Example 3.24. An example when the bound in the previous proposition is met, is when the graph consists of one path.

As we have at least one node which has outgoing degree zero, and one which has incoming degree zero, we can state a non trivial lower bound of a path cover.

Proposition 3.25. For a path cover P we have:

|P|≥ max|D0 out|, |D 0 in|  .

Which implies the next corollary.

Corollary 3.26. For a path cover P of a graph G = (N, E) we have |P|≥ |D0

out∩ D0in|.

3.4.2

Finding a minimum path cover

Finding a minimum path cover in a directed acyclic graph is reduced to a relative easy maximum matching problem.

Theorem 3.27. Finding a minimum path cover in a directed acyclic graph is equivalent to finding a maxi-mum matching in a bipartite graph.

(22)

Remark 3.28. If we have a node n that is not connected with any other node, it will not be matched, and we will need a separate path P = {n}, which is in line with the previous corollary. Therefore, we will only proof the theorem for connected graphs.

We will proof this theorem in three steps.

1. Translate G into a bipartite graph G0;

2. Find a maximum matching M in G0;

3. Translate the matching M into a path cover P in G. Proof. Let G = (N, E) be a connected directed acyclic graph.

1. Firstly, we translate our problem into a bipartite graph. Let G = (N, E) be the directed acyclic graph with N = {n1, . . . nl} and let Din and Dout be the sequence of the incoming and outgoing degrees for

all nodes respectively. Now we construct the directed bipartite graph G0 = (Nout∪ Nin, E0) with

Nout= {n ∈ N |dout(n) > 0};

Nin= {n ∈ N |din(n) > 0};

E0= {(nout, nin) ∈ E | nout∈ Nout, nin∈ Nin}.

By the previous remark we have Nout∪ Nin= N . An example graph G with its corresponding bipartite

graph G0 are shown in Figures 3.1a and 3.1b.

2. Finding a maximum matching can by Theorem3.19 be found by the Ford Fulkerson algorithm presented in Algorithm 1.

3. We need to construct a minimum path cover from the obtained matching in the bipartite graph G0. Suppose we have found a matching M . Then we will construct a minimum path cover by Algorithm 2. Continuing the example of Figure 3.1, we give a visual example of step 3 in Figure 3.2.

Algorithm 2: Matching to path algorithm Input: Matching M

Output: Path cover P

1 Initialize P ← ∅;

2 while We have some matchings left in M do 3 Begin a new path P ← ∅;

4 Find a begin node for P , so find a node n0∈ Nout corresponding with a matched edge

e0= (n0, k0) ∈ M such that n0∈ N/ in;

5 Add k0to P and search for k0= n1 a next matching (n1, k1) for some k1∈ Nin; 6 Go on till kj ∈ N/ out;

7 Delete the used matches from M : M = M \ P ; 8 Add P = {n0, k0, k1, . . . , kj} to P;

9 end

(23)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (a) Graph G. 1 2 3 4 5 6 8 9 10 11 12 13 14 15 16 18 19 2 3 4 5 6 7 9 10 11 13 14 15 16 17 19 20 Nout Nin (b) Bipartite graph G0

(24)

1 2 3 4 5 6 8 9 10 11 12 13 14 15 16 18 19 2 3 4 5 6 7 9 10 11 13 14 15 16 17 19 20 (a) Graph G 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (b) Covered graph G

Figure 3.2: The bipartite graph G0 with a maximum matching and the graph G with the corresponding path cover as constructed in the proof of Theorem 3.27

(25)

3.5

Online matching taxis and trips

In the previous sections we assumed that all the trips T = {T1, . . . , Tn} are known on before hand, now, we

will drop this assumption and we will be interested how we can optimally connect the trips from a certain point t ∈ T0 in time.

Definition 3.29. For the time set T0 we define for any u ≤ v ∈ T0 the subset

Tu,v0 = {u, u + 1, . . . , v} = {t ∈ T0 | t ∈ [u, v]}.

If v = T we write T0 u.

We are now interested in trips occurring in Tt0. As we can not assign taxis that are loaded, we will only define the set of available taxis at time t as Je

t = {J1, . . . , Jm}. For trip requests coming in, we will discuss

two methods to match these to the m available taxis.

3.5.1

On-the-fly

The first algorithm will deal with an incoming trip immediately, while the second algorithm will optimize after a certain time interval.

Definition 3.30. The On-the-fly algorithm serves every incoming demand immediately.If a trip request comes in, the dispatched taxi is chosen as the first available taxi that minimizes the waiting time for the trip. A pseudocode is given in Algorithm 3.

Algorithm 3: The On-the-fly algorithm Input: requested trip T ∈ T with p∈ T0

t and locations J e

t ⊂ J of available taxis J e t

Output: Taxi J∗ to serve the trip

1 Initialize: driving time of all the available taxis to pick-up location lp; 2 if no taxi is within connection time δ then

3 J∗= ∅ 4 end 5 else

6 Find the location of a nearest taxi: j∗∈ arg min {t(j, lp) | j ∈ Jte}; 7 Choose taxi J∗ corresponding with location j∗;

8 end

9 return Taxi J∗ with location j∗;

If we find more locations satisfying the minimization;

arg min {t(j, lp) | j ∈ Jte} = {j∗1, . . . , jk∗},

we choose arbitrarily any ji∗.

3.5.2

Batch

If we use On-the-fly matching, it will be possible that a taxi J is matched to a trip T = (tp, lp, td, lp) at t 0,

while at time t0 ∈ (t, t0) taxi J0 would be available to serve trip T with a shorter distance from the pickup

destination:

(26)

This even got worse if at t0 there is also a trip T. = (t.p, l.p, t.d, l.p) available which can be connected with both taxis and satisfies

l(j, l.p) < l(j, l.p).

To avoid these situations we will define the next parameter with a corresponding time set.

Definition 3.31. The batch parameter d ∈ R≤0 indicates how long we wait to match a (collection of)

request(s)

Tt= {T ∈ T | tp∈ Tt−d,t0 }

to a (collection of) taxi(s).

Now we will construct the method that assigns (multiple) taxis to (multiple) trips. The batch algorithm dispatches the taxis in batches. Trip requests are collected for d minutes, and then distributed under the available taxis. This algorithm tries to find a maximum matching between the taxis and the demands, taken into account the maximum connection time δ, which is shown in Algorithm 4.

Algorithm 4: The Batch algorithm

Input: requested trips Tt= {T1, . . . , Tk} ⊂ T and available taxi locations Jte= {j1, . . . jm}

Output: Maximum matching between requests and taxis

1 Initialize: driving time of all the available taxis to all pick-up locations:

{t(j1, lp1), . . . , t(j1, lpk), . . . , t(jm, lp1), . . . , t(jm, lpk)}; 2 Construct a bipartite graph G with

2a one side with trip requests 2b one side with available taxis

2c every edge (T, J ) is only added if taxi T can serve trip J ;

3 Find a maximum matching in G;

4 return Matching M with an edge e = (T, j∗) ∈ M connecting taxi j∗ with trip T ;

As explained in lines 2 to 3, finding the best matching for the taxis and trips given as input in the batch method can be treated as an already known problem.

Lemma 3.32. Finding the best taxi-trip matching is equivalent to finding the maximum matching in a bipartite graph.

Proof. First, we translate our problem to a bipartite graph. Let J = {J1, . . . , Jm} be the m available

taxis and let T = {T1, . . . , Tk} be the trip requests. Now we construct the bipartite graph G = (J ∪ T, E)

with e = (j, t) ∈ E if and only if taxi j can serve trip t under the constraints (1) and (2) as described in Problem 3.7. Now we show that a matching is translated into a solution of our problem. Define the set Ti to be the set of trips in T that is connected with taxi Ji. If a trip T /∈ ∪mi=1T

i, this trip cannot be served

by the available taxis. Therefore, without loss of generality we assume T = ∪mi=1Ti. Assume we found a

matching

M = {e1, e2, . . . , em} ⊂ E with for any i ∈ {1, . . . , m} ei= (Ji, t) for some t ∈ Ti.

Now taxi Ji can by construction serve the trip t for every i = 1, . . . , m.

Finding the maximum matching is by Theorem 3.19 again done by the Ford-Fulkerson algorithm, and, therefore, is really tractable.

(27)

3.6

Summary

We started this chapter with assuming we knew all the trips and we defined the minimum fleet problem, Porblem 3.7: “For a given set of trips T , find the minimum number of taxis needed to serve all trips in T , given that

1. a taxi is available at each lp

n on or before tpn for all n ∈ N ;

2. every two consecutive trips served by one taxi should satisfy one of the inequalities in equation (3.1).”

We solved this by translating it into a vehicle-shareability network, which, by Lemma 3.9, turns out to be an acyclic directed graph. Introducing and maximizing a matching made us able to find via Theorem 3.27 a minimum path cover for a given acyclic graph. Stated after the introduction of a vehicle-shareability network, Theorem 3.10 translates the minimum path cover into a solution to the minimum fleet problem. We even know which taxis should serve which trips, as we know all the paths in the path cover.

We ended this chapter with Section 3.5, in which we dropped the assumption that we knew all the trips. We, instead, wanted to match an available number of taxis to a number of trips. With Lemma 3.32 and Algorithm 4 we are able to this by finding a maximum matching in a bipartite graph.

(28)

4

Optimizing the taxi dispatching

Instead of solving the best mathcing of cars and trips, we will here optimize the taxi fleet management by maximizing the reward via the value function. In this chapter, we will, therefore, follow the setup described in the article by Topaloglu and Powell [13]. As we will combine a Markov decision process and a maximum reward flow problem, we will just as in Chapter 3 introduce some variables regarding the taxis. For definitions and properties of Markov decision processes, including methods to find the optimal decision, we refer to the lecture notes by Bhulai and Koole [3] and the book by Bellman[2].

4.1

Preliminaries

Before able to introduce the variables that will play a role in the optimization we first introduce two sets.

Definition 4.1. Let T = {1, . . . , T } and I = {1, . . . , I} be two finite sets, where t ∈ T denotes a time point and i ∈ I denotes a road intersection. The driving time τ (i, j) is the time it takes to drive between intersections i and j. We introduce the graph G = (I, E) with e = (i, j) ∈ E if and only if τ (i, j) = 1.

For simplicity we will assume

τ (i, j) = 1 ∀i 6= j ∈ I

and, therefore, the graph G is complete. Instead being all the possible places on a road where a taxi can stop, I will be the set of all the intersections between two roads. All the pick-up and delivery coordinates of a taxi will be set as the nearest i ∈ I based on the global positioning system coordinates (GPS). Now we will introduce some notation to be able to set up an optimization problem. First of all some external values, that we will not be able to change.

Definition 4.2. Let i, j ∈ I denote any intersection and t ∈ T any time point. With Dijt we denote the

demand to go from intersection i to j at time t. The negative reward −rijte and the reward r f

ijt are the

rewards for a taxi to drive empty and loaded, respectively, from i to j at time t.

We will assume that Dijt ≥ 0 and Diit = 0 for all i, j ∈ I and t ∈ T . Just as the name negative

reward does expect, we assume that driving empty gives costs due to, for example, gasoline. Thus −re ijt < 0.

We also assume transporting a passenger gives more reward than it costs to drive empty, thus rfijt actually represents the net reward and therefore rfijt> 0.

Definition 4.3. Let i, j ∈ I denote any intersection and t ∈ T any time point. Analogue to the (negative) reward we denote with xeijt and xfijt the number of empty and loaded taxis, respectively, that drive from intersection i to j at time t. With Ritwe denote the total number of taxis at intersection i at time t.

(29)

For notation purposes we represent the variables in the following matrices: xt=xet x f t =             xe11t x f 11t .. . ... xe 1It x f 1It .. . ... .. . ... xe IIt x f IIt             , rt=−ret r f t =             −re 11t r f 11t .. . ... −re 1It r f 1It .. . ... .. . ... −re IIt r f IIt             , Dt=            D11t .. . D1It .. . .. . DIIt            and Rt=    R1t .. . RIt   . (4.1)

We denote with Mn×m the n × m-matrices. We then have

xt, rt∈ M2×I·I

two matrices and

Dt∈ M1×I·I and Rt∈ M1×I

two I × I- and I-dimensional vectors. We have some important relations between the number of taxis that move, xt, and the number of taxis that are at the intersections, Rt.

Remark 4.4. All the taxis that are leaving from state i and drive to some state j at time t, do have to be at some state i. Mathematically:

X

j∈I



xeijt+ xfijt= Rit. (4.2)

Also, all the taxis that will be in state j at time t + 1, have to travel to state j at time t. Mathematically:

X

i∈I



xeijt+ xfijt= Rj,t+1. (4.3)

As it is possible to add or subtract taxis from the grid, we do not require that P

i∈IRit = Pi∈IRit0 for

t 6= t0. Other relations with respect to the reward and the demand are also important to take into account. We formalize the idea that as a taxi company you want to have a positive net profit.

X t∈T X i,j∈I rijtf xfijt>X t∈T X i,j∈I reijtxeijt.

A taxi can only transport a customer if there is a demand from a customer to be transported. Which can be posted for every time and pair of intersections individually,

xfijt≤ Dijt ∀t ∈ T and ∀i, j ∈ I (4.4)

or for the whole sets I and T simultaneously

X i,j∈I X t∈T xfijt≤ X i,j∈I X t∈T Dijt. (4.5)

(30)

4.2

Optimizing sets

In the previous section we introduced different sets and notations to set up an optimization, which will be formulated here. We will conclude with a Markov decision process.

Problem 4.5. For reward rt, demand Dt and a fixed number of taxis R1, we want to maximize the total

reward rt· xt. That is max    X i,j∈I X t∈T  rfijtxfijt− re ijtx e ijt  (i) z }| { X j∈I  xeij1+ x f ij1= Ri1  , (ii) z }| { X i∈I Rit= X i∈I Rit0, (iii) z }| { xfijt ≤ Dijt and

(iv) z }| { xeijt, x f ijt∈ Z≥0        . (4.6) with

(i) the balance constraint (4.2) for t = 1;

(ii) the condition that the number of taxis does not change over time;

(iii) the demand constraint (4.4);

(iv) stating that the numbers of taxis are non negative.

With condition (ii) and the vector notation presented in (4.1) we use Rt as the state variable to

formu-late the stochastic version of Problem 4.5. To ease notation, we introduce two useful sets concerning the constraints (i), (iii) and (iv) of Problem 4.5.

Definition 4.6. For a given distribution Rtand demand Dt, the set of feasible solutions at time t ∈ T of

Problem 4.5 is given by X (Rt, Dt) =    xt∈ M2×I·I X j∈I  xeijt+ x f ijt 

= Rit ∀i ∈ I; xfijt≤ Dijt and xeijt, x f ijt∈ Z≥0 ∀i, j ∈ I    . (4.7)

Now, together with every feasible solution, we want to determine how many taxis we will have at every intersection at time t + 1 by including equation (4.3).

Definition 4.7. For a given distribution Rt and demand Dt, the set of feasible solutions at time t ∈ T

together with the next distribution of taxis Rj,t+1 is given by

Y(Rt, Dt) =        (xt, Rt+1) ∈ M2×I·I× M1×I xt∈ X (Rt, Dt) and (4.3) z }| { Rj,t+1= X i∈I xeijt+ xfijt ∀j ∈ I        . (4.8)

(31)

Definition 4.8. We define the Markov decision process X = {Xt}t∈T where for every i ∈ I we define

Xit= Rit. The decision we can take at every time t is how much taxis we need to assign to drive to another

intersection to satisfy the demand Dt+1 at time t + 1 at every intersection. Therefore, a decision a is a

2 × I · I-dimensional matrix with non negative entries.

For our Markov process X we want to find a policy π∗that maximizes the total reward over time 1, . . . , T . Let for a policy π, Xπ= {Xπ

t}t∈T be the sequence of decisions taken according to this policy. Every variable

Xtπwill indicate how we should choose xt= ({xeijt}i,j∈I, {xfijt}i,j∈I), thus how many taxis we should assign

to drive empty and loaded from i to j at time t for all intersection i, j ∈ I.

Problem 4.9. For a given number of taxis R1: find the policy, depending on the state of the system Rtand

the variable demand Dt, that maximizes the reward over time 1, . . . , T :

argmin π ( E " X t∈T rt· Xtπ(Rt, Dt) R1 #) . (4.9)

By the principal of optimality in Chapter III, §3 in Dynamic Programming [2], we can find the optimal policy (4.9), taking into account the constraints in (4.6), by solving the value function Vt: M1×I→ R

Vt(Rt) = E  maxnrtxt+ Vt+1(Rt+1) (xt, Rt+1) ∈ Y(Rt, Dt) o Rt  . (4.10)

4.3

Tractability of the value function

For n taxis, we have already nN possible values for R

t, what makes calculating Vt for all the Rt quite

intractable. Thus, computing the expectation is often also very intractable. Therefore, we define an approx-imating function.

Definition 4.10. Let for t ∈ T the sub problem Ut: M1×I× M1×I·I → M2×I·I× M1×I be given as

Ut(Rt, Dt) = max n rtxt+ Vt+1(Rt+1) (xt, Rt+1) ∈ Y(Rt, Dt) o . (4.11)

The hard to compute value function in equation (4.10) reduces to

Vt(Rt) = E h Ut(Rt, Dt) Rt i . (4.12)

To solve the subproblem we will approximate the value function Vt+1by a suitable function ˆVt+1. Therefore,

the subproblem changes in an approximated subproblem which will turn out to be nicely solvable for different near optimal value functions

Definition 4.11. Let ˆVt+1be a suitable approximation of the value function Vt+1and let ˆDtbe one Monte

Carlo sample for demand Dt. Then we define the subproblem approximation function

ˆ

Ut: M1×I× M1×I·I → M2×I·I× M1×I; (Rt, ˆDt) 7→ ˆUt(Rt, ˆDt),

with ˆ Ut(Rt, ˆDt) = max n rtxt+ ˆVt+1(Rt+1) (xt, Rt+1) ∈ Y(Rt, ˆDt) o . (4.13)

Before discussing different approximations, we need to be able to find the optimal policy with the value function Vt, therefore we need the property stated in the next lemma.

(32)

Lemma 4.12. Vt is a concave function on the integer lattice.

Proof. We will give the intuitive idea why this holds. For an increasing demand you can have more taxis driving loaded, and, therefore, have an increasing value function. Furthermore, if the number of distributed taxis increases, it means we need more taxis because of the higher demand, thus, again the value function will increase. As both increases are getting relatively smaller if we already have a big number of taxis (driving), the value function will indeed be concave on the integer lattice. See Theorem 5(d) in the article by Haneveld and van der Vlerk [6] for a proof.

4.4

Update scheme

Mentioned already before Definition 4.11 there are different value function approximations which will make (4.13) solvable. In the next three sections we will set up three different approximations for the value function and proof that (4.13) is solvable. For every model we will update the approximation ˆUtand ˆVtwith different

parameters, but we will use the same recipe. For any set of approximations

ˆ

Vn = ( ˆV1n, . . . , ˆVTn)

we will first find a vector of subproblem approximations

ˆ

Un = ( ˆU1n, . . . , ˆUTn).

For every iteration n we will define the following sequences.

Definition 4.13. For n ∈ N we define the step size αn ∈ (0, 1). The sequence of demand realizations and the sequence of taxi distributions are defined as

ˆ

Dtn= ˆD1n, . . . , ˆDTn and Rn= (Rn1, . . . , RnT) (4.14) respectively.

Next, we use the n-th subproblem approximations, the demand sequences, and the distribution sequences, together with (4.12) to update the value function to ˆVn+1. The update scheme will look like Algorithm 5.

The problems we will discuss in the next sections for every model separately are

1) How to do step 6?

2) How to find an update function Z in step 11?

4.5

Linear value function approximations

First, we assume that our value function approximation in Definition 4.11 is a linear function. For every time t ∈ T we define the slope vector for ˆVt as (vit)i∈I. Therefore for every intersection i, we write the

approximated value function as a scalar times the number of taxis Rit.

ˆ Vt(Rt) = X i∈I ˆ Vit(Rit) =X i∈I ˆ vitRit (4.15)

(33)

Algorithm 5: Update scheme Input: Approximation ˆVn= ( ˆVn

1, . . . , ˆVTn)

Output: Updated approximation ˆVn+1

1 Initialize:

2 Set System state Rn1 = (Rn11, . . . , RI1n);

3 Obtain Monte Carlo sample { ˆDnt}t∈T = { ˆD11tn , . . . , ˆDIItn }t∈T; 4 Set time t = 1

5 while t ∈ T do

6 Solve approximation subproblem ˆUtn(Rnt, ˆDtn) = max

n rtxt+ ˆVt+1n (Rnt+1) (xt, R n t+1) ∈ Y(Rnt, ˆDnt) o 7 Obtain xt 8 ObtainPj∈I 

xejit+ xfjit=: Rn+1i,t+1 as in (4.3)

9 Set t = t + 1 10 end

11 Update ˆVtn+1= Z ˆUtn, Rnt, ˆDtn, Vtn



for some function Z;

12 Update value function to ˆVn+1= ( ˆV1n+1, . . . , ˆVTn+1); 13 return Updated value function ˆVn+1

4.5.1

Subproblem solution for a linear approximation

The subproblem approximation in (4.13) can now be simplified. We write out the definition given in (4.8) to obtain: ˆ Ut(Rt, ˆDt) = max    X i,j∈I

(−rijte xeijt+ rfijtxfijt) + ˆVt+1(Rt+1)

(xt, Rj,t+1) ∈ Y(Rt, ˆDt)    = max    X i,j∈I (−rijte xeijt+ r f ijtx f ijt) + X j∈I ˆ vj,t+1Rj,t+1 xt∈ X (Rt, ˆDt) and X i∈I  xeijt+ xfijt= Rj,t+1 ) = max    X i,j∈I  (−reijt+ ˆvj,t+1)xeijt+ (r f ijt+ ˆvj,t+1)xfijt  (xt, Rj,t+1) ∈ Y(Rt, ˆDt)    . (4.16)

Theorem 4.14. The expression for ˆUt(Rt, ˆDt) given in (4.16) is a maximum reward problem.

Proof. Recall the formulation of the maximum reward problem in equation (2.7). We let the in Definition 4.1 defined graph G induce a network. Every term in the sum represents a total flow cost of the form r(i, j)·f (i, j). To identify in (4.16) the three constraints from (2.7) we use Definitions 4.7 and 4.8 to write Y(Rt, ˆDt) as a

(34)

Y(Dt, Rt+1) ⊂      (xt, Rt) ∈ M2×I·I× M1×I (i) z }| { xeijt, x f ijt∈ Z≥0 ∀i, j ∈ I, (ii) z }| {

xfijt≤ Dijt ∀i, j ∈ I

and (iii) z }| { X j∈I  xejit+ x f jit  −X j∈I  xeijt+ x f ijt  = Ri,t+1− Rit ∀i ∈ I        . (4.17)

We finish the proof by observing that (i) and (ii) represent the capacity constraints and (iii) represents the flow balance constraint.

4.5.2

Updating the linear approximation

The previous theorem, in combination with Theorem 2.25, tells us we can find a solution for the subproblem approximation ˆUt(Rt, ˆDt) in (4.13). The next step is to update the value function approximation ˆV , so to

find the update function Z in Algorithm 5 line 11. Let ei denote the unit vector of length I with a one on

the ith coordinate. Every term ˆVn

it of the value function approximation ˆVtn =

P

i∈IVˆ n

it, we would like to

update using the difference if we adjust the distribution Rn

it a bit. Therefore we would like to know

Vt(Rnt + ei, ˆDnt) − Vt(Rnt, ˆD n

t) and Vt(Rnt − ei, ˆDnt) − Vt(Rnt, ˆD n t).

As we do not know the real value function we will use the approximated subproblem to say update the approximated value function.

Definition 4.15. Let ei denote the unit vector of length I with a one on the ith coordinate. Furthermore,

we are given for iteration n the step size αn, the demand and distribution components, and the approximated subproblem. We define the approximated difference

∆nt(ei) = ˆUtn(R n t + ei, ˆDnt) − ˆU n t(R n t, ˆD n t). (4.18)

Now we will update the value function approximation by updating all it slopes

ˆ

vn+1it = (1 − αn)ˆvnit+ αn∆nt(ei). (4.19)

Therefore the function Z that updates the value function will be:

Z ˆUtn, Rnt, ˆDnt, Vtn= Z ˆUtn, Rnt, ˆDnt, (ˆvitn)i∈I  =(1 − αn)ˆvnit+ αn∆nt(ei)  i∈I = vitn+1i∈I.

4.6

Piecewise linear value function approximations

Now we assume that our approximated value function in Definition 4.11 is a piecewise linear function. Therefore, we will write for every intersection i and time t, element ˆVit(Rit) as a linear combination of

(35)

have ˆvitrepresenting a vector of coefficients. Therefore let N denote the number of taxis, so N =Pi∈IRi1

and let N = {1, 2, . . . , N } be the set of integers from 1 up to and including N . We will represent every ˆvit

with

ˆ

vit= (ˆvit(1), . . . ˆvit(N )) and zit= (zit(1), . . . zit(N ))

where vit(s) is the slope of ˆVit between s − 1 and s and zit a set of coefficients. For ˆVit to be a piecewise

linear approximation zit has to satisfy both

X

s∈N

zit(s) = Rit∀i ∈ I, t ∈ T .

and 0 ≤ zit(s) ≤ 1 for all i ∈ I, t ∈ T , s ∈ N . Furthermore we have by the concavity of V , see Theorem 4.12,

zit(s) ≥ zit(s + 1). Summarizing we can, with the same first step as in (4.15), write

ˆ Vt(Rt) = X i∈I ˆ Vit(Rit) =X i∈I X s∈N ˆ vit(s)zit(s). (4.20)

4.6.1

Subproblem solution for a piecewise linear approximation

The approximated subproblem (4.13) becomes:

ˆ Ut(Rt, ˆDt) = max    X i,j∈I

(−rijte xeijt+ rfijtxfijt) + ˆVt+1(Rt+1)

(xt, Rj,t+1) ∈ Y(Rt, ˆDt)    = max    X i,j∈I

(−rijte xeijt+ rfijtxfijt) +X

j∈I X s∈N ˆ vj,t+1(s)zj,t+1(s) (xt, Rj,t+1) ∈ Y(Rt, ˆDt) and X s∈N zit(s) = Rit with zj,t+1(s) ∈ [0, 1] ) . (4.21)

Lemma 4.16. The approximated subproblem (4.21) is a maximum reward flow problem.

Proof. Again, recall the formulation of the maximum reward flow problem in (2.7). We have the same network constructed in Definition 4.1, as mentioned in Theorem 4.14. The constraints of (4.21) can be written the same as (4.17) with the slight change that constraint (iii) becomes:

X j∈I  xejit+ xfjit−X j∈I  xeijt+ xfijt= X s∈N zi,t+1(s) − zit(s) ∀i ∈ I.

As this represents the flow balance constraint in (2.7), we have obtained the maximum reward flow problem.

4.6.2

Updating the piecewise linear approximation

Finding the solution of the approximated subproblem (Algorithm 5, line 6) is, due to Lemma 4.16 and 2.25, done by solving the min-cost flow problem. Now, as mentioned after Algorithm 5, we need to find a suitable

Referenties

GERELATEERDE DOCUMENTEN

BOA uses the struc- ture of the best solutions to model the data in a Bayesian Network, using the building blocks of these solutions.. Then new solutions can be extracted from

Our Tsetlin algorithm uses the Boltzmann exploration to choose between these elements and instead of us- ing expected value as done in equation 2.5 it takes the states S t (i) in

Door de verbetering van de bewaarbaarheid kan de boer het gehele jaar door zijn producten leveren, zodat de faciliteiten voor centrale verwerking efficiënter kunnen worden

Uit onderzoek blijkt dat er een relatie is tussen loof- en knolresistentie en de noodzakelijke dosering van het fungicide

De eisen die aantoonbaar van belang zijn voor verkeersonveiligheid betreffen: de netwerkstructuur en omvang van verblijfsgebieden, het aantal erfaansluitingen per eenheid van

Als tijdens het ontwerpend onderzoek blijkt dat een bepaald concept of scenario afbreuk zal doen aan de krachtlijnen van de site, dan kunnen de onderzoekers eerst bekijken of het

There are a number of areas where UZCHS performed better than expected using the peer-review tool: early exposure to rural and under-served communities occurs from the 1st

If all the information of the system is given and a cluster graph is connected, the final step is to apply belief propagation as described in Chapter 5 to obtain a