Top Banner
Planning with Resources Philippe Laborie [email protected] ILOG
234

Planning with Resources

Jan 13, 2016

Download

Documents

Bart

Planning with Resources. Philippe Laborie [email protected] ILOG. Foreword. Applications of AI Planning. Aerospace Space - Satellite, Launcher manufacturing - Launch site operations - Spacecraft operations - Space users - Autonomous space exploration Aviation - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Planning with Resources

Planning with Resources

Philippe [email protected]

Page 2: Planning with Resources

2 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

AerospaceSpace

- Satellite, Launcher manufacturing

- Launch site operations

- Spacecraft operations

- Space users

- Autonomous space exploration

Aviation

- Manufacturers and suppliers

- Airlines, Airports

- Maintenance and repair organizations

- Air Traffic Control

Foreword

Page 3: Planning with Resources

3 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

Defense

Military logistic applications

Rescue and Military operations planning

Non-combatant Evacuation Operations

Emergency Assistance

Air Campaign Planning

Army Unit Operations

Coalition Operations

Foreword

Page 4: Planning with Resources

4 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

New information technology

Planning & Scheduling for the Web

Workflow, Business Process Management

Systems Management Aids

Help Desks and Assistants

Personal Assistants

Data analysis tasks, Database query

Virtual reality or other simulated environments

Computer games (bridge)

Foreword

Page 5: Planning with Resources

5 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

Industry

Process planning

Factory automation

- Production line scheduling

- Assembly planning

- Maintenance planning

Electronic design and manufacturing

Logistics

Project planning

Construction planning

Engineering Tasks

Management Tasks

Foreword

Page 6: Planning with Resources

6 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

Civil Security and Environment Crisis Management

Evacuation Planning

Search & Rescue Coordination

Oil Spill Response

Medical ApplicationsBioinformatics

Personal Active Medical Assistant

Foreword

Page 7: Planning with Resources

7 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Applications of AI Planning

What most of these applications have in common ?

Foreword

Manufacturing: A grinding operation requires a grinding machine. The grinding machine can perform only one operation at a time. Only one grinding machine is available in the shop.

Project Management: In a web site development project, the task of testing browsers compatibility requires an effort of 6 person-months of a quality engineer. 5 quality engineers are available.

Satellite: When the satellite is not within range of a receiving station, it can store images on an onboard solid-state memory that provides a capacity of 90 Gbits (550 images).

Crisis Management: An aircraft B737-200 has a capacity to evacuate at most 120 people. Maximum cargo loading is 3,400kg for a volume of 14.3 m3. Maximal range of the aircraft is 2480km.

… they need the ability to reason about resources

Page 8: Planning with Resources

8 PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Planning with Resources

Part I. State of the Art Overview Definition of a Resource Problem Modeling Problem Solving

Part II. Focus on Constraint-Based Approaches Constraint-Programming Problem Modeling Problem Solving

Constraint Propagation Search

Overview

Page 9: Planning with Resources

Planning with Resources

Part I: State of the Art Overview

Page 10: Planning with Resources

10

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Definition of a Resource

A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it

State of the Art

Manufacturing: A grinding operation requires a grinding machine. The grinding machine can perform only one operation at a time. Only one grinding machine is available in the shop.

The grinding machine is a resource. It constrains the grinding operations to execute sequentially on the machine.

0

1

Grinding-op1 Grinding-op3 Grinding-op2 time

Page 11: Planning with Resources

11

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Definition of a Resource

A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it

State of the Art

The team of quality engineers is a resource. It constrains the number of tasks that can be executed in parallel and the duration of these tasks.

Project Management: In a web site development project, the task of testing browsers compatibility requires an effort of 6 person-months of a quality engineer. 5 quality engineers are available.

0

time2 engineers

3 months

Web-site-dev1

Test-software1

5

Page 12: Planning with Resources

12

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Definition of a Resource

A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it

State of the Art

The solid-state memory is a resource. It constrains the number of images that can be taken between two periods of visibility of the receiving station.

Satellite: When the satellite is not within range of a receiving station, it can store images on an onboard solid-state memory that provides a capacity of 90 Gbits (550 images).

0

550

timeSend-dataPic1 Pic2 Pic5 Pic3 Pic4

Page 13: Planning with Resources

13

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Definition of a Resource

A resource is any substance or (set of) object(s) whose cost or available quantity induce some constraint on the operations that use it

State of the Art

The seat capacity of the B737-20 is a resource. It constrains the number of people the plane can evacuate in a single flight. The cargo capacity of the B737-20 is another resource. It constrains the weight the aircraft can transport in a single flight. Etc...

Crisis Management: An aircraft B737-200 has a capacity to evacuate at most 120 people. Maximum cargo loading is 3,400kg for a volume of 14.3 m3. Maximal range of the aircraft is 2480km.

0

3400

timeLoad-truck Load-car Unload-car Unload-truck

Page 14: Planning with Resources

14

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

Resources Typology

Unary resource: Resource of capacity 1. Two activities requiring the same unary resource cannot overlap

Discrete resource: Resource of capacity Q. Activities requiring the same discrete resource can overlap provided the resource capacity Q is not exceeded

Reservoir: Resource of capacity Q and initial level L; Activities may consume or produce the reservoir. The level of the reservoir over time must be kept in the interval [0,Q]

Page 15: Planning with Resources

15

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

unary resource availability

0

1

timeOp1 Op2

Page 16: Planning with Resources

16

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

discrete resource availability

0

Q

timeOp1

Op2

Page 17: Planning with Resources

17

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

In theory, a discrete resource of maximal capacity Q can be represented as Q unary resources

Op1 {R1,…,Ri,…,Rj,…,RQ}

Opi {R1,…,Ri,…,Rj,…,RQ}

Opj {R1,…,Ri,…,Rj,…,RQ}

OpQ {R1,…,Ri,…,Rj,…,RQ}

OpQ+1 {R1,…,Ri,…,Rj,…,RQ}

No solution after trying Q! allocations

Page 18: Planning with Resources

18

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

reservoir level

0

Q

timeOp1

Op2

Op3

Page 19: Planning with Resources

19

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

Resources are tightly linked with the notions of time & concurrency For unary and discrete resources, activities use the

resource over some time interval Handling parallel execution of activities is necessary to

take advantage of non-unitary capacities There may exist complex relations linking the duration

of an activity with the amount of resource it uses, consumes and/or produces

Page 20: Planning with Resources

20

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

Resources may impose other constraints than just capacity State constraints : two activities requiring the resource

to be in incompatible states cannot overlap Minimal transition time between two consecutive

activities using the same unary resource Batching: two overlapping activities using the same

resource must start and end at the same time These additional constraints can generally be

expressed by classical planning predicates

Page 21: Planning with Resources

21

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Definition of a Resource

So … the hard point for planning with resources is mainly the management of Numerical time and Numerical capacity/availability

Page 22: Planning with Resources

22

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling: STRIPS

How hard is it to model time and capacities in STRIPS ? Exercise. Build a STRIPS model for the following

domain

A task to test a web-site lasts for 3 months and requires 2 quality engineers (out of 5 available). As a result of the task, the web-site is tested. Other tasks also have duration and compete for the same resource. The model must correctly handle task parallelism.

State of the Art

Page 23: Planning with Resources

23

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #1: Numerical quantities No integer arithmetic is available in STRIPS. We need

to provide one. In domain description

(:predicates (plus ?i ?j ?k))

In problem definition

(:objects _0 _1 _2 _3 _4 _5 _6 _7 _8 … )

(:init (plus _0 _1 _1)(plus _1 _1 _2)(plus _2 _1 _3) …

(plus _0 _2 _2)(plus _1 _2 _3)(plus _2 _2 _4) … )

State of the Art

Page 24: Planning with Resources

24

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #1: Numerical quantities No integer arithmetic is available in STRIPS. We need

to provide one. Example of action that increase a quantity

(:action IncreaseQuantity :parameters (?i ?d ?j) :precondition (and (quantity ?i) (plus ?i ?d ?j)) ; ?j == ?i + ?d :effect (and (not (quantity ?i))

(quantity ?j)))

State of the Art

Page 25: Planning with Resources

25

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #2: Discrete Resource The task is a time interval over which the resource is

used. Two actions to represent the task

(:action TestWebSite-Start :parameters (?q2 ?q0) :precondition (and (free-engineers ?q2) (plus ?q0 _2 ?q2))

:effect (and (not (free-engineers ?q2)) (free-engineers ?q0)))

State of the Art

Page 26: Planning with Resources

26

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #2: Discrete Resource The task is a time interval over which the resource is

used. Two actions to represent the task

(:action TestWebSite-End :parameters (?q0 ?q2) :precondition (and (free-engineers ?q0) (plus ?q0 _2 ?q2)) :effect (and (not (free-engineers ?q0))

(free-engineers ?q2)(web-site-tested)))

State of the Art

Page 27: Planning with Resources

27

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #2: Discrete Resource The task is a time interval over which the resource is

used. Initially, the amount of resource is 5:

(:init (free-engineers _5) … )

State of the Art

Page 28: Planning with Resources

28

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #3: Task Duration Use a predicate startedAtTask to record when the

task was started and a global clock clock to measure time

(:predicates (clock ?t)(testwebsite_started_at ?t) … )

(:action TestWebSite-Start :parameters (?t0 … ) :precondition (and (clock ?t0) … )

:effect (and (testwebsite_started_at ?t0) … ))

State of the Art

Page 29: Planning with Resources

29

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #3: Task Duration

