107
Prescriptive Data Analytics Christine Solnon 5IF - 2019-2020 1/78

Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

Christine Solnon

5IF - 2019-2020

1/78

Page 2: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

2/78

Page 3: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

From urban logistics to smart cities1

Urban logistics:

Technical solutions to ease urban life Water alimentation, Garbage collection, Transport, etc

Allow cities to grow bigger

Smart cities: Urban logistics revisited thanks to IT

Cities that exploit in real time the Data they produce

Collect Data (Various kinds of big Data)

Analyse Data

Goal: Optimise services, costs, environmental impact, etc

1 See the report of Ludovic Viévard (Octobre 2014)http://www.millenaire3.com/dossiers/comprendre-orchestrer-et-vivre-la-ville-intelligente

3/78

Page 4: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Data for Smart Cities

Origine of Data

Different kinds of sensors: measure température, noise, speed, position,energy consumption, etc

Different kinds of Data: numerical temporal series, videos, images,tweets, etc

Big volumes of heterogeneous Data

Open Data

Data produced by collectivities More and more often available (see http://data.grandlyon.com)

Data produced by private companies Sometimes available (see TUBÀ)

Data produced by users Sometimes given back to users (see http://mesinfos.fing.org/)

In all cases: need of mechanisms to protect privacy4/78

Page 5: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Data for Smart Cities

Origine of Data

Different kinds of sensors: measure température, noise, speed, position,energy consumption, etc

Different kinds of Data: numerical temporal series, videos, images,tweets, etc

Big volumes of heterogeneous Data

Open Data

Data produced by collectivities More and more often available (see http://data.grandlyon.com)

Data produced by private companies Sometimes available (see TUBÀ)

Data produced by users Sometimes given back to users (see http://mesinfos.fing.org/)

In all cases: need of mechanisms to protect privacy4/78

Page 6: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Three levels of Data Analytics

Descriptive / Diagnostic Analytics :

Extract Knowledge from Data

What are the traffic conditions right now?Why is there a traffic jam right now?

Predictive Analytics :

Build models to predict future

What will be traffic conditions in 30 mn?

Prescriptive Analytics :Assist decision making

What is the best route if I leave at 8:25?

5/78

Page 7: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Three levels of Data Analytics

Descriptive / Diagnostic Analytics :

Extract Knowledge from Data

What are the traffic conditions right now?Why is there a traffic jam right now?

Predictive Analytics :

Build models to predict future

What will be traffic conditions in 30 mn?

Prescriptive Analytics :Assist decision making

What is the best route if I leave at 8:25?

5/78

Page 8: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Three levels of Data Analytics

Descriptive / Diagnostic Analytics :

Extract Knowledge from Data

What are the traffic conditions right now?Why is there a traffic jam right now?

Predictive Analytics :

Build models to predict future

What will be traffic conditions in 30 mn?

Prescriptive Analytics :Assist decision making

What is the best route if I leave at 8:25?

5/78

Page 9: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Artificial Intelligence for Data Analytics

Descriptive analytics

Pattern RecognitionStatistical Analysis, Data MiningKnowledge Representation...

Predictive analytics

Machine Learning, Classification, ClusteringMulti-Agent Systems, Simulation...

Prescriptive analytics

Constrained Optimisation, Meta-HeuristicsPlanningReasoning on Uncertain Data...

6/78

Page 10: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

The Optimod’Lyon Project

Answer to the (french) ADEME call on “Urban Mobility"

Leader : Grand Lyon (Lyon + 57 surrounding towns / 1.3 M inhabitants)

13 Partners :

2 Collectivities : Lyonand Grand Lyon8 Companies : IBM,Renault Trucks, Orange,CityWay, Phoenix ISI,Parkeon, AutoroutesTrafic, Geoloc Systems3 Research Institutes :LIRIS, CETE, LET

Duration : 3 years(2012-2015)

Budget : 7 M Euros

IN THE CITYSUSTAINABLE MOBILITYOPTIMIZE

7/78

Page 11: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Overview of Optimod’Lyon

mobility portal

in real−time

mobility data

for collecting

New systems

networks by a 1 hour prediction

of traffic conditions

Optimize the exploitation of urban

Provide real−time and multi−modal

Optimize urban deliveries by informing

drivers and optimizing tours

information, available at any time, every

where and for every body

warehouse

Data

Mobility

Grand Lyon

8/78

Page 12: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimization of urban delivery tours

Problem:Given a city map and delivery addresses, compute the shortest tour

Solution process in two steps:

Compute the shortest path graph

Solve the Asymetric Traveling Salesman Problem (ATSP) in this graph

9/78

Page 13: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimization of urban delivery tours

Problem:Given a city map and delivery addresses, compute the shortest tour

Solution process in two steps:

Compute the shortest path graph

Solve the Asymetric Traveling Salesman Problem (ATSP) in this graph

4

1

2

3

5

6

9/78

Page 14: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimization of urban delivery tours

Problem:Given a city map and delivery addresses, compute the shortest tour

Solution process in two steps:

Compute the shortest path graph

Solve the Asymetric Traveling Salesman Problem (ATSP) in this graph

8

1

2

3

4

6

5

12

9/78

Page 15: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimization of urban delivery tours

Problem:Given a city map and delivery addresses, compute the shortest tour

Solution process in two steps:

Compute the shortest path graph

Solve the Asymetric Traveling Salesman Problem (ATSP) in this graph

20

1

2

3

4

6

5

12

8

13

10

5

8

7

9

14

12

69

13

4

7

8

23

19

8

12

6

9

10

11

107

10

5

17

9/78

Page 16: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimization of urban delivery tours

Problem:Given a city map and delivery addresses, compute the shortest tour

Solution process in two steps:

Compute the shortest path graph

Solve the Asymetric Traveling Salesman Problem (ATSP) in this graph

1

2

3

4

6

5

12

8

13

10

5

8

7

9

14

12

69

13

4

7

8

23

19

8

12

6

9

10

11

107

10

5

1720

9/78

Page 17: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Deliveries with several vehicles Vehicle Routing Problem (VRP)

Problem:Given a city map, delivery addresses with associated demands, and vehiclecapacities

, compute a set of tours that satisfy capacity constraints andoptimise some objective function (e.g., total travel distance)

8 3

4

4

5

Vehicle capacity = 12

23

1

2

3

4

6

5

12

8

13

10

5

8

7

9

14

12

69

13

4

7

8

19

8

12

6

9

10

11

107

10

5

1720

4

8

4

3

5

10/78

Page 18: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Deliveries with several vehicles Vehicle Routing Problem (VRP)

Problem:Given a city map, delivery addresses with associated demands, and vehiclecapacities, compute a set of tours that satisfy capacity constraints andoptimise some objective function (e.g., total travel distance)

8 3

4

4

5

Vehicle capacity = 12

23

7

8

19

8

12

6

9

10

11

107

10

5

1720

1

2

3

4

6

5

12

8

13

10

5

8

7

9

14

12

69

13

4

4

3

5

4

8

10/78

Page 19: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

What’s difficult in the classical problem?

Compute shortest paths between two points?Easy and well solved problem:

Efficient algorithms (polynomial complexity) For example, Dijkstra or A*

Solve ATSP/VRP in the shortest path graph?

NP-hard problems

Theory: No algorithm can compute the optimal solution in polynomialtime (unless P=NP)

Practice: Use Artificial Intelligence!

11/78

Page 20: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

What’s difficult in the classical problem?

Compute shortest paths between two points?Easy and well solved problem:

Efficient algorithms (polynomial complexity) For example, Dijkstra or A*

Solve ATSP/VRP in the shortest path graph?

NP-hard problems

Theory: No algorithm can compute the optimal solution in polynomialtime (unless P=NP)

Practice: Use Artificial Intelligence!

11/78

Page 21: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

12/78

Page 22: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Constrained Optimization

Model of a Constrained Optimization Problem (COP):

Define (X ,D,C,F ) with:

X = Set of variables (unknowns)

D = function which defines the domain D(xi ) of every variable xi ∈ X D(xi ) = Set of values that may be assigned to xi

C = Constraints (relations between variables of X )

F : X → R = objective function to optimize

Solution of a problem (X ,D,C,F ):

Assignment of a value to every variable of X such that:Each variable xi ∈ X is assigned to a value that belongs to D(xi )

Every constraint of C is satisfiedF is maximized (or minimized)

Remark: A problem may have several different models...

13/78

Page 23: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Example: Model for the TSP

Variables: X = {xi,j | i , j ∈ V × V , i 6= j} with D(xi,j ) = {0,1} xi,j = 1 if we travel to j just after i

Constraints:∀i ∈ V , we must visit i once:

∀i ∈ V ,∑j∈V

xi,j =∑j∈V

xj,i = 1

∀S ⊂ V , no subtour:

∀S ⊂ V ,∑

(i,j)∈S×S

xi,j < |S|

Objective function: Minimize∑

(i,j)∈S×S di,j ∗ xi,j

Example for the tour 0→ 3→ 1→ 2→ 4→ 0

x0,3 = x3,1 = x1,2 = x2,4 = x4,0 = 1

14/78

Page 24: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Example: Other model for the TSP

Variables: X = {nexti , visiti | i ∈ V}D(nexti ) = V \ {i} nexti = j if the vertex visited after i is jD(visiti ) = V visiti = j if the i th visited vertex is j

Constraints:We start from and return back to 0: visit0 = 0 and nextvisitn−1 = 0The next of visiti−1 is visiti : ∀i ∈ V \ {0}, visiti = nextvisiti−1

Each vertex is visited once: allDifferent(visit)Each vertex follows a different vertex: allDifferent(next)

Objective function: Minimize∑

i∈V di,nexti

Example for the tour 0→ 3→ 1→ 2→ 4→ 0

next 3 2 4 1 00 1 2 3 4

visit 0 3 1 2 40 1 2 3 4 15/78

Page 25: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Some particular cases

No constraint: Optimization problem

No objective function: Constraint Satisfaction Problem (CSP)

Domains are discrete (enumerables) Combinatorial problem

F linear, D = R and C = linear inequations Linear Programming (LP)

F linear, D = Z and C = linear inquations Integer Linear Programming (ILP)

F linear, D = {0,1} and C = linear inequations Knapsack problem

F quadratic, D = R and C = linear inequations Quadratic Problem

...

16/78

Page 26: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Complexity

Some particular cases have polynomial complexities:

Linear programming with continuous domains2-SATAssignment problemsShortest path problems...

They are most often NP-hard:

ILP, KnapsackSAT, 3-SAT, Planar-3-SAT, ...Many graph problems:Coloring, TSP, max Clique, ...CSP with finite domains...

In some cases they are undecidable:

Diophantine equationsCSP with non finite domains...

17/78

Page 27: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

How to solve NP-hard problems?

Some instances of NP-hard problems may be easy to solve Phase transition, search landscape

Some NP-hard problems become polynomial when adding constraints

Some NP-hard problems may be approximated in polynomial time(with bounds on errors)

Otherwise, we have to be intelligent when exploring the search space

Heuristic approaches: Avoid explosion by ignoring some parts of the search spaceComplete approaches: Prevent explosion by structuring and filtering search space

18/78

Page 28: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Heuristic approachesExploration guided by (meta-)heuristics

Intensify search around the most promising areasDiversify search to discover new areas

Two kinds of heuristic approachesPerturbative: Modify existing combinations

Ex: Local search (LS), Genetic Algorithm (GA), Particle SwarmOptimization (PSO), ...

Constructive: Build new combinations from scratchEx: Ant Colony Optimization (ACO), Estimation of DistributionAlgorithms (EDA), ...

Example of local search for the 8-queen problem:

19/78

Page 29: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Complete approaches

ad hoc approaches

Branch & Bound, Branch & Cut, Branch & Price, ...Dynamic programming...

Generic approaches: Problem Model Generic solver

ILP (Integer Linear Programming) Model = Linear inequationsSAT (satisfiability of Boolean formulae) Model = Boolean formula (set of clauses)CP (Constraint Programming) Model = Constraints

Why using CP?

Ease of modellingEfficiency

20/78

Page 30: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Why using CP instead of SAT?

Slide from Christian Bessière

21/78

Page 31: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Why using Cp intead of SAT?

Slide from Christian Bessière

22/78

Page 32: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Why using CP intead of ILP?

Slide from Christian Bessière

23/78

Page 33: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Why using CP instead of ILP?

Slide from Christian Bessière

24/78

Page 34: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Why using CP instead of a dedicated approach? Differential cryptanalysis of AES

Basic model in Picat:

Advanced model in Picat:Less than 200 lines of codeSolve all instances in less than 4h (for keys of 128, 192, and 256 bits)

Branch & Bound [Biryukov et al 2010] : Several days (weeks) for keys of 128 (192) bitsGraph traversal [Fouque et al 2013] : 30mn/12 cores for 128 bits, but 60GB of RAM

25/78

Page 35: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

CP Langages and Libraries

ALICE [Jean-Louis Laurière, 1976] First CP approach

CHIP, Prolog V, Gnu-Prolog, Picat Extensions of Prolog

CHOCO (Java), Gecode (C++), OR-Tools (C++) Open source libraries

OPL Development Studio (IBM) Modelling language + CP + MIP

...

26/78

Page 36: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Example: Choco code for the TSP

27/78

Page 37: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Example: OPL model for the ATSP

Input Data:1 range Points = 1..nbPoints;2 int duree[Points][Points] =...

Variables :1 dvar int visit[Points] in Points; /* visit[i] = ième point visité */2 dvar int h[Points] in T; /* h[i] = heure d’arrivée sur i */

Objective function to optimize and constraints:1 minimize h[vfinal ];2 subject to {3 visit[1] == vinit ; /* On part de vinit */4 h[vinit ] == t0; /* à l’heure t0 */5 visit[nbPoints] == vfinal ; /* et on termine sur vfinal */6 allDifferent(visit); /* Chaque point est visité une fois */7 forall(i ∈ 1..nbPoints − 1){8 h[visit[i+1]] == h[visit[i]] + duree[visit[i]][visit[i+1]]9 }

10 }

28/78

Page 38: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Generic Solving Algorithm

1 Function solve(X ,D,C)Input : A CSP (X ,D,C)Precondition : (X ,D,C) is locally consistentPostcondition : Return a solution of (X ,D,C) or ∅ if no solution

2 if for each variable xi ∈ X , |D(xi )| = 1 then return D;3 Choose a variable xi ∈ X such that |D(xi )| > 14 for each value v ∈ D(xi ) do5 Save D and reduce D(xi ) to {v}6 if (X ,D,C) is locally consistent then7 Sol ← solve(X ,D,C)8 if Sol 6= ∅ then return Sol ;

9 Restore D

10 return ∅

Local consistency of a CSP (X ,D,C)

Check that each constraint can be satisfiedDifferent levels of consistency may be consideredSimplest consistency: check constraints whose variables have singletondomains

29/78

Page 39: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Generic Solving Algorithm

1 Function solve(X ,D,C)Input : A CSP (X ,D,C)Precondition : (X ,D,C) is locally consistentPostcondition : Return a solution of (X ,D,C) or ∅ if no solution

2 if for each variable xi ∈ X , |D(xi )| = 1 then return D;3 Choose a variable xi ∈ X such that |D(xi )| > 14 for each value v ∈ D(xi ) do5 Save D and reduce D(xi ) to {v}6 if (X ,D,C) is locally consistent then7 Sol ← solve(X ,D,C)8 if Sol 6= ∅ then return Sol ;

9 Restore D

10 return ∅

Local consistency of a CSP (X ,D,C)

Check that each constraint can be satisfiedDifferent levels of consistency may be consideredSimplest consistency: check constraints whose variables have singletondomains

29/78

Page 40: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Exercise

Map coloring: CSP:

X = {F ,E ,S, I}

D(F ) = {b, v},D(E) = {b, j , r , v},D(S) = D(I) = {b, r}

C = {F 6= E ,F 6= S,F 6= I,S 6= I}

Build the search tree (tree of the recursive calls to solve) Choose variables according to the order: F ,E ,S, I

30/78

Page 41: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Improvements of solve: Constraint propagation

Why propagating constraints?

Avoid encoutering several times a same inconsistency Filter domains to ensure some given consistency No recursive call if a domain is empty

Different consistency levels may be considered: Arc Consistency (AC),k-consistency, Singleton AC, etc Different strengthes and different complexities

Most popular consistency: AC

Let c be a constraint defined over a set Xc of k variables. c is AC if:∀xi ∈ Xc ,∀vi ∈ D(xi ),∀xj ∈ Xc \ {xi},∃vj ∈ D(xj ) such that c is satisfiedby the assignment x1 = v1, ..., xk = vk

Different algorithms for ensuring AC

AC3 (binary constraints): O(ed3) in time; O(e) in spaceAC2001 (binary constraints): O(ed2) in time; O(ed) in spaceSTR: O(t) in time and space (t = number of allowed tuples)

31/78

Page 42: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Exercise

CSP associated with map coloring (recall):

X = {F ,E ,S, I}

D(F ) = {b, v}, D(E) = {v}, D(S) = D(I) = {b, r}

C = {F 6= E ,F 6= S,F 6= I,S 6= I}

Filter domains to ensure AC

32/78

Page 43: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Improvements of solve: Learning from failures

What can we do when a domain becomes empty?

backtrack: Go back to the last call

backjump: Go back to the call that assigned the last variable involved inthe failure

Learn nogoods: Add the failure cause to constraints

Example

X = {x1, x2, x3, x4, x5}

D(x1) = {5,6}, D(x2) = {2,3}, D(x3) = {3,4}, D(x4) = D(x5) = {4,5}

All variables must be assigned to different values

33/78

Page 44: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Improvements of solve: Ordering heuristics

1 Function solve(X ,D,C)2 if for each variable xi ∈ X , |D(xi )| = 1 then return D;3 Choose a variable xi ∈ X such that |D(xi )| > 14 for each value v ∈ D(xi ) do5 Save D and reduce D(xi ) to {v}6 if (X ,D,C) locally consistent then7 Sol ← solve(X ,D,C)8 if Sol 6= ∅ then return Sol ;

9 Restore D

10 return ∅

Variable ordering heuristics

deg: Variable involved in the largest number of constraints Reduce tree depthdom: Variable with the smallest domain Reduces tree widthdomdeg : Compromise between dom and degdomwdeg : Each constraint has a weight (incremented on failures) divide |D(xi )| by sum of weights of constraints associated with xi

Value ordering heuristics

Choose values that are more likely to belong to solutions No universal heuristic

May be learnt... but this may be expensive

Useless for proving inconsistency of infeasible instances

95% of the solving time is spent on inconsistent sub-trees

34/78

Page 45: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Improvements of solve: Ordering heuristics

1 Function solve(X ,D,C)2 if for each variable xi ∈ X , |D(xi )| = 1 then return D;3 Choose a variable xi ∈ X such that |D(xi )| > 14 for each value v ∈ D(xi ) do5 Save D and reduce D(xi ) to {v}6 if (X ,D,C) locally consistent then7 Sol ← solve(X ,D,C)8 if Sol 6= ∅ then return Sol ;

9 Restore D

10 return ∅

Value ordering heuristics

Choose values that are more likely to belong to solutions No universal heuristic

May be learnt... but this may be expensive

Useless for proving inconsistency of infeasible instances

95% of the solving time is spent on inconsistent sub-trees

34/78

Page 46: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Global constraints

What is a global constraint?

Constraint defined over a set of constraints (the cardinality of which is notfixed)

Examples of global constraints:

allDifferent(x1, . . . , xn)

sum(x1, . . . , xn, s)

atLeast(x1, . . . , xn, k , v)

Why global constraints?

Ease modelling

Improve propagation: filter more values and/or reduce time complexity

35/78

Page 47: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Decomposition of global constraints

How to decompose a global constraint?

Replace the constraint with an equivalent set of non global constraints

Example 1: allDifferent(x1, . . . , xn)

∀i , j ∈ [1,n], i 6= j : xi 6= xj

Example 2: atLeast(x1, . . . , xn, k , v)

Introduction of n new variables s1, . . . , sn tq D(xi ) = [0, i]s1 = (x1 == v)∀i ∈ [2,n] : si = si−1 + (xi == v)sn ≥ k

Example 3: sum(x1, . . . , xn, s)

Introduction of n new variables s1, . . . , sns1 = x1∀i ∈ [2,n] : si = si−1 + xis = sn

36/78

Page 48: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Propagation of global constraints

AC-decomposable constraintThere exists a polynomial size decomposition such that the decomposition isAC iff the global constraint is AC

Example: atLeast(x1, . . . , xn, k , v) is AC-decomposable

Propagating the constraints si = si−1 + (xi == v) filters the same values aspropagating atLeast(x1, . . . , xn, k , v), but more efficiently

Example: sum(x1, . . . , xn, s) is not AC-decomposable

Proof: deciding if an instance of sum is AC is an NP-hard problem

What about allDifferent?The binary decomposition filters less valuesDeciding if an instance of allDifferent is AC is in PCan we find a decomposition that preserves AC? No!

37/78

Page 49: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Dedicated filtering algorithms

What can we do when a constraint is neither NP-hard norAC-decomposable?

Implement a propagation algorithm that ensures AC in polynomial time!

Propagation of allDifferent

Matching algorithm of Hopcroft and Karp (1973)

Figure from Christian Bessière

allDifferent(x1, x2, x3, x4)

D(x1) = {1,2,4}

D(x2) = {2,3}

D(x3) = {2,3}

D(x4) = {3,4,5}

38/78

Page 50: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Dedicated filtering algorithms

What can we do when a constraint is neither NP-hard norAC-decomposable?

Implement a propagation algorithm that ensures AC in polynomial time!

Propagation of allDifferent

Matching algorithm of Hopcroft and Karp (1973)

Figure from Christian Bessière

allDifferent(x1, x2, x3, x4)

D(x1) = {1,2,4} remove 2 from D(x1)

D(x2) = {2,3}

D(x3) = {2,3}

D(x4) = {3,4,5} remove 3 from D(x4)

38/78

Page 51: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

39/78

Page 52: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Context of this work

ASTRAL project [2014-2017]:

Funded by IMU LabEx

Partners: LICIT (IFSTTAR), LIRIS, and Métropole de Lyon

Goal: Design predictive models for traffic forecasting in city centres

PhD thesis of Julien Salotti (defended in 2019):

Co-supervised with R. Billot, N.-E. El Faouzzi, and S. Fenet

Contributions:

Experimental evaluation of predictive modelsIntegration of causal information in predictive models

40/78

Page 53: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

How to measure traffic conditions?

Floating Car Data:

Positions are measured by GPS Spatio-temporal trajectories

(Image from Romain Billot)

Scanner Bluetooth :

Telephones, Computers, etc

Scanner (Distance ∼ 100m) : CollectMAC addresses, date et duration (Image Romain Billot)

Electro-magnetic sensor:

Physical detection of vehicles

41/78

Page 54: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Data coming from electro-magnetic sensors

Dataset provided by Lyon Metropole:

634 sensorsMeasures every 6 minutes :

Flow: Number of vehicles per timeperiodDensity: Number of vehicles perroad segment

Fundamental diagram:

Estimate speed given flow and density:

Fluid traffic: flow increases whendensity increases

Congested traffic: flow decreaseswhen density increases

Image [Buisson et Lesort]

42/78

Page 55: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Flow measured by sensors 1 (top) and 27 (bottom):Monday 01/14/2013 Wednesday 01/16/2013 Friday 01/18/2013 Sunday 01/20/2013

0

200

400

600

800

1000

1200

1400

1600

1800

0 50 100 150 200 250

Débit capteur 1 - 14 janvier 2013 0

200

400

600

800

1000

1200

1400

1600

1800

0 50 100 150 200 250

Débit capteur 1 - 16 janvier 2013 0

200

400

600

800

1000

1200

1400

1600

1800

0 50 100 150 200 250

Débit capteur 1 - 18 janvier 2013 0

200

400

600

800

1000

1200

1400

1600

1800

0 50 100 150 200 250

Débit capteur 1 - 20 janvier 2013

0

200

400

600

800

1000

1200

1400

1600

0 50 100 150 200 250

Débit capteur 1 - 14 janvier 2013 0

200

400

600

800

1000

1200

1400

0 50 100 150 200 250

Débit capteur 1 - 16 janvier 2013 0

200

400

600

800

1000

1200

1400

1600

0 50 100 150 200 250

Débit capteur 1 - 18 janvier 2013 0

100

200

300

400

500

600

700

800

900

1000

1100

0 50 100 150 200 250

Débit capteur 1 - 20 janvier 2013

Density measured by sensors 1 (top) and 27 (bottom):Monday 01/14/2013 Wednesday 01/16/2013 Friday 01/18/2013 Sunday 01/20/2013

0

5

10

15

20

25

30

35

0 50 100 150 200 250

Taux occupation capteur 1 - 14 janvier 2013 0

10

20

30

40

50

60

70

0 50 100 150 200 250

Taux occupation capteur 1 - 16 janvier 2013 0

5

10

15

20

25

30

0 50 100 150 200 250

Taux occupation capteur 1 - 18 janvier 2013 0

2

4

6

8

10

12

14

16

18

20

0 50 100 150 200 250

Taux occupation capteur 1 - 20 janvier 2013

0

10

20

30

40

50

60

0 50 100 150 200 250

Taux occupation capteur 1 - 14 janvier 2013 0

10

20

30

40

50

60

0 50 100 150 200 250

Taux occupation capteur 1 - 16 janvier 2013 0

10

20

30

40

50

60

0 50 100 150 200 250

Taux occupation capteur 1 - 18 janvier 2013 0

1

2

3

4

5

6

7

8

9

0 50 100 150 200 250

Taux occupation capteur 1 - 20 janvier 201343/78

Page 56: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: short term predictions (less than 1 hour)

Compared approaches:Univariate (U) vs Multivariate (M)Variable selection (S)Linear (L) vs Non Linear (NL)

Méthode L NL U M SARIMA x xVAR x xLASSO x x

kNN-uni x xkNN-multi x xkNN-Lasso x xkNN-TigSB x xSVR-RBF-uni x xSVR-RBF-multi x xSVR-RBF-Lasso x x

Mean Absolute ScaledError (MASE) :

1 2 3 4 50.7

0.8

0.9

1.0

1.1

1.2

1.3

MA

SE

 (fo

r Ly

on d

atas

et)

Method

LassoVARARIMA

44/78

Page 57: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: short term predictions (less than 1 hour)

Compared approaches:Univariate (U) vs Multivariate (M)Variable selection (S)Linear (L) vs Non Linear (NL)

Méthode L NL U M SARIMA x xVAR x xLASSO x xkNN-uni x xkNN-multi x xkNN-Lasso x xkNN-TigSB x x

SVR-RBF-uni x xSVR-RBF-multi x xSVR-RBF-Lasso x x

Mean Absolute ScaledError (MASE) :

1 2 3 4 50.7

0.8

0.9

1.0

1.1

1.2

1.3Method

KNN­MultiKNN­LassoKNN­TigSBKNN­Uni

44/78

Page 58: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: short term predictions (less than 1 hour)

Compared approaches:Univariate (U) vs Multivariate (M)Variable selection (S)Linear (L) vs Non Linear (NL)

Méthode L NL U M SARIMA x xVAR x xLASSO x xkNN-uni x xkNN-multi x xkNN-Lasso x xkNN-TigSB x xSVR-RBF-uni x xSVR-RBF-multi x xSVR-RBF-Lasso x x

Mean Absolute ScaledError (MASE) :

1 2 3 4 50.7

0.8

0.9

1.0

1.1

1.2

1.3Method

SVR­RBF­LassoSVR­RBF­MultiSVR­RBF­Uni

44/78

Page 59: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: short term predictions (less than 1 hour)

Compared approaches:Univariate (U) vs Multivariate (M)Variable selection (S)Linear (L) vs Non Linear (NL)

Méthode L NL U M SARIMA x xVAR x xLASSO x xkNN-uni x xkNN-multi x xkNN-Lasso x xkNN-TigSB x xSVR-RBF-uni x xSVR-RBF-multi x xSVR-RBF-Lasso x x

Mean Absolute ScaledError (MASE) :

1 2 3 4 50.7

0.8

0.9

1.0

1.1

1.2

1.3Method

KNN­MultiSVR­RBF­LassoLassoSVR­RBF­Uni

44/78

Page 60: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: short term predictions (less than 1 hour)

Examples of forecasting (with kNN-mul):

45/78

Page 61: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Predictive models: long term predictions

Clustering of days for each sensor:

Group days with similar time seriesMay be done manually or automatically

Build a representative time series for each cluster:

For each time step, search for a representative value For example, the median

Example: Median flow (blue) over 20 days (green) for two sensors

46/78

Page 62: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Representation of predictive models for temporal series

Temporal serie = one measure per time step (e.g., 6 minutes):

Val

eur

Temps

MesureFonction continue

Models = one prevision per time step

Representation with piecewiselinear functions:

Temps

Val

eur

Representation with piecewiseconstant functions:

Temps

Val

eur

47/78

Page 63: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

How to exploit these predictions to optimise delivery tours?

When preparing the tour (the day before):

Minimize tour durations by exploiting speed predictions

Take into account the fact that speed is not constant through the day

Optimisation with Time-Dependent (TD) Data

While performing the delivery tour:

Adapt the tour if observed speeds are different from predicted ones(unexpected events)

Anticipate on likely events by exploiting statistics on past events

Optimisation with Uncertain Data

48/78

Page 64: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

49/78

Page 65: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Context of this work

PhD thesis of Penélope Aguiar Melgarejo (defended in 2016):

Funded by IBM and co-supervised with Philippe Laborie (IBM)Algorithms for optimizing with Time-Dependent Data

Computation of the duration of a pathSearch of shortest pathsSolving the TD-ATSP with CP

Internship of Matthis Manthe (3IF, 2018):

Algorithms for the TD-ATSP

Post-doc of Omar Rifki (2018/2019):

Funded by IMU and co-supervised with Nicolas Chiabaut (LICIT)Experimental evaluation on realistic datasets

50/78

Page 66: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Definition of the problem

Input Data:

A set S of delivery points and a depot v0

A starting time t0For each road segment (i , j) and each time t :d t

ij = duration of travelling from i to j when leaving i at time t

Output:

A sequence of road segments that:Starts from v0, visits each point of S, and returns to v0

Minimises the arrival time when leaving v0 at t0

Solution process in two steps:1 Compute quickest paths for each possible starting time TD cost function for each couple of delivery points

2 Solve the TD-ATSP

51/78

Page 67: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Computation of quickest paths with TD data

Extension of Dijkstra to TD data:1 Function Dijkstra-TD(g,d , t0, s0)2 for each vertex si do h[si ]← +∞;3 h[s0]← t0; Put all vertices of g in a priority queue F4 while F is not empty do5 remove from F the vertex si s.t. h[si ] is minimal6 for each vertex sj ∈ succ(si ) do7 if h[si ] + d(si , sj ,h[si ]) < h[sj ] then8 h[sj ]← h[si ] + d(si , sj ,h[si ])9 Update F

10 return h

Condition for Dijkstra to be correct?

Every subpath of an optimal pathmust be optimal

Is the condition satisfied whendurations are time-dependent?

52/78

Page 68: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Computation of quickest paths with TD data

Extension of Dijkstra to TD data:1 Function Dijkstra-TD(g,d , t0, s0)2 for each vertex si do h[si ]← +∞;3 h[s0]← t0; Put all vertices of g in a priority queue F4 while F is not empty do5 remove from F the vertex si s.t. h[si ] is minimal6 for each vertex sj ∈ succ(si ) do7 if h[si ] + d(si , sj ,h[si ]) < h[sj ] then8 h[sj ]← h[si ] + d(si , sj ,h[si ])9 Update F

10 return h

Condition for Dijkstra to be correct?

Every subpath of an optimal pathmust be optimal

Is the condition satisfied whendurations are time-dependent? 52/78

Page 69: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Computation of quickest paths with TD data

Extension of Dijkstra to TD data:1 Function Dijkstra-TD(g,d , t0, s0)2 for each vertex si do h[si ]← +∞;3 h[s0]← t0; Put all vertices of g in a priority queue F4 while F is not empty do5 remove from F the vertex si s.t. h[si ] is minimal6 for each vertex sj ∈ succ(si ) do7 if h[si ] + d(si , sj ,h[si ]) < h[sj ] then8 h[sj ]← h[si ] + d(si , sj ,h[si ])9 Update F

10 return h

Condition for Dijkstra to be correct?

Every subpath of an optimal pathmust be optimal

Is the condition satisfied whendurations are time-dependent?

2

1

1

10 if t ≤ 2 ; 1 else52/78

Page 70: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Computation of quickest paths with TD data

To ensure the correctness of Dijkstra, d must satisfy the FIFO property:

If t1 < t2 then t1 + d(i , j , t1) ≤ t2 + d(i , j , t2) We cannot arrive sooner if we leave later

If d is not FIFO, then searching for shortest paths is NP-hard

Example of non FIFO fct: How to make it FIFO?

53/78

Page 71: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Existing approaches for solving the TD-ATSP

Integer Linear Programming:

[Malandraki et al 92, Cordeau et al 2014, Montero et al 2017, Vu et al 2018]

Usually assume that deliveries have (tight) time-windows

Always evaluated on randomly generated data Most of the time, there are only 3 time steps

Does not scale well when there is no time-window and more than 3time-steps

Constraint Programming [PhD Melgarejo 2016]:

New global constraint TD-noOverlap (integrated within IBM CPO)

Evaluation on a new dataset that uses data coming from sensors Speeds on roads without sensors are interpolated

Does not scale well when there is no time-window

54/78

Page 72: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,i

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,i

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0

;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets?How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?

55/78

Page 73: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving TD-ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for TD-ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,it0

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,isp(j,S\{j})

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0 ;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets?How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?

55/78

Page 74: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,i

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,i

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0

;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets?How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?

55/78

Page 75: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,i

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,i

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0

;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets? Use a bit vector: i ∈ S ⇔ i th bit set to 1How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?

55/78

Page 76: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,i

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,i

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0

;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets?How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?

55/78

Page 77: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Dynamic Programming [Held & Karp 1962]

Bellman equations for ATSP:

∀i ∈ V ,∀S ⊆ V \ {0, i} : sp(i ,S) = length of the shortest path from 0 to i viaeach vertex of S

If S = ∅: sp(i ,S) = d0,i

If S 6= ∅: sp(i ,S) = minj∈Ssp(j ,S \ {j}) + dj,i

Iterative algorithm:1 for each vertex i ∈ V do sp[i][∅]← d0,i

t0

;2 for each subset S ⊆ V do3 for each vertex i ∈ V \ S do4 sp[i][S]← minj∈S sp[j][S \ {j}] + dj,i

sp[j][S\{j}]

5 return sp[0][V ]

Questions related to implementation:How to index an array on subsets?How to ensure that sp[j][S \ {j}] exists when computing sp[i][S] ?Line 2 = for (int S=1; S<(1 « (nbVertices-1)); S++)

55/78

Page 78: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving ATSP with Branch & Bound

1 Procedure BB(Seen,NotSeen)2 if NotSeen = ∅ then Update Best if Seen is better than Best ;3 else4 for each vertex i ∈ NotSeen do5 if bound(Seen, i ,NotSeen \ {i}) < Best then6 BB(Seen.〈i〉,NotSeen \ {i})

Bound = Solution of an assignment problem

Assign to each vertex j ∈ NotSeen a different vertex k ∈ NotSeen Minimise the sum of (j , k) arc costs

Solved in O(|NotSeen|3) with Munkres algorithm (aka Hungarian algo)

May be used as an ordering heuristic in the loop line 4

What is the cost of (j , k) if we don’t know at what time we leave j? Minimum cost for all possible starting times from j

56/78

Page 79: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving TD-ATSP with Branch & Bound

1 Procedure BB(Seen,NotSeen)2 if NotSeen = ∅ then Update Best if Seen is better than Best ;3 else4 for each vertex i ∈ NotSeen do5 if bound(Seen, i ,NotSeen \ {i}) < Best then6 BB(Seen.〈i〉,NotSeen \ {i})

Bound = Solution of an assignment problem

Assign to each vertex j ∈ NotSeen a different vertex k ∈ NotSeen Minimise the sum of (j , k) arc costs

Solved in O(|NotSeen|3) with Munkres algorithm (aka Hungarian algo)

May be used as an ordering heuristic in the loop line 4

What is the cost of (j , k) if we don’t know at what time we leave j? Minimum cost for all possible starting times from j

56/78

Page 80: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Solving TD-ATSP with Limited Discrepancy Search

1 Procedure BB(Seen,NotSeen)2 if NotSeen = ∅ then Update Best if Seen is better than Best ;3 else4 for each vertex i ∈ NotSeen do5 if bound(Seen, i ,NotSeen \ {i}) < Best and discrepancy < d then6 BB(Seen.〈i〉,NotSeen \ {i})

Bound = Solution of an assignment problem

Assign to each vertex j ∈ NotSeen a different vertex k ∈ NotSeen Minimise the sum of (j , k) arc costs

Solved in O(|NotSeen|3) with Munkres algorithm (aka Hungarian algo)

May be used as an ordering heuristic in the loop line 4

What is the cost of (j , k) if we don’t know at what time we leave j? Minimum cost for all possible starting times from j

56/78

Page 81: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Construction of a realistic benchmark

Simulated data (SymuVia, LICIT [Post-doc O. Rifki, 2019]):

For each n ∈ {10,20,30,50}, generation of 10 instances Random choice of n addressesDifferent levels of sensor coverage:

DLyon: real sensor positions (cover=7%)Dσ with σ ∈ {10,20, ...,100}: cover=σ% (evenly distributed)

Values for uncovered road segments are interpolatedDifferent time-step length l ∈ {6,12,24,60,720} (l = 720⇔ static case)

57/78

Page 82: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Question 1: Scale-up properties with respect to n ?n DP B&B LDS

d = 0.1 d = 0.2 d = 0.5proof best proof best gap best gap best gap

10 0.0 0.0 0.0 0.0 1.5 0.0 1.1 0.0 0.320 0.4 1.6 6.4 0.0 4.6 0.0 2.4 0.1 0.730 862.6 >753.4 >1584.1 0.0 3.0 0.2 2.2 5.9 0.5

n = 50 :

58/78

Page 83: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Question 1: Scale-up properties with respect to n ?n DP B&B LDS

d = 0.1 d = 0.2 d = 0.5proof best proof best gap best gap best gap

10 0.0 0.0 0.0 0.0 1.5 0.0 1.1 0.0 0.320 0.4 1.6 6.4 0.0 4.6 0.0 2.4 0.1 0.730 862.6 >753.4 >1584.1 0.0 3.0 0.2 2.2 5.9 0.5

n = 50 :

58/78

Page 84: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Question 2: What is the impact of l and σ on tour quality? Illustration on an artificial example

3

0 2

1

1st time-step of 6mn

4

2

5 2

34

3

0 2

1

2nd time-step of 6mn

4

6

5 2

38

3

0 2

1

1st time-step of 12mn

4

4

5 2

36

Best : T 6 = 〈0,3,1,2,0〉Arrival time at6(T 6) = 12

Best : T 12 = 〈0,1,2,3,0〉Arrival time at12(T 12) = 14

How to compare tours optimized on different data?

Evaluate all tour lengths with a same cost function Use the cost fct which is the closest to real conditions⇒ l=6mn σ=100%

Arrival times: at6(T 6) = 12; at6(T 12) = 16Gap (in %) between at6(T 12) and at6(T 6) = 16−12

12 ∗ 100 = 33%

59/78

Page 85: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Question 2: What is the impact of l and σ on tour quality? Illustration on an artificial example

3

0 2

1

1st time-step of 6mn

4

2

5 2

34

3

0 2

1

2nd time-step of 6mn

4

6

5 2

38

3

0 2

1

1st time-step of 12mn

4

4

5 2

36

Best : T 6 = 〈0,3,1,2,0〉Arrival time at6(T 6) = 12

Best : T 12 = 〈0,1,2,3,0〉Arrival time at12(T 12) = 14

How to compare tours optimized on different data?

Evaluate all tour lengths with a same cost function Use the cost fct which is the closest to real conditions⇒ l=6mn σ=100%

Arrival times: at6(T 6) = 12; at6(T 12) = 16Gap (in %) between at6(T 12) and at6(T 6) = 16−12

12 ∗ 100 = 33%

59/78

Page 86: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Question 2: What is the impact of l and σ on tour quality? Illustration on an artificial example

3

0 2

1

1st time-step of 6mn

4

2

5 2

34

3

0 2

1

2nd time-step of 6mn

4

6

5 2

38

3

0 2

1

1st time-step of 12mn

4

4

5 2

36

Best : T 6 = 〈0,3,1,2,0〉Arrival time at6(T 6) = 12

Best : T 12 = 〈0,1,2,3,0〉Arrival time at12(T 12) = 14

How to compare tours optimized on different data?

Evaluate all tour lengths with a same cost function Use the cost fct which is the closest to real conditions⇒ l=6mn σ=100%

Arrival times: at6(T 6) = 12; at6(T 12) = 16Gap (in %) between at6(T 12) and at6(T 6) = 16−12

12 ∗ 100 = 33%59/78

Page 87: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Impact of l and σ on solution quality

Conclusions:

The impact of l and σ increases when increasing the number n ofdeliveries

It is worth exploiting TD data when σ = 100%: Tours computed withl = 720mn are 8% as long as those computed with l = 6mn when n = 30

Interpolation doesn’t allow to compute good approximations of speed:Tours computed with σ = 10% are 9% as long as those computed withσ = 100% when n = 30 and l = 6mn

60/78

Page 88: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

What about the actual sensor positions in Lyon?

When considering actual sensor positions, tours computed with TDdata are not better than tours computed with static data

61/78

Page 89: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Conclusions

The TD-TSP is much more challenging than the TSP

The best exact approach is DP, but it cannot be used when n > 30 Use heuristic approaches when n > 30

Is it worth exploiting time-dependent data?

Yes, if sensors are evenly and densely distributed......and if we assume that we have a perfect predictive model!

No, if we consider the actual sensor positions in Lyon

Further work:Improve TD-data:

Where should we position sensors?Can we find better predictors than interpolation for road segmentswithout sensors?

Improve scale-up properties of algorithms for TD-TSPExperimental evaluation in the case of additional constraints(time-windows, capacity, precedence, etc)

62/78

Page 90: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

63/78

Page 91: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Motivations

Optimisation with Data coming from predictive models:

A prediction may be wrongWhat should we do in this case?

Some predictions are more reliablethan others

Can we anticipate with respect tolikely events?

Context of this work:PhD thesis of Michael Saint Guillain defended in 2019 (co-tutelle withLouvain-la-neuve, Belgium, co-supervised with Yves Deville)

64/78

Page 92: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Classical optimisation problems

Problems are defined by means of:

Input DataDecision variables (X ) and their domains (D)Constraints to be satisfied (C)Objective function to optimise (F )

Solution:Assign values to variables so that all constraints are satisfied and theobjective function is optimal

What can we do when observed Data 6= input Data?

Recompute a new solution wrt new DataDrawbacks:

Re-computation is time consumingThe new solution may be much worse than the one computed byanticipating wrt likely events

65/78

Page 93: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Stochastic Optimisation Problems

Stochastic problems are defined by means of:

Input Data known with certaintyUncertain input Data = Random variablesDecision variables (X ) and their domains (D)Constraints to be satisfied (C)Objective function to optimise (F )

Example: VRP with stochastic demands

Certain data: points to deliver, distances, vehiclecapacityUncertain data: demandsProbability distributions of demands:

p(rA = 2) = p(rB = 2) = p(rD = 1) = 1p(rC = 1) = 1

3 , p(rC = 8) = 13 ,p(rC = 9) = 1

3

k=11

3

21

4

1

34

d

C:

5

1, 8 ou 9

3D:1

B:2

4

A:2

66/78

Page 94: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Robust solutions for stochastic optimisation problems

Ensure the feasibility of the solution wrt some given probability p:

Goal = Assign values to variables so that the objective function is optimal andthe probability that constraints are satisfied is greater than p

Example: Robust solutions for the VRP with stochastic demands

Robust solution wrt p = 1 :

Cout=16

4

d

4

2

C:1|8|9

3

1

D:1

A:2

3

4

1B:2

3

5

Robust solution wrt p = 23 :

4

4

d

1C:1|8|9

2

33

4

B:2

A:2 3

5

D:1

1

Cout=14

Stochastic Constraint Programming [Walsh 2009, Piette 2016]

Used for General Game Playing: WoodStock winner of IGGPC 201667/78

Page 95: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Flexible solutions for stochastic optimisation problems

Optimise the expected cost of adapted solutions:

Define an adaptation procedure to be applied when random variablesare realised = Simple (and fast) procedureBefore the beginning of random variable realisations (offline) :Compute an a priori solution = Assign values that optimise theexpectation of the objective function wrt the adaptation procedureEach time a random variable is realised (online) : Apply the adaptation procedure

Ex.: Adaptation procedure for the VRP with stochastic demands

Go back to the depot if current load + next demand > k

A priori Solution for k = 11 :

A:2

4

d

3

1

12

3

4

5

3

D:1

C:1|8|9B:2

4

Cout=12

Adapted solution if rC = 8 or 9 :C:8|9

4

d

1

3

4

1

3

2

5

3

D:1

B:2

4

Cout=16

A:2

68/78

Page 96: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Expectation Optimisation vs Average Problem Optimisation

Problem (recall):

Request probability distributions:p(rA = 2) = p(rB = 2) = p(rD = 1) = 1p(rC = 1) = 1

3 , p(rC = 8) = 13 ,p(rC = 9) = 1

3k=11

3

21

4

1

34

d

C:

5

1, 8 ou 9

3D:1

B:2

4

A:2

What if we consider the “average” problem (i.e. rC =6)?

Optimal solution:

A:2

4

d

2

3

1

3

1

4

5

3D:1

C:6B:2

4

Cout=10

Adaptation if rC =1

A:2

4

d

2

3

1

3

1

4

5

3D:1

B:2 C:1

4

Cout=10

Adapt. if rC ∈{8,9}C:8|9

4

d

2

3

1

3

4

1

5

3D:1

B:2

4

Cout=18

A:2

Expected cost = 10+18+183 = 46

3 . Can we do better?69/78

Page 97: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Expectation Optimisation vs Average Problem Optimisation

Problem (recall):

Request probability distributions:p(rA = 2) = p(rB = 2) = p(rD = 1) = 1p(rC = 1) = 1

3 , p(rC = 8) = 13 ,p(rC = 9) = 1

3k=11

3

21

4

1

34

d

C:

5

1, 8 ou 9

3D:1

B:2

4

A:2

Optimisation of the expected cost of adapted solutions:

A priori Solution:

A:2

4

d

3

1

12

3

4

5

3

D:1

C:1|8|9B:2

4

Cout=12

Adaptation if rC =1

A:2

4

d

3

1

12

3

4

5

3

C:1

D:1

B:2

4

Cout=12

Adapt. if rC ∈{8,9}C:8|9

4

d

1

3

4

1

3

2

5

3

D:1

B:2

4

Cout=16

A:2

Expected cost = 12+16+163 = 44

3 . That’s better!69/78

Page 98: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Expectation Optimisation vs Average Problem Optimisation

Problem (recall):

Request probability distributions:p(rA = 2) = p(rB = 2) = p(rD = 1) = 1p(rC = 1) = 1

3 , p(rC = 8) = 13 ,p(rC = 9) = 1

3k=11

3

21

4

1

34

d

C:

5

1, 8 ou 9

3D:1

B:2

4

A:2

What if we have an oracle that knows the future?Optimal sol. if rC = 1

A:2

4

d

2

3

1

3

1

4

5

3D:1

B:2 C:1

4

Cout=10

Optimal sol. if rC = 8C:8

4

d

1

2

33

4

B:2

A:2 3

5

D:1

1

Cout=14

4

Optimal sol. if rC = 9C:9

4

d

1

3

4

1

3

2

5

3

D:1

B:2

4

Cout=16

A:2

Expected cost = 10+14+163 = 40

3 . That’s even better, but oracles don’t exist!69/78

Page 99: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

How to compute the expected cost of an a priori solution Use Dynamic Programming

Example: Stochastic TSP

Incertain Data = Vertices to visit (some clients may be missing)Stochastic knowledge: Each vertex i is present with probability p(i) andmissing with probability 1− p(i)A priori solution: Hamiltonian cycle (v0, v1, . . . , vn, v0)

Adaptation: Skip vertices associated with missing clients

Bellman equations to compute the expected cost:

Let e(vi ) = expected length of the adaptation of (vi , vi+1, . . . , vn, v0)

If i = n, then e(vi ) = dvi ,v0

Otherwise, e(vi ) =∑n

j=i+1 Pr(vi , vj ) ∗ (dvi ,vj + e(vj ))

Pr(vi , vj ) = proba that vj is present and vi+1, . . . , vj−1 are missing Pr(vi , vj ) = (1− p(vi+1)) ∗ . . . ∗ (1− p(vj−1)) ∗ p(vj )

Expectation of an a priori solution = e(v0) computed in O(n2)

Problem: Not always possible to find Bellman’s equations... 70/78

Page 100: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

How to compute the expected cost of an a priori solution Use Monte Carlo sampling

Expected cost of an a priori solution A =∑

s∈S Pr(s) · costA(s)

S is the set of all possible scenarioscostA(s) = cost of A adapted to s

Example: Expectation of the length of a tour for the Stochastic TSP

Scenario = subset of vertices (corresponding to present clients)For each subset s ⊆ V :

Probability of s = Πi∈Sp(i) ∗ Πi∈V\S(1− p(i))costA(s) = length of the subcycle of A that only contains nodes of s

Problem: The number of scenarios is exponential

Approximation with Monte-Carlo Sampling:

Generate a representative subset of scenarios using probabilitiesFor each sampled scenario, compute the cost of the adapted solutionReturn the average cost

71/78

Page 101: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Computation of an a priori solution with optimal expected cost

Exact approach: Branch & Cut (Integer L-shaped method)

Drop some constraints (integrality, subtour elimination, etc)Replace the non-linear obj. function by a lower bounding variable zIterate:

Solve the current problemAdd feasibility cuts if dropped constraints are violatedAdd optimality cuts if z < actual expected cost

Meta-Heuristic approaches (most often, local search-based):

Generate an initial a priori solutionWhile termination conditions not reached:

Change the values of some decision var. wrt some heuristics(6= possible heuristics: greedy, simulated annealing, tabu, etc)Evaluate the impact on the expected costAccept or not the changes wrt some meta-heuristics

Return the best a priori solution

72/78

Page 102: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Application to Police Patrol Management in Brussel

Description of the problem:

Requests are revealed during the day, and must all be acceptedGoal: Minimise service time expectation

Historical Data from 2013 to 2017: Evolution of request localisation wrt time

73/78

Page 103: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Introduction of waiting vertices and waiting times

Example of a priori solution: Example of adapted solution:

New algorithms:

Dyn. prog. to compute exp. cost in O(n2h3q) time and O(nh2q) space(n = nb of vertices, h = nb of time steps, q = max. capacity)

Local Search approach to compute an approximate a priori solution

74/78

Page 104: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Choice of locations by spatial clustering

Waiting locations (∈ {150,100,50}):

75/78

Page 105: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Results

Average relative gain wrt Wait & Serve strategy:

Nb of waiting locations50 100 150 Wait & Serve

3 vehicles 18.6% 17.0% 19.1% 11.6 mn4 vehicles 25.4% 26.2% 28.1% 10.3 mn6 vehicles 38.6% 39.3% 38.1% 10.0 mn

Conclusions:

Exploiting stochastic knowledge allows to reduce service time

Gain increases when increasing the number of vehicles

Gain doesn’t increase with the number of waiting locations Increasing the nb of waiting locations increases the search space size

76/78

Page 106: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Prescriptive Data Analytics

1 Prescriptive Analytics and Smart Cities

2 Parenthesis on Constrained Optimization

3 What data for Smart Deliveries ?

4 Optimisation with Time-Dependent Data

5 Optimisation with uncertain data

6 Conclusion

77/78

Page 107: Prescriptive Data Analytics - Centre national de la ... · Prescriptive Data Analytics 1 Prescriptive Analytics and Smart Cities 2 Parenthesis on Constrained Optimization 3 What data

Conclusion

How to exploit huge amounts of sensed Data?

Descriptive analytics to understand

Predictive analytics to forecast

Prescriptive analytics to optimise

Time-Dependent optimisation for temporal DataStochastic optimisation for uncertain Data

Where are the challenges?

NP-hard problems for which complete approaches hardly scale

Need accurate, reliable, and available Data Privacy and sustainability issues

Citizens must be ready to use these smart services... or smart services should adapt themselves to citizens!

Hot multidisciplinary research field!

78/78