(:action TestWebSite-End :parameters (?t3 ?t0 … ) :precondition (and (testwebsite_started_at ?t0)

(clock ?t3)(plus ?t0 _3 ?t3) … )

:effect (and (not (testwebsite_started_at ?t0) … )))

State of the Art

Page 30: Planning with Resources

30

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Difficulty #3: Task Duration Now we only need an action to increase time when

necessary:

(:action Tick :parameters (?t0 ?t1) :precondition (and (clock ?t0)

(plus ?t0 _1 t1)) :effect (and (not (clock ?t0))

(clock ?t1)))

We start at time 0:

(:init (clock I0) … )

State of the Art

Page 31: Planning with Resources

31

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Conclusion It is possible to represent time and resources in STRIPS BUT … the model is not completely intuitive

No built-in arithmetic A relative change on a resource (free-engineers -= 2) is

represented by two absolute changes:(DEL (free-engineers ?x)) (ADD (free-engineers ?x+2))

Representation of time is not natural (action TICK)

State of the Art

Page 32: Planning with Resources

32

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Conclusion A relative change on a resource is represented by two

absolute changes

State of the Art

(PRECOND (free-engineers ?x1)(plus ?x1 _1 ?x2)) (DEL (free-engineers ?x1)) (ADD (free-engineers ?x2))

(PRECOND (free-engineers ?y1)(plus ?y1 _1 ?y2)) (DEL (free-engineers ?y1)) (ADD (free-engineers ?y2))

MUTEX

Page 33: Planning with Resources

33

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : STRIPS

Conclusion AND what about the performances ?

State of the Art

150s580s

26s

TestWebSiteTest

SoftwareTraining

engineers

TestWebSite

TestSoftware

Training

Page 34: Planning with Resources

34

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling

Beyond STRIPS

Standalone languages

PDDL2.1 BTPL

Planning systems (language)

parcPLAN O-Plan

IXTET ASPEN

RAX-PS

State of the Art

Page 35: Planning with Resources

35

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : PDDL 2.1

PDDL 2.1 was developed for the AIPS-2002 Planning Competition [Fox&Long 2002]

Extension of PDDL [McDermott&al 1998] for domains involving time and other numeric-valued resources

PDDL 2.1 Level 1: “Classical” propositional planning Level 2: Numeric Variables Level 3: Durative actions, No continuous effects Level 4: Durative actions, continuous effects

Page 36: Planning with Resources

36

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : PDDL 2.1

Numeric variables

(:functions (free-engineers) )

(:action Hire :parameters ( ?n ) :precondition ( … )

:effect (and (increase (free-engineers) ?n) … ))

Page 37: Planning with Resources

37

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : PDDL 2.1

Numeric variables

Conditions:(= (f ?x) ?q)(< (f ?x) ?q) (> (f ?x) ?q)(<= (f ?x) ?q) (>= (f ?x) ?q)

Effects:(increase (f ?x) ?q) ; f(?x) += ?q(decrease (f ?x) ?q) ; f(?x) -= ?q (scale-up (f ?x) ?q) ; f(?x) *= ?q(scale-down (f ?x) ?q) ; f(?x) /= ?q(assign (f ?x) ?q) ; f(?x) = ?q

Page 38: Planning with Resources

38

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : PDDL 2.1

Durative actions

Action

Start Endduration

Conditionsat end

Effectsat end

Conditionsat start

Effectsat start

Invariant

Page 39: Planning with Resources

39

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : PDDL 2.1

Durative actions

(:functions (free-engineers) )

(:action TestWebSite :parameters ( )

:duration (= ?duration 3) :condition (and (at start (>= (free-engineers) 2)))

:effect (and (at start (decrease (free-engineers) 2))

(at end (increase (free-engineers) 2))

(at end (website_tested))))

Page 40: Planning with Resources

40

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : BTPL

Basic Temporal Planning Language [Brenner 2001] Extension of PDDL. Focus on time and concurrency. Whereas PDDL2.1 represents an action with two events

(start and end), BTPL allows for more complex actions involving several events

No relative changes on numerical attributes (increase/decrease) as in PDDL2.1

Page 41: Planning with Resources

41

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : BTPL

A BTPL ground action is a tuple a=(pre, eff) where pre are preconditions (set of literals)

eff = {ue1,..,uen} is a set of unit events of the form ue=(c,e,d) describing the (conditional) effects of A d: delay (rational number) c: condition of ue: set of literals to be satisfied at t+d e: effect of ue: add/delete list occurring at t+d

Apre

ue1

c1 e1d1

ue2

c2 e2d2

Page 42: Planning with Resources

42

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : BTPL

Example: ATM cash dispenser

DialCode(?x)(card_in ?y)

(code_ok ?x ?y)

5

(ticket)7

(cash-out)

10not (cash-out) not(card_in ?y)

TakeCash()(cash-out)

not(cash-out)(have_cash)1

InsertCard(?y)

(card_in ?y)

1

Page 43: Planning with Resources

43

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : BTPL

BTPL extension Allow expressing action preconditions (pre) and event

conditions (c) that hold over time intervals [t1,t2) before the action or event time-point.

pre: (p,d1,d2)

t-d2t-d1

A

ue ed

t

t’=t+d

c: (q,d3,d4)

t’-d4t’-d3

Page 44: Planning with Resources

44

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : parcPLAN

parcPLAN [Lever&Richards 1994, ElKholy&Richards 1996] Rich temporal expressivity based on time-intervals

whose extremities are time-point variables

E.g.: position(robot,r1)@(t1,t2) Expression of minimal/maximal delays between time

points

E.g.: t1+5 t2 Handle unary and discrete resources, no reservoir

Page 45: Planning with Resources

45

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : parcPLAN

Web-site project example

action develop(?website)@(start,end) { conditions:

designed(?website)@(t1,t2),implemented(?website)@(t3,t4),tested(?website)@(end,t);

effects:developped(?website)@(end,t);

constraints:designates(?website, WEBSITE),start <= t1 <= t2 <= t3 <= t4 <= end <= t,

end <= start + 18; }

Page 46: Planning with Resources

46

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : parcPLAN

Web-site project example

action test_in_company(?website)@(start,end){ effects: tested(?website)@(end,t); resources: requires(engineers(),2)@(start,end); constraints: designates(?website, WEBSITE),

end <= t, end = start + 3; }

action test_outsource(?website)@(start,end){ effects: tested(?website)@(end,t); constraints: designates(?website, WEBSITE),

end <= t, end = start + 4; }

Page 47: Planning with Resources

47

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

IXTET [Ghallab&Laruelle 1994, Laborie&Ghallab 1995] is a temporal and resource planner From IndeXed TimE Table State of the world is represented by a set of valued

attributes (state variables) Relies on time-points as elementary temporal primitives Allow representation of unary, discrete and reservoir

resources

Page 48: Planning with Resources

48

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

State of the world is represented by a set of valued attributes (state variables)

E.g.: color(car):redposition(robot):r1

Conditions are expressed over time intervals

E.g.: hold(position(robot):r1,(t1,t2)) Change is represented via the notion of event

associated with a time-point

E.g.: event(position(robot):(r1,r2), t)

Page 49: Planning with Resources

49

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

Minimal/Maximal delays can be expressed between time-points

E.g.: t in [0, 12]t2-t1 in [3, 5]

Unary and discrete resources can be used over time-intervals

E.g.: use(engineers():2, (t1,t2)) Reservoir can be produced/consumed at time-points

E.g.: consumes(money():100,t)

Page 50: Planning with Resources

50

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

Web-site project example IXTET operators are called task

task develop(?website)(t) { ?website in WEBSITES; timepoint t1, t2; hold(status(?website):designed, (t1,t2)); hold(status(?website):implemented, (t2,t)); hold(status(?website):tested, (t,end)); start <= t1 <= t2 <= t <= end; (end - start) in [0,18]; }

Page 51: Planning with Resources

51

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

Web-site project example

task test_in_company(?website)(start, end){ ?website in WEBSITES; event(status(?website):(?, tested), end); uses (engineers():2, (start,end));

(end - start) in [3,3];}

task test_outsource(?website)(start, end){ ?website in WEBSITES; event(status(?website):(?, tested), end); consumes (money():100, start);

(end - start) in [4,4];}

Page 52: Planning with Resources

52

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

Web-site project example The problem is modeled in the same way as a task

resource money() { capacity = 200; }resource engineers { capacity = 5; }

task init()() {timepoint t;explained event(status(website1):(?, init), start);

explained event(status(website2):(?, init), start);explained event(status(website3):(?, init), start);develop(website1)(t);develop(website2)(t);develop(website3)(t);start <= t <= end;t - start in [0,16];

}

Page 53: Planning with Resources

53

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : IXTET

Web-site project example

resource money() { capacity = 200; }resource engineers { capacity = 5; }

task init()() {timepoint t, u;explained event(status(website1):(?, init), start);

explained event(status(website2):(?, init), start);explained event(status(website3):(?, init), start);develop(website1)(t);develop(website2)(t);develop(website3)(t);start <= t <= end;t - start in [0,16];

uses(engineers():1, (u,end)); // One quality engineer onlyu-start in [7,7]; // available first week

}

Page 54: Planning with Resources

54

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

O-Plan [Currie&Tate 1991, Drabble&Tate 1994] Open PLANning architecture Hierarchical planning system The language (Task Formalism) allows a rich

representation of time and resources

Page 55: Planning with Resources

55

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

Web-site project example Actions have conditions and effects and can be refined

into sub-actions thanks to schemas

schema develop_website; vars ?website = ?{type websites}; expands {develop ?website}; nodes 1 action {design ?website}, 2 action {implement ?website}, 3 action {test ?website}; orderings 1 -> 2, 2 -> 3; time_windows duration self = 0 .. 18 months;end_schema;

Page 56: Planning with Resources

56

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

Web-site project example

schema test_website_in_company; vars ?website = ?{type websites}; expands {test ?website}; conditions only_use_if {free_engineers} = true; effects {free_engineers} = false at begin_of self, {free_engineers} = true at end_of self; time_windows duration self = 3 months;end_schema;

schema test_website_outsource; vars ?website = ?{type websites}; expands {test ?website}; resources consumes {resource money} = 100 kE; time_windows duration self = 4 months;end_schema;

Page 57: Planning with Resources

57

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

Web-site project example The problem is modeled in the same way as a goal

schema

task todo; nodes 1 start,

3 action {develop site1}, 4 action {develop site2}, 5 action {develop site3},

2 finish; orderings 1 -> 3, 1 -> 4, 1 -> 5, 3 -> 2, 4 -> 2, 5 -> 2; resources consumes {resource money} = 0 .. 200 kE overall; time_windows 0 at begin_of 1,

16 at end_of 2; end_task;

Page 58: Planning with Resources

58

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

Time Precedence between actions Minimal/maximal action duration Time windows for events Minimal/maximal delays between events

Schema

dmin dmax

Action

Page 59: Planning with Resources

59

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

O-Plan Resource Typology

Resource

Consumable

Strictly Producible

By-Agent By and OutwithAgent

OutwithAgent

Reusable

Non-Sharable Sharable

Independently Synchronously

Reservoir

Unary

Discrete

Page 60: Planning with Resources

60

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : O-Plan

Resource usage Consumable/Producible resource schema <SCHEMA>; resources consumes {resource <R>}= <q..Q> [at<EVT>]; resources produces {resource <R>}= <q..Q> [at<EVT>];

Reusable resources

schema <SCHEMA>; resources allocates {resource <R>}= <q..Q> [at<EVT>]; resources desallocates {resource <R>}= <q..Q> [at<EVT>];

Page 61: Planning with Resources

61

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

ASPEN [Chien&al 2000] Automated Scheduling and Planning ENvironment The main ingredient of the model is the notion of

(hierarchical) activity types. Numerical time State variables Numerical resources (unary, discrete, reservoir).

Page 62: Planning with Resources

62

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

ASPEN Example inspired from [McCarthy&Pollack 2002] State variables: described as a set of possible

transitions

State_variable Position { states = (“patio”,”dining”,…); transitions = (“patio”<->”dining”,

“dining”<->”kit”, “dining”->”living”,

…); default_state = “living”;}

Page 63: Planning with Resources

63

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

ASPEN 3 reasons for an activity to be inserted in the plan

An activity requires a given state for a state variable

Activity

Eat(breakfast)

Reservations:

State Variable: Position must_be kitchen

Page 64: Planning with Resources

64

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

ASPEN 3 reasons for an activity to be inserted in the plan

An activity express temporal constraint with another activity of a given type

Activity

Eat(breakfast)

Constraints:ends_before start of Take(medicine) by [0,60]

Activity: Take(medicine)

[0,60]

Page 65: Planning with Resources

65

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

ASPEN 3 reasons for an activity to be inserted in the plan

An activity can be decomposed into sub-activities

Activity DailyExercise()

Decompositions:

Exercise1() Exercise2() Exercise3()

Page 66: Planning with Resources

66

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

Web-site project example

State_variable status {states = { “init”, “designed”, “implemented”, “tested” };transitions = { “init” -> “designed”,

“designed” -> “implemented”,“implemented” -> “tested” };

default_state = “init”;}

Activity develop {Website w;duration = [0,18];decomposition = { design with (w -> w) a1,

implement with (w -> w) a2,test with (w -> w) a3,where a1 ends_before start of a2,

a2 ends_before start of a3 };}

Page 67: Planning with Resources

67

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

Web-site project example

Activity test {Website w;decomposition = { test_in_company with (w -> w) or

test_outsource with (w -> w) };reservations = { status(w) must_be “implemented”,

status(w) change_to “tested” at end; }}

Activity test_in_company {Website w;duration = 3;reservations = { engineers use 2; }

}

Page 68: Planning with Resources

68

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : ASPEN

Web-site project example

Activity test {Website w;decomposition = { test_in_company with (w -> w) or

test_outsource with (w -> w) };constraints = { starts_after end of

implement with (w -> w) }}

Activity test_in_company {Website w;duration = 3;reservations = { engineers use 2; }

}

Page 69: Planning with Resources

69

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : RAX-PS

RAX-PS [Jonsson&al 2000] Interval based planner No distinction between propositions holding over

intervals and actions taking place over intervals Valued state-variables (same as IXTET or ASPEN) Main ingredient is the notion of token: a given value for

a state variable holding over some time-interval

Page 70: Planning with Resources

70

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : RAX-PS

RAX-PS Notion of time-line for a state variable v

Token

tuple < v, P(xP), s, e >

< Attitude, Turn(A,B), 10, 20 >

Engine

Attitude

Idle IdleThrust(B)

Turn(A,B) Turn(B,C)Point(B)

time

Page 71: Planning with Resources

71

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : RAX-PS

Each token T is associated a configuration constraint GT called compatibility. This constraint determines which other tokens must be present in a valid plan if the plan contains T and how these tokens are constrained with respect to T.

Usually, GT is a disjunction of basic configurations

Page 72: Planning with Resources

72

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

State of the Art

Problem Modeling : RAX-PS

Example

(Define_Compatibility (ProjectStatus(?w) tested):compatibility_spec

(OR (met-by (ProjectStatus(?w) test_incompany)) (met-by (ProjectStatus(?w) test_outsource)))

(Define_Compatibility (ProjectStatus(?w) test_incompany):constraints

(?duration <- 3):compatibility_spec

(AND (equals (Engineers (+2 Used)))))

(Define_Compatibility (ProjectStatus(?w) test_outsource):constraints

(?duration <- 4))

Page 73: Planning with Resources

73

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Planners

Planning Techniques:- Planning Graph - SAT Planners and other encodings- Heuristic Planning- Local Search & Repair- Partial Order Causal Link (POCL)- Hierarchical Task Networks (HTN)

Problem Solving

State of the Art

Planning Languages

Basic Tools:- Linear Programming (LP)- Mixed Integer Linear Programming (ILP or MIP)- Satisfiability (SAT)- Constraint Satisfaction Problems (CSP)

Page 74: Planning with Resources

74

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Linear Programming (LP) Input: a set of variables, a system of linear inequations

and a linear objective to minimize

Output: a value for each variable that maximizes the objective function

State of the Art

jijiji

iii

iijji

bxatosubject

xcmaximize

Rxcba

,,

, ,,,

Page 75: Planning with Resources

75

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Linear Programming (LP) Example

Optimal solution: x=45, y=6.25 (objective = 1.25)

State of the Art

5,45

,21003330,24002450

)50(

yx

yxyx

tosubjectyxmaximize

Page 76: Planning with Resources

76

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Linear Programming (LP) Efficient algorithms available using the Simplex method Except for some pathological cases, the method

exhibits a polynomial complexity Practical problems involving several hundred thousands

of variables can be solved Many software and libraries available (freeware or

commercial e.g. ILOG CPLEX)

State of the Art

Page 77: Planning with Resources

77

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Mixed Integer Linear Programming (ILP/MIP) Input: same as LP but some variable are constrained to

be integer

Output: a value for each variable that maximizes the objective function

State of the Art

jijiji

iii

lkijji

bxatosubject

xcmaximize

ZxRxcba

,,

, ,,,,

Page 78: Planning with Resources

78

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Mixed Integer Linear Programming (ILP/MIP) Example

Optimal solution: x=45.12, y=6 (objective = 1.12)

State of the Art

integerisyyx

yxyx

tosubjectyxmaximize

,5,45

,21003330,24002450

)50(

Page 79: Planning with Resources

79

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Mixed Integer Linear Programming (ILP/MIP) Problem is NP-hard ... But fairly efficient approaches exist based the

cooperation of LP and a tree search. Basic idea: relax the problem as a LP, solve it, if some

integer variable xl has non integer value vl, branch on xl=[vl] xl=[vl]+1

Survey paper: [Bixby&al 2000]

State of the Art

Page 80: Planning with Resources

80

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Satisfiability (SAT)

Boolean variables P,Q,R,… true,falseLiteral P,Q,… (un)negated variableClause (PQ),… disjunction of literalsTheory C1C2,… conjunction of clauses

Satisfiability problem: is a given theory valid ?

That is, does it exist an assignment of all the boolean variables in {true, false} such that the theory is true.

MAX-SAT: what is the maximum number of clauses that can be satisfied.

State of the Art

Page 81: Planning with Resources

81

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Satisfiability (SAT)

Example: (P Q) (Q R) (R P)

A solution: P=Q=true, R=false

(P Q) (Q R) (R P)

State of the Art

Page 82: Planning with Resources

82

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Satisfiability (SAT) Satisfiability is NP-complete … but efficient methods exist

Complete methods (Davis-Putnam procedure and its improvements)

Approximation methods (randomization and local search)

Can solve problems with thousands of variables Survey paper: [Gent&Walsh 1999]

State of the Art

Page 83: Planning with Resources

83

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Constraint Satisfaction Problems (CSP)

Problem. Given:

A set of variables X={x1,…,xn}

A finite domain Di for each variable xi

A set of constraints Ci(xi1,…,xik) on some subset of variables described in extension (subset of the cartesian product Di1 …Dik satisfying the constraint) or in intension (e.g. xi=min(xj,xk) )

Find an assignment of all variables in X that satisfies all the constraints

State of the Art

Page 84: Planning with Resources

84

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Constraint Satisfaction Problems (CSP) Example:

Variables: c {blue, red}

x {1,2,3,4}, y {1,2,3,4}

Constraints: (xy)

(x.y 10)

(c=blue) (x>y) A solution: (x=1),(y=2),(c=red)

State of the Art

Page 85: Planning with Resources

85

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Basic Tools

Constraint Satisfaction Problems (CSP) Problem is NP-complete (SAT can easily be reduced to

a CSP on boolean variables) Efficient resolution techniques using constraint

propagation and tree search Survey papers: [Kumar 1992, Smith 1995]

State of the Art

Page 86: Planning with Resources

86

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

State of the Art

Planning GraphGraphPlanIPPSTAN

R-IPP

Heuristic PlanningHSPGRTFF

GRT-RMetric-FFSapaTP4

Local Search & Repair

LPGExcaliburASPEN

POCLSNLPUCPOP

parcPLANIxTeTRAX

HTNSipe-2O-PLAN

UMCPSHOP

SAT Planners SAT-PLAN[Rintanen&Jungholt 1999] LPSAT

[Kautz&Walser 1999]

Page 87: Planning with Resources

87

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Graph

Planning Graph [Blum&Furst 1997] Planning Graph expansion

State of the Art

0 i-1 i i+1

propositions propositions

actions

Page 88: Planning with Resources

88

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Graph

Planning Graph Mutex relations

State of the Art

InconsistentEffects

Interference Competing Needs

Inconsistent Support

Page 89: Planning with Resources

89

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Graph

Planning Graph Solution extraction

State of the Art

Page 90: Planning with Resources

90

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Graph

Planning Graph Solution extraction

Ad-hoc algorithm (GraphPlan) SAT encoding CSP encoding

State of the Art

Page 91: Planning with Resources

91

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Graph

Planning Graph Some Planning Graph Planners

GraphPlan [Blum&Furst 1997] IPP [Koehler&al 1997] STAN [Long&Fox 1999]

SAT encoding SatPlan [Kautz&Selman 1999]

CSP encoding CPLAN [vanBeek&Chen 1999] GP-CSP [Do&Kambhampati 2000]

State of the Art

Page 92: Planning with Resources

92

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP

R-IPP

IPP extension to resource constrained plans

[Koehler 1998]

GraphPlan based algorithm

The planning graph is annotated with possible interval boundaries for resource level

State of the Art

Page 93: Planning with Resources

93

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP

Resource r with possible level in [Qmin(r),Qmax(r)]

State of the Art

0 i-1 i i+1

L(i-1,r)[Lmin(i-1,r), Lmax(i-1,r)] L(i+1,r) ?

Page 94: Planning with Resources

94

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP Resource r with possible level in [Qmin(r),Qmax(r)]

State of the Art

),,1(max riL max(),1(max riL

i-1 i i+1

No action affecting r is applied

Page 95: Planning with Resources

95

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP Resource r with possible level in [Qmin(r),Qmax(r)]

State of the Art

),,1(max riL max(),1(max riL

})(/)({ albetorofamountsettingilevelatactionaal

i-1 i i+1An action a can set theamount of resource to l(a)

L(r):=l(a)

Page 96: Planning with Resources

96

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP Resource r with possible level in [Qmin(r),Qmax(r)]

State of the Art

),,1(max riL max(),1(max riL

})(/)({ albetorofamountsettingilevelatactionaal

)}/)(),1({ max ilevelofproducersofsetexclusivenonSapriLSa

i-1 i i+1

A non-exclusive set ofaction produces r

L(r)+=p(a)

Page 97: Planning with Resources

97

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP

Similar calculations for Lmin(i+1,r)

The classical notion of mutex is extended. Two actions are mutex also if: They are of different type w.r.t. a resource (consumer,

provider, producer) They are provider of the same resource Their combined effect is impossible They have contradictory resource requirements

State of the Art

Page 98: Planning with Resources

98

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: R-IPP

Resource boundaries are used to Restrict the number of applicable actions in a given level Allow detection of additional mutexes Prune the search when solving the planning graph

State of the Art

Page 99: Planning with Resources

99

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

Planning with Resources based on SAT and/or LP/MIP encodings [Rintanen&Jungholt 1999] LPSAT [Wolfmann&Weld 1999] [Kautz&Walser 1999]

State of the Art

Page 100: Planning with Resources

100

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

[Rintanen&Jungholt 1999] propose an approach similar to R-IPP based on a SAT-encoding Producers and Consumers can be executed in parallel

The search is not restricted to backward-chaining as in the GraphPlan framework.

State of the Art

Page 101: Planning with Resources

101

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

LPSAT Based on a SAT-encoding of the planning graph

[Ernst&al 1997]

State of the Art

i-1 i i+1

Explanatory Frame Axioms: At(P1,B,i-1) At(P1,B,i+1) SlowFlight(A,B,i) FastFlight(A,B,i)

Actions effects and conditions: SlowFlight(A,B,i) At(Plane,A,i-1) At(P1,A,i-1)

At(Plane,B,i+1) At(P1,B,i+1)

Page 102: Planning with Resources

102

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

LPSAT SAT extended by LCNF representation and solver:

propositional variables may trigger some linear constraints [Wolfmann&Weld 1999]

(P Q) (Q R) (R P)

P (50x+24y2400)

Q (30x+33y2100)

R (x45)

State of the Art

Page 103: Planning with Resources

103

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

LPSAT LCNF allows expression of resource requirements

State of the Art

i-1 i i+1

Resource requirements: SlowFlight(A,B,i) (Level(i-1) - Level(i+1)= 15) Refuel(i) (Level(i+1)= 240)

Page 104: Planning with Resources

104

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

[Kautz&Walser 1999] propose an ILP encoding

Actions a that consumes/produce a resource

One action that reset the resource to its maximal capacity (refuel)

State of the Art

Page 105: Planning with Resources

105

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving

[Kautz&Walser 1999] propose an ILP encoding

State of the Art

ProdaiaiMAX

ConsaiaiMIN

ii

MAXii

ii

iProda

aConsa

iaiii

aqrQ

aqrQ

ks

Qrs

ConsProdaas

aqaqkrr

)0(

)( 1

1

ProdaiaiMAX

ConsaiaiMIN

iii

MAXii

ii

iProda

aConsa

iaiii

aqrQ

aqrQ

MkthatsuchMkMs

Qsr

ConsProdaas

aqaqkrr

,0

0

1

1

1

Page 106: Planning with Resources

106

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Heuristic Planning

Heuristic Planning Forward or backward state planning Use of an efficient heuristic h(s)

State of the Art

Cost ofcurrent plan:

g(s)

Initialstate

Goals

Candidateactions

Heuristic cost: h(s’)

s’

Page 107: Planning with Resources

107

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Heuristic Planning

Heuristic Planning In HSP, the heuristics h(s) is computed by solving a relaxed

problem where all the delete lists of actions are ignored.

s: state, p: proposition, cs(p) estimation of the cost for achieving p from state s

State of the Art

)( pcs0

))((1min )( opPreccspOop

if ps

otherwise{

Goalp

s pcsh )()(HSP heuristics (non-admissible):

Page 108: Planning with Resources

108

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Heuristic Planning

Some heuristics planners HSP [Bonet&Geffner 1999,2001] GRT [Refanidis&Vlahavas 1999] FF [Hoffman&Nebel 2001]

State of the Art

Page 109: Planning with Resources

109

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Heuristic Planning

Heuristic Planning with Resources GRT-R [Refanidis&Vlahavas 2000] Metric-FF [Hoffman 2002] Sapa [Do&Kambhampati 2001] TP4 [Haslum&Geffner 2001]

State of the Art

Page 110: Planning with Resources

110

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: GRT-R

GRT-R: Heuristic planner handling consumable resources in the heuristics

State of the Art

Cost ofcurrent plan:

<N=2,R1=5,R2=4>

Initialstate

Goals

Candidateactions

Heuristic cost: h(s’)<N=2, R1=5, R2=1>,

s’

Q1=10, Q2=10

<N=3, R1=2, R2=3>

<N=1, R1=6, R2=2>

Page 111: Planning with Resources

111

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: GRT-R

The heuristic with resource allows guiding and pruning the search

The heuristics h(s) is computed by regression from the goal state toward state s

Issues: complexity in time and memory for computing the sets of cost vectors

State of the Art

Page 112: Planning with Resources

112

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Metric-FF

Metric-FF. Extension to FF [Hoffmann&Nebel 2001] Reminder: FF is a forward search heuristic planner. At

a given state s, the heuristics h(s) is estimated by solving a relaxed problem that ignores the delete lists of operators. This is done in GraphPlan style.

State of the Art

Cost ofcurrent plan:

g(s)

Initialstate

Goals

Candidateactions

Heuristic cost: h(s’)

s’

Solve relaxed problem

Page 113: Planning with Resources

113

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Metric-FF

Metric-FF restricted formalism Conditions: q>C, qC Effects: q+=C (production), q-=C(consumption)

Metric-FF idea: on a resource, something similar to ignoring the delete list is to ignore consumption and only consider production events (monotonicity).

Monotonicity: each proposition true at level i in the planning graph remains true at any level j i

State of the Art

Page 114: Planning with Resources

114

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Metric-FF

As for FF Finding a solution to the relaxed problem is polynomial

(because of the monotonicity) Finding the shortest solution to the relaxed problem is

NP-complete.

A (good) solution to the relaxed problem is computed using similar techniques as in R-IPP

The value of the heuristic is the number of operators in this solution

State of the Art

Page 115: Planning with Resources

115

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Metric-FF

The notion of monotonicity is very generic Extended Metric-FF formalism

Conditions:

linear expressions {<.,=,,>} linear expression Effects:

{:=, +=, -=} linear expression

Transformed into a simpler Linear Normal Form language where a monotonic relaxation is applied

State of the Art

Page 116: Planning with Resources

116

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Sapa

Sapa. Heuristic Metric Temporal Planner Focus on durative actions: action A, duration D(A) Notion of time stamped state

State of the Art

tPast Future

pitiPredicatestrue at t

Resourcelevels at t

cj tj

Persistent conditionsto be protected

Scheduled events:- Ends of persistent condition- Change truth value of a predicate- Change a resource

Page 117: Planning with Resources

117

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Sapa

Notion of applicable action Result of applying an action to a state

State of the Art

A

tPast Future

pitiPredicatestrue at t

Resourcelevels at t

cj tj

Persistent conditionsto be protected

Scheduled events:- Ends of persistent condition- Change truth value of a predicate- Change a resource

Page 118: Planning with Resources

118

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Sapa

Heuristic planning

The heuristics relies on solving a relaxed problem where delete lists and resources are ignored using GraphPlan like techniques

State of the Art

Cost ofcurrent plan:

g(s)

Initialstate

Goals

Candidateactions

Heuristic cost: h(s’)

s’

Page 119: Planning with Resources

119

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Sapa

In the relaxed problem Delete lists and Resource usage are ignored

State of the Art

Board(P1,A)

FastFlight(A,B)Deplane(P1,A)

FastFlight(B,C)SlowFlight(A,B)

Deplane(P1,B)Board(P2,B)

SlowFlight(B,C)

Deplane(P1,C)Deplane(P2,C)

ssinit

PartialPlan Relaxed planning graph

Lower bound on the date P1 can be at C(useful to prune the search)

FastFlight(A,B)Board(P2,B)

FastFlight(B,C)Deplane(P1,C)Deplane(P2,C)

Approximation of thedistance from the goal

Page 120: Planning with Resources

120

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Sapa

In the relaxed problem, resources are used to adjust the heuristics For a resource R, pre-computation of the action AR that can

increase maximally the level of R (of a level R)

Init(R): initial level of R at state s from which the relaxed plan was computed. Con(R) and Pro(R) are the total consumption and production of R in the solution of the relaxed plan.

If Con(R)>Init(R)+Pro(R), we know that at least

additional actions to produce R will be necessary

State of the Art

R

RProRInitRCon

))()(()(

Page 121: Planning with Resources

121

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: TP4

Similar approach used in TP4 But the planner is a regression planner, starting from

the goal

State of the Art

Page 122: Planning with Resources

Planning with Resources

Part II: Focus on Constraint-Based Approaches

Page 123: Planning with Resources

123

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Planning with Resources

Part II. Focus on Constraint-Based Approaches Reminder: POCL and HTN Planning Constraint-Programming Problem Modeling Problem Solving

Constraint Propagation Search

Overview

Page 124: Planning with Resources

124

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Search in a space of partially-ordered plans Iteratively selects some flaw of the current partial plan

and attempt to fix them until there are no more flaw (solution plan)

Flaws: - unachieved preconditions

- threads on causal links

State of the Art

Page 125: Planning with Resources

125

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Unachieved preconditions

State of the Art

Initialstate

Goal

p

q

q

r

s

u

v

u

v

s

qq

r

p

p

Insert a new action and a causal-link OR

w

Page 126: Planning with Resources

126

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Unachieved preconditions

State of the Art

s

Initialstate

Goal

p

q

q

r

s

u

v

u

v

qq

r

p

Insert a causal-link with an existing action

Page 127: Planning with Resources

127

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Threads on causal-links

State of the Art

Initialstate

Goal

p

q

p

r

s

u

v

u

v

s

pq

r

p

p

Fixes: action promotion OR demotion

Page 128: Planning with Resources

128

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Threads on causal-links

State of the Art

Initialstate

Goal

p

q

p

r

s

u

v

u

v

s

pq

r

p

p

Fixes: action promotion OR demotion

Page 129: Planning with Resources

129

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Threads on causal-links

State of the Art

Initialstate

Goal

p

q

p

r

s

u

v

u

v

s

pq

r

p

p

Fixes: action promotion OR demotion

Page 130: Planning with Resources

130

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-Order Causal-Link Planning (POCL) Some POCL planners

SNLP [McAllester&Rosenblitt 1991] UCPOP [Penberthy&Weld 1992] IXTET [Ghallab&Laruelle 1994]

State of the Art

Page 131: Planning with Resources

131

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Hierarchical Task Networks (HTN) Hierarchical Operators (see O-PLAN)

State of the Art

Task T(x1,…xn)

precondition: p

q

r

s q

r

s

precondition: v

Method 1 Method 2

Page 132: Planning with Resources

132

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Hierarchical Task Networks (HTN) HTN Planners work by iteratively

- expanding tasks (choose a method) and - resolving conflictsuntil a conflict-free plan can be found which consists only of primitive tasks

Most of industrial applications of AI Planning use the HTN approach

Provides a strong structuration of the domain to efficiently guide the search

State of the Art

Page 133: Planning with Resources

133

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Hierarchical Task Networks (HTN) Some Partial-Order HTN Planners

SIPE-2 [Wilkins 1988] O-Plan [Currie&Tate 1991] UMCP [Erol&al 1995]

Often based on constraint propagation [see later] Some Forward-Chaining HTN Planners

SHOP [Nau&al 1999]

State of the Art

Page 134: Planning with Resources

134

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

Partial-order approaches to planning (POCL, HTN) are recognized to be the most flexible for handling time and resources [Smith&al 2000]

Partial order planning is receiving more and more attention [Nguyen&Kambhampati 2001,Geffner 2001]

Constraint-Based Approaches

Page 135: Planning with Resources

135

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving: Planning Techniques

In partial order planning, from the point of view of resources, a partial plan is a temporal network of activities that require/produce/consume some resources.

It’s essentially the same as in constraint-based scheduling

Constraint-Based Approaches

Page 136: Planning with Resources

136

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

Constraint-Based Scheduling =

Scheduling + Constraint Programming

Scheduling problems arise in situations where a set of activities has to be processed by a limited number of resources in a limited amount of time

Constraint-Based Approaches

Page 137: Planning with Resources

137

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

Paradigm to solve combinatorial optimization problems

One states the problem in terms of variables and constraints after which, a search procedure is used to find a solution

Constraint-Based Approaches

Page 138: Planning with Resources

138

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

Each variable has an initial domain of possible values ( x [0,…,4] )

Constraints propagate to reduce domains

“x < 3” x [0,…,2]

Each constraint has its own propagation algorithm (reusable)

As propagation isn’t sufficient, a search tree is build

Constraint-Based Approaches

Page 139: Planning with Resources

139

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

Variables, Domains, and Constraints

Problem Definition

Search

Constraint Propagation

initial variables, constraints, and domains

decision making new constraints

backtracking

reduce domains, deduce constraints, contradictions

problem specification

partial solution

Dec. vars: x in [1..3]Dec. vars: x in [1..3] y in [1..3] y in [1..3] z in [1..3] z in [1..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

Dec. vars: x in [1..3]Dec. vars: x in [1..3] y in [1..3] y in [1..3] z in [1..3] z in [1..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

x - y = 1x - y = 1

Dec. vars: Dec. vars: x in [2..3]x in [2..3] y in [1..2] y in [1..2] z in [1..3] z in [1..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

Dec. vars: x in [2..3]Dec. vars: x in [2..3] y in [1..2] y in [1..2] z in [1..3] z in [1..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

y < zy < z

Dec. vars: x in [2..3]Dec. vars: x in [2..3] y in [1..2] y in [1..2] z in [2..3]z in [2..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

y < zy < z

Dec. vars: x in [2..3]Dec. vars: x in [2..3] y in [1..2] y in [1..2] z in [2..3] z in [2..3]

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

y = 2

Dec. vars: Dec. vars: x = 3x = 3 y = 2 y = 2 z = 3 z = 3

Constraints: x - y = 1Constraints: x - y = 1 y < z y < z

y = 2y = 2

Constraint-Based Approaches

Page 140: Planning with Resources

140

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Scheduling

Search Scheduling Strategies

Problem Specification / Partial

solution

Constraint Propagation Resource

Demands, Temporal Constraints

Problem Definition Modeling Objects:

Activities, Resources,Temporal Constraints,

Resource Demands

Constraint-Based Approaches

[Baptiste&al 2001]

Page 141: Planning with Resources

141

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming : Properties

Constraint-Based Approaches

Besides the separation of problem definition, constraint propagation, and search, the Locality Principle [Steele 1980] is important: each constraint must propagate as locally as possible, independent of the existence or non-existence of other constraints.

[Stallman&Sussman 1977] separation between deductive methods (constraint propagation) and search

[Kowalski 1979] distinction between logical representation of constraints and the control of their use: Algorithm = Logic + Control

Page 142: Planning with Resources

142

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

Constraint-Based Approaches

Global Constraints One of the strong points of CP tools are the so called

global constraints (Opposed to constraints like x < y.) Example is the “all-different” constraint where you have

n variables which all should take a different value:

)(,/],...,[, ji xxjinji 1

Page 143: Planning with Resources

143

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming

O(n2) binary constraintsWeak constraint propagation

One global constraint(Easier modeling)

Strong constraint propagation[Regin 1994]

V12

V6

V3V9

V2

V4

V10

V8

V11

V5

V1

V7

Constraint-Based Approaches

Page 144: Planning with Resources

144

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Constraint Programming : Search

Search Heuristics Variable and value selection heuristics. Choose variable to assign a value to and then choose a

value for this variable (instantiate the variable). Typical strategy

Choose most constrained variable, i.e., a variable that is difficult to instantiate; start with the difficult parts (this before they get even more difficult).

Choose least constraining value, i.e., a value that leaves as many values as possible for the remaining uninstantiated variables.

Page 145: Planning with Resources

145

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming : Search

Constraint-Based Approaches

Variable selection heuristics choose variable with smallest remaining domain choose variable with maximal degree in constraint graph

(most constraints defined on it)

Page 146: Planning with Resources

146

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming : Search

Constraint-Based Approaches

Value selection heuristics choose value that participates in highest estimated

number of solutions. Number of solutions are estimated by counting the solutions to a tree-like relaxation or the original constraint graph.

choose minimal value

Recall: In general decisions correspond to additional constraints.

Page 147: Planning with Resources

147

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming : Search

Constraint-Based Approaches

Search Tree Exploration Depth First Search (DFS). The traditional search

strategy of CP. Best First Search (BFS). Choose the node with the best

minimum cost. Limited Discrepancy Search (LDS). Divides the search

tree into strips, trying to stick close to the heuristic. … and several others like Depth-Bounded Discrepancy

Search, Interleaved Depth-First Search.

Page 148: Planning with Resources

148

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint Programming : Search

Constraint-Based Approaches

Optimization In case an objective function is present, one tries to find

the best solution. Such optimization can be done in several ways When a solution with cost c is found, restart search to find

a solution with cost c-1. Do dichotomization. Besides upper bounds coming from

solutions, when being complete one can also calculate lower bounds.

When a solution with cost c is found, stay in this solution node, add a “cut” that says the cost needs to be at most c-1, and continue search.

Page 149: Planning with Resources

149

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling

Scheduling is the “problem of allocating scarce resources to activities over time” [Baker 1974]

Typology of Activities Temporal constraints Resources

Constraint-Based Approaches

Page 150: Planning with Resources

150

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : Activities

Non-preemptive activities

Constraint-Based Approaches

Activity A

Start time: s(A) End time: e(A)

Processing time: p(A) == e(A)-s(A)

t

1 Activity 3 numerical Variables

Page 151: Planning with Resources

151

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : Activities

Notations on current domain of activity time window

Constraint-Based Approaches

Activity A

t

smin(A) emin(A)

emax(A)smax(A)

Page 152: Planning with Resources

152

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : Activities

Preemptive activities

Constraint-Based Approaches

Activity A

Start time: s(A) End time: e(A)

Processing time: p(A) = pi e(A)-s(A)

tp1 pi...

Page 153: Planning with Resources

153

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : Activities

Preemptive activities Preemption at fixed dates (break calendar)

Constraint-Based Approaches

Processing time: p(A) = pi = e(A)-s(A) - breaks(A)

Activity A

tp1 pi...

M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T

1 Activity 3 numerical Variables

Page 154: Planning with Resources

154

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling : Activities

Preemptive activities Preemption by other activities

Constraint-Based Approaches

Activity A

tp1 pi...

Activity B Activity C

1 Activity 1 Variable Set of dates

Page 155: Planning with Resources

155

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling: Temporal constraints

Generally expressed as ti - tj [dmin, dmax] where ti, tj : start or end time point of some activities

dmin, dmax: minimal and maximal delay

Generic enough to model release dates: start(A) [r,+) deadlines: end(A) (-,d] precedence: start(B)-end(A) [0,+)

Constraint-Based Approaches

Page 156: Planning with Resources

156

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling: Temporal constraints

Simple Temporal Problem (STP)

[Dechter&al 1991] Distance Graph representation

Constraint-Based Approaches

ti

tj

-dmin

dmax

Page 157: Planning with Resources

157

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Modeling: Temporal constraints

Arc consistency ( Single Source Shortest Paths) ensures a backtrack-free search n=#time-points, p=#temporal constraints Memory: O(p) Time: O(n.p) (with negative cycle detection)

Path consistency ( All Pairs Shortest Paths) Memory: O(n2) Time: O(n2) Provides all pairs distances (useful for heuristics)

Constraint-Based Approaches

Page 158: Planning with Resources

158

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Resource Usage

Resource quantities q(U) are decision variables The same activity may use several resources

A

U1: A requires Machine1

U2: A requires(q2) Workers

U3: A consumes(q3) Memory

Page 159: Planning with Resources

159

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Resource Usage

Resource usage follow the “constraint protocol” In particular, they can be used in meta-constraints

[A requires Machine1]

[A consumes(q2) Memory] [B requires(q3) Workers]

Page 160: Planning with Resources

160

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Decision Variables

Start, end and processing time of activities:

s(A), e(A),p(A)

Required quantities of resources:

q(U)

From the standpoint of constraint-programming, the limited capacity of resources imposes some global constraint on the decision variables of the problem

Page 161: Planning with Resources

161

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Objective functions

Often the objective is to minimize a function

f(e(A1),…,e(An))

Makespan: f = max(e(Ai)) Total weighted flow time: f = wi.e(Ai) Maximum tardiness: f = max(Ti); Ti=max(0,e(Ai)-i) Total weighted tardiness: f = wi.Ti

Total weighted number of late jobs: f = wi.Ui

Earliness/Tardiness costs

Page 162: Planning with Resources

162

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Objective functions

Other common objective functions

Minimum transition costs Minimum peak resource usage Schedule maximum weighted # of activities Schedule on a minimum weighted # of resources

Page 163: Planning with Resources

163

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Modeling : Scheduling Problem

Given: A set of resources A set of activities A set of temporal constraints on/between activities A set of resource usage

An objective function f Find an instantiation of the decision variables that

satisfies all the constraints and minimizes f

Page 164: Planning with Resources

164

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Solving

A.I. Planning and Scheduling techniques start to converge into a “POPS” (Partial Order Planning and Scheduling) concept Partial Order Planning is “Reviving” “Partial Order Scheduling” is most of what Constraint-

Based Scheduling is about

Page 165: Planning with Resources

165

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Solving

POP and POS work on the same type of structure: a temporal network of operators/activities POP focus on operator/activity generation constraints POS focus on time and resource constraints

The fundamental idea is that in both case, a solution plan or a solution schedule can be characterized by a set of local properties

These local properties can be enforced by constraint propagation and/or by branching in the search tree

Page 166: Planning with Resources

166

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Solving

Example of such a local property in POP: The Necessary Truth Criterion [Chapman,87]

Pre: free(A) ?

Establisher: +free(A)

Clobberer: -free(A)

White knight: +free(A)

Page 167: Planning with Resources

167

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Problem Solving

In what follow, we identify the local properties that are used in Constraint-Based Scheduling to characterize solution schedules and describe

1. the propagation and

2. the branching schemes

based on these local properties

Page 168: Planning with Resources

168

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

2)1( nn

)()'(

or),'()(

AsAe

AsAe

Constraint-Based Approaches

What’s happening inside ? Key principle is that a resource knows the set of

activities that requires it (start, end, processing time)

For instance a unary resource takes care of thedisjunctive constraints of the form

Page 169: Planning with Resources

169

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

Constraint-Based Approaches

What’s happening inside ? When adding an activity requiring a resource, the

resource automatically takes care of the relations with all other activities requiring the same resource

Remark: One can add activities during search

Note however that sometimes you need to know that all the activities that will require the resource are known to do any propagation

Page 170: Planning with Resources

170

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

Constraint-Based Approaches

What’s happening inside ? We have several types of constraints that all make sure

the capacity of the resource is not exceeded at any point. These constraints differ in the strength of the propagation they induce: timetables precedence energy

disjunctive constraint balance constraint

edge-finding

In general: more propagation = more effort

These constraints are global constraints, they “globally” consider the set of activities on a resource

Page 171: Planning with Resources

171

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

Different algorithms available to propagate resource capacity (timetable, disjunctive, edge-finder, balance, etc.)

Several algorithms may be used in cooperation on the same resource

A resource knows the set of activities that uses it As soon as something changes on the resource

(change of activity start/end/processing time, change of resource demand, new resource usage added), propagation algorithms are triggered

Constraint-Based Approaches

Page 172: Planning with Resources

172

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

A resource is said to be closed if no additional resource usage will be inserted into the current schedule lower in the search tree

When a resource is closed, stronger propagation can be inferred

Constraint-Based Approaches

LINIT=0 +q -q

Page 173: Planning with Resources

173

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Problem Solving : Global Constraints

In mixed A.I. Planning & Scheduling, a resource can be considered closed if for example : No operator use this resource; or In hierarchical planning, it corresponds to an already

processed abstraction level; or The decision has been taken to close the resource on

the current sub-tree :

Constraint-Based Approaches

close R insert an operator using R

Forbid insertion of any operator using R. Stronger pruning.

Page 174: Planning with Resources

174

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Algorithms based on time windows

Constraint-Based Approaches

Time-tabling [LePape 1994] Interesting activities A are those for which

emin(A) > smax(A).

Between smax(A) and emin(A) we know A will be executed.

mins

maxe

mine

maxs

Page 175: Planning with Resources

175

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

qmins

maxe

mine

maxs

Q

t

Aggregated necessary demand

QMAX

Constraint-Based Approaches

Algorithms based on time windows

Page 176: Planning with Resources

176

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

mins

maxe

mine

maxs

Q

t

Aggregated necessary demand

QMAX

Constraint-Based Approaches

Algorithms based on time windows

minemins

Page 177: Planning with Resources

177

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Time-tabling

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Page 178: Planning with Resources

178

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Algorithms based on time windows

Constraint-Based Approaches

Time-tabling Used for large problems

Worst case O(n) algorithm

Incremental

Smart about when to propagate and when not, group propagation, etc.

In practice a very fast algorithm

Page 179: Planning with Resources

179

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Disjunctive constraint Considers pairs (A, B) of activities If two activities can not overlap because of the capacity

they require, and one, say A, can not be scheduled before the other, then New time bounds are deduced A new precedence constraint is deduced

Page 180: Planning with Resources

180

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

)()( minmax BeAs

mins

maxe

mine

maxsA

mins

maxe

mine

maxsB

)()(

)()(

minmin

maxmax

BsAe

BsAe

mins

maxe

mine

maxsA

mins

maxe

mine

maxsB

Constraint-Based Approaches

Algorithms based on time windows

Disjunctive constraint on unary resource [Erschler 1976]

Page 181: Planning with Resources

181

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Disjunctive constraint

Page 182: Planning with Resources

182

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Disjunctive constraint Works on unary, discrete, and state resources More propagation than timetable constraint on unary

resources Low memory cost Needs fake activities to cope with resources not

available at certain times Algorithm : O(n2)

Page 183: Planning with Resources

183

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

][)]()()(}){([,, minmax AAppsAeA

Constraint-Based Approaches

Algorithms based on time windows

Edge-Finding [Carlier&Pinson 1990] [Nuijten 1994] [Baptiste&LePape 1995]

Detecting First Among n Activities on Unary Resource

Page 184: Planning with Resources

184

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Edge-Finding

B

C

A

6 16

7 15

4 16

p=4

p=5

p=2

B

C

A

6 16

7 15

4 7

p=4

p=5

Page 185: Planning with Resources

185

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Similar reasoning for detecting Last, Not First, Not Last with respect to a set

Edge-Finding can be extended to discrete resources [Nuijten 1994, Baptiste&LePape 1996]

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Page 186: Planning with Resources

186

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

])()()())()(.([},{

))max(),min([

maxmin BAC

AeBs

MAX CWBWAWAeBsQ

)]()([ BeAs

Constraint-Based Approaches

Algorithms based on time windows

Energetic Reasoning [Erschler&al 1991] Discrete resource: {A,B} Acts,

Page 187: Planning with Resources

187

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

C1

C2

A

6 16

5 15

16

p=1

p=3

p=4

B16

p=4

4

6

1

2

4

4

C1

C2

A

6 16

5 15

12

p=1

p=3

p=4

B16

p=4

4

8

Constraint-Based Approaches

Algorithms based on time windows

Energetic Reasoning

Page 188: Planning with Resources

188

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

Energetic Reasoning

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Page 189: Planning with Resources

189

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on time windows

More Propagation based on time windows Preemptive resource constraints: mixed edge-finding

[LePape&Baptiste 1998] Activity cannot be nth [Nuijten&LePape 1998] Energetic reasoning [Baptiste&al 1999] Multi-machine propagation [Sourd&Nuijten 2000]

Page 190: Planning with Resources

190

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Algorithms based on analyzing time bounds of activities propagate few (or even nothing) when the problem is not tight

Example: On discrete resources, for the time-table constraint, if for all activity of the schedule: emax - smin 2.pmin, the time-table constraint propagates nothing

t

smin emin

emaxsmax

Page 191: Planning with Resources

191

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

These propagation algorithms do not directly take into account precedence relations (but only through their effect on time bounds)

In PO Planning

Time bounds of operators are loose

Extensive usage of precedence relations between operators in the partial plan

Traditional resource propagation algorithms do not prune the search space enough

Page 192: Planning with Resources

192

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Example: Blocks world. Limited number of hands (2) modeled as a reservoir of capacity 2 and initial level 2

-1-1

-1

+1

+1

+1

Page 193: Planning with Resources

193

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Analyze precedence relations on the left side of the propagation rule (C())

Based on a Precedence Graph that collects and maintains precedence relations between activities:

Initial statement of the problem Precedence constraints inside a planning operator Search decisions (e.g.: causal link, threat, ordering

decision on resources) Discovered by propagation algorithms (disjunctive

constraint, edge-finding, energetic reasoning, emaxsmin).

Page 194: Planning with Resources

194

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Precedence Graph

Events x=(tx,qx) where the availability of a resource changes

Arcs : Two kind of arcs: tx<ty and tx ty

Transitive closure is incrementally maintained

+2+2

-1[-10,-5]

-2 +2

Activity

EventProductionConsumption{

{Arc <

Page 195: Planning with Resources

195

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Partition for an event x in a precedence graph

E(x)

x

U(x)

BE(x)

BS(x)

AE(x)

AS(x)

B(x) A(x)

Page 196: Planning with Resources

196

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Energy Precedence Propagation [Laborie 2001]

Does not assume the resource to be closed

For any solution:

In a partial schedule, we can decline this property to perform constraint propagation

YMAXY

QYpYqYsXs

XBUX

/))().(())((min)(

),(,

Page 197: Planning with Resources

197

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Energy Precedence Propagation [Unary,Discrete]Discrete resource: X U,

Y

MAXYQYpYqYsXsXB ]/))().(())((min)([)]([ minminminmin

B

X

0

p=4, q=2

C p=4, q=1

p=2q=1

E

p=2q=2

QMAX=2

D

B

X

0

p=4, q=2

C p=4, q=1

D

p=2q=1

E

p=2q=2

9

Page 198: Planning with Resources

198

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Energy Precedence Propagation

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Worst-case complexity: O(n2)

Page 199: Planning with Resources

199

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Balance Constraint [Cesta&Stella 1997,Laborie 2001] Assumption: when applied to a reservoir, all producers of

the reservoir are known in the current schedule Local property: for a given event x in a solution schedule,

we can compute the level of the reservoir just before x at date t(x)- as:

A schedule is a solution on the reservoir iff

In a partial schedule, we can decline this property to perform constraint propagation

)(

)()(xBSy

INIT yqLx

MAXQxUx )(, 0

Page 200: Planning with Resources

200

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation Given an event x, using the graph, we can compute

an upper bound on the reservoir level at date t(x)- assuming:All the production events y that may be executed strictly

before x are executed strictly before x and produce their maximal quantity q(y);

All the consumption events y that need to be executed strictly before x are executed strictly before x and consume their minimal quantity q(y);

All the consumption events that may be executed simultaneously or after x are executed simultaneously or after x

)(x

Page 201: Planning with Resources

201

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

INITLx)(

x

U(x)

E(x)BS(x) AS(x)

BE(x) AE(x)

)()(

max )(xUxBy

yp

)(min )(

xBSyyc

Constraint-Based Approaches

Page 202: Planning with Resources

202

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation Similar bounds can be computed:

Lower bound on the reservoir level at date t(x)- Lower/Upper bound on the reservoir level at date t(x)+

For symmetry reason, we focus on Given , the reservoir balance algorithm discovers:

FailuresNew bounds for required quantities of resources q(x)New bounds for time variables t(x)New precedence relations

)(x

)(x

Page 203: Planning with Resources

203

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation Discovering failures: As soon as: , no

solution exist that satisfy the precedence relations Property: the rule is sufficient to

ensure the soundness of the search on a reservoir w.r.t. the reservoir underflow.

A symmetrical property exists for reservoir overflow based on .

][])(,[ failxx 0

0 )(, xx

)(x

Page 204: Planning with Resources

204

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

E(x)

U(x)

BE(x)BS(x)

[-1,-1] [+1,+1]

[+0,+10] [-5,-5]

[-5,-4]

[-5,-5]

[+1,+1]

[+1,+3]

[+1,+2] [-2,-1]

LINIT=0

-(x)= 0 + (2+1+10+1) - (1+5+5+4) = -1 < 0 !!!

Constraint-Based Approaches

Page 205: Planning with Resources

205

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation Safe event: An event x is said to be safe if and only if

Property: If all the events are safe, then any instantiation of the time variable that satisfies the precedence constraints also satisfies the reservoir constraint. In other words, the current partial order is safe and the reservoir is “solved”.

00

)(,)(

)(,)(

xx

QxQx MAXMAX

Page 206: Planning with Resources

206

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation Reservoir balance equation:

In case the first part of the equation is such that:

It means that some events in will have to be executed strictly before x in order to produce at least:

)()(

max)(max )()()(

xUxBEyxBSyINIT ypyqLx

0 )(

max )(xBSy

INIT yqL

)()( xUxBE

)(max )()(

xBSyINIT yqLx

Page 207: Planning with Resources

207

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance PropagationSome events will have to be

executed strictly before x in order to produce at least

Let the set of production events in

sorted by increasing minimal time Let k be the smallest index such that: Then:

)()( xUxBEz

)(x

),...,,...,( ni zzz1

)()( xUxBE

)()(max xzpk

ii

1

)()( xtzt k

Page 208: Planning with Resources

208

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

E(x)

U(x)

BE(x)BS(x)

[-2,-2] [+2,+2]

[+0,+10] [-5,-5]

[-5,-4]

[-5,-5]

[+1,+2]

[+1,+3]

[+1,+2] [-2,-1]

LINIT=0

(x)= 0 - (2+10) + (2+5+5+4) = 4

[+1,+2]

Constraint-Based Approaches

Page 209: Planning with Resources

209

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation In AI Planning applications, if some producers of the

reservoir may still be inserted in the partial plan: transform the balance algorithm into a real truth criterion:Some events will have to be executed

strictly before x in order to produce at least

OR

Some operator containing a producing event z will have to be inserted such that t(z) < t(x)

Such a “truth criterion” is described in [Laborie 2003]

)()( xUxBEz )(x

Page 210: Planning with Resources

210

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Algorithms based on relative positions

Reservoir Balance Propagation

C() E()

Time Bounds Level Time Bounds Precedence Energy Precedence

Not First/Last

Worst-case complexity: O(n2) O(n3)

Page 211: Planning with Resources

211

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Unary

Discrete

Reservoir

Time-tabling Energe-

ticReason.

Edge-Finding

O(n)

O(n log n)

O(n3)O(n2)

Level-Based

Energy-Based

Time-Bounds analysis

Preced.Energy

Balance

O(n2)

O(n2)O(n3)

Precedence analysis

Disjunc-tive

Constraint-Based Approaches

O(n2)

O(n log n)O(n2)

Page 212: Planning with Resources

212

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Search Techniques

Branching Schemes Search Heuristics Beyond the Basic Search Scheme

Constraint-Based Approaches

Page 213: Planning with Resources

213

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Branching Schemes

Example of Branching Schemes :

Event Pair Ordering Setting Times

Page 214: Planning with Resources

214

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Branching Schemes

Property : In a solution for a unary resource, all the pairs of resource usage are ordered.

Activity Pair Ordering (Unary Resource) : Select a not-ordered pair of resource usages : (u,v) U Branch on : [e(u) s(v)] [e(v) s(u)] Needs a precedence graph to maintain the sets of not-

ordered pairs of resource usage

Page 215: Planning with Resources

215

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Branching Schemes

Property : On a capacity resource, a partial schedule where all the events are safe is a solution.

Event Pair Ordering (Discrete, Reservoir, etc.) : Select a critical pair of events (x,y) on a resource R

(event = start or end time-point of an activity using R) Critical Pair of events : not-ordered pair of event : (x,y)

such that neither x nor y is safe (in the sense of the balance constraint)

Branch on : [t(x) < t(y)] [t(x) t(y)]

Page 216: Planning with Resources

216

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Branching Schemes

Property: in a solution on a discrete resource, there is no Minimal Critical Sets.

Minimal Critical Set Ordering [Laborie&Ghallab 1995, Cesta&Oddi 2002] Select an MCS on a resource :

Branch on the resolvers of this MCS :

[t(e1) t(s3)] [t(e3) t(s1)] [t(e3) t(s2)]

s1

s2

s3

e1

e2

e3

q1+q2+q3 > Qq1+q2 Qq1+q3 Qq2+q3 Q

Page 217: Planning with Resources

217

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Branching Schemes

All previous branching schemes are complete Setting Times (All resources) :

Select an activity a in the schedule Branch on : [s(a) = smin(a)] [s(a) > smin(a)] Dominance rule relying on constraint propagation :

instead of posting [s(a) > smin(a)], activity a is marked as non-selectable until its start time has been updated by propagation.

Page 218: Planning with Resources

218

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Search Heuristics

Slack-Based Heuristics [Smith&Cheng 1993] Choose a resource where the slack of any subset of

potentially conflicting activities on that resource is minimal. Slack of a subset S is maxA S (emax(A)) – minA S (smin(A)) – sumA S p(A)

Sequence that resource / Take a sequencing decision on that resource.

Choose pair of unsequenced activities with minimal maximal slack. Maximal slack of A and B is max(emax(A) – smin(B), emax(B) – smin(A)) – p(A) – p(B).

Choose sequencing that leaves maximal slack.

Page 219: Planning with Resources

219

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Search Heuristics

Texture-based Heuristics [Beck&al 1997] Texture measurement: dynamic analysis of a search

state to reveal problem structure Heuristic: based on the revealed structure, find “most

critical” part of the search state and take a decision to reduce criticality

The texture measurement and the heuristic to take decisions are separate.

Note: for efficiency reasons one might want to make more than one decision before recomputing texture measurements

Page 220: Planning with Resources

220

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Search Heuristics

Example of Texture-based Heuristics: SumHeight Heuristic Texture measurement: a probabilistic estimate of the

extent to which activities are competing for each resource and time point (“contention”)

Find the most critical (highest contention) resource and time point

Take a decision to reduce contention

Constraint-Based Approaches

Page 221: Planning with Resources

221

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Search Heuristics

time

individualdemand

for R

smin emin smax emax

Constraint-Based Approaches

The SumHeight Texture Measurement: Individual Demand

Page 222: Planning with Resources

222

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Search Heuristics

time

aggregatedemandfor R2 R2

R2

R2

Constraint-Based Approaches

Page 223: Planning with Resources

223

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Approaches

Search Heuristics

The SumHeight Decision Find the resource, R*, and time point, t*, with highest

contention Find the 2 activities not sequenced with each other with

the highest individual demand for R* at t* Post a precedence constraint between them Complexity:

R = # resources, n = # activities per resource O(R.n.log(n)) for texture calculation O(n2) for finding decision after texture calculation

Page 224: Planning with Resources

224

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Shaving [Torres&Lopez 2000] Perform some kind or forward checking that exploit the

interactions between resources Use some global propagation algorithms to determine if

there exist a schedule that verify a property p E.g. Try posting A B on a unary resource ...

If no solution schedule verify p then p must be verified in any solution. Thus it can be inferred. … if global propagation algorithms fail, then infer the opposite

constraint B A

Constraint-Based Approaches

Page 225: Planning with Resources

225

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Shaving. Example of application: Time-Bound Shaving Activity A, Select such that emin(A) emax(A)

If propagating e(A) < leads to a dead-end: infer e(A) If propagating e(A) > leads to a dead-end: infer e(A)

Perform a dichotomic search on [emin(A), emax(A)] to compute the best adjustments

Other shavings: Precedence, Ranked First/Last activities

Constraint-Based Approaches

Page 226: Planning with Resources

226

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Shaving. Example (Tested on ILOG Scheduler): Famous Job-Shop problem mt10 (1010) Strong constraint propagation (disjunctive, edge-finder,

precedence energy) Strong Shaving (time-bounds, precedence, rank

first/last). Shave until a fix point is reached. Optimality proof requires:

2 choice points !!!! About 2mn CPU time

Constraint-Based Approaches

Page 227: Planning with Resources

227

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Probing Main idea: At each node of the search, solve a relaxed

version of the current schedule and use this solution to guide the search Relaxed problem: for example only keep temporal constraints

[ElSakkout&Wallace 2000] or cost relevant activities [Beck&Refalo 2001]

If the solution to the relaxed problem cannot be extended to a solution, identify the discrepancies and branch on the different alternatives to solve these discrepancies.

If the relaxed problem can be solved to optimality, it provides a lower bound on the objective function

Constraint-Based Approaches

Page 228: Planning with Resources

228

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Probing [ElSakkout&Wallace 2000, Beck&Refalo 2001] Example: Job-shop with Earliness/Tardiness Costs of

last activity

Constraint-Based Approaches

Page 229: Planning with Resources

229

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Probing During the search, maintain at each node the optimal

solution of a linear relaxation of the problem (no resource constraints)

Constraint-Based Approaches

Cost:

Precedence:

Time windows:

imimiii ddptxtcy ,,

mimiiii ptxddecy .,

jijiji asxas ,max,,min

1 jijiji xptx ,,,

Minimize subject to:i

iy

Page 230: Planning with Resources

230

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Beyond the Basic Search Scheme

Using the relaxed optimal start time (from LP), build textures

Identify a peak (where the texture > capacity) Select a pair of activities, A and B, at the peak Branch: (A B) (B A) New precedence constraints (as well as precedence

discovered by constraint propagation) are used to update the LP relaxation

Constraint-Based Approaches

Page 231: Planning with Resources

231

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Scheduling

Properties that contributed to the industrial success of Constraint-Based Scheduling The paradigm clearly separates the constraints

(semantics, propagation algorithms) from the search space exploration (branching schemes, heuristics)

Constraint propagation allows dramatically pruning the search before everything gets instantiated

Each constraint is an autonomous algorithm, the paradigm is extensible: new application-dependent constraints can easily be implemented

Conclusion

Page 232: Planning with Resources

232

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Scheduling

Properties that contributed to the industrial success of Constraint-Based Scheduling Constraint propagation algorithms often rely on some

bounds that can be seen as the optimal solution to a relaxed (sub)problem

In optimization problems, the search tree is pruned by computing some lower bound on the objective function, usually it corresponds to the optimal objective function of a relaxed problem

Powerful heuristics also often rely on analyzing a good solution to a relaxed problem

Conclusion

Page 233: Planning with Resources

233

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based Scheduling

Conclusion

Propagation Search

Real problem

Relaxed (sub)problems

Optimal solution

Good solution

bounds bounds heuristics

Page 234: Planning with Resources

234

PLANET International Summer School on AI Planning, Sept. 2002, Halkidiki, Greece

Constraint-Based AI Planning

Conclusion

Propagation Search

Real problem

Relaxed (sub)problems

Optimal solution

Good solution

bounds bounds heuristics

Part II

Part I