Title: Applications%20of%20Constraint%20Programming%20H.Simonis
1Applications of Constraint ProgrammingH.Simonis
2What is common among
- The production of Mirage 2000 fighter aircraft
- The personnel planning for the guards in all
French jails - The production of Belgian chocolates
- The selection of the music programme of a Pop
music radio station - The design of advanced signal processing chips
- The print engine controller in Xerox copiers
They all use constraint programming to solve
their problem
3Constraint Programming - in a nutshell
- Declarative description of problems with
- Variables which range over (finite) sets of
values - Constraints over subsets of variables which
restrict possible value combinations - A solution is a value assignment which satisfies
all constraints - Constraint propagation/reasoning
- Removing inconsistent values for variables
- Detect failure if constraint can not be satisfied
- Interaction of constraints via shared variables
- Incomplete
- Search
- User controlled assignment of values to variables
- Each step triggers constraint propagation
- Different domains require/allow different methods
4Constraint Satisfaction Problems (CSP)
- Different problems with common aspects
- Planning
- Scheduling
- Resource allocation
- Assignment
- Placement
- Logistics
- Financial decision making
- VLSI design
5Characteristics of these problems
- There are no general methods or algorithms
- NP-completeness
- different strategies and heuristics have to be
tested. - Requirements are quickly changing
- programs should be flexible enough to adapt to
these changes rapidly. - Decision support required
- co-operate with user
- friendly interfaces
6Benefits of CLP approach
- Short development time
- Fast prototyping
- Refining of modelling
- Same tool used for prototyping/production
- Compact code size
- Ease of understanding
- Maintenance
- Compositional development
- Changing requirements are localized
- No need to understand all aspects of problem to
add/change constraint - Good performance
- Fast answer
- Good results
- Optimal solutions rarely required
- Adapt solution to problem, not vice versa
- Bespoke application development
7Techniques behind CLP
Predicate logic Unification Non-determinism
Logic Programming
Constraint propagation Consistency checking Demons
CLP tools
Operations Research
Artificial Intelligence
Simplex Linear programming Integer
programming Implicit enumeration Branch
bound Flow algorithms Scheduling methods
Graph theory Combinatorics Spatial data
structures Equation solving methods
Mathematics
8Eclipse
- Prolog based constraint toolkit
- Developed first at ECRC, then IC-Parc
- Easy to develop new constraint methods
- Sets of existing methods/libraries
- Basis of problem solvers for PT
- Widely used for academic work (gt 500 sites)
9Example problem
- Solve the cryptarithmetic puzzle
- Each character represents a digit
- Different characters have different values
- Numbers do not start with 0
SEND MORE ------ MONEY
10Example Model
- top-
- S, E, N, D, M, O, R, Y 0..9,
- alldifferent(S, E, N, D, M, O, R, Y),
- S \ 0, M \ 0,
- 1000 S 100E 10N D
- 1000M 100O 10R E
- 10000 M 1000O 100N 10E Y,
- labeling(S, E, N, D, M, O, R, Y).
Variable definition
Constraints between variables
Search routine
11Constraint reasoning
- Simplification (each variable occurs once)
- 1000S in 1..9 91E in 0..9 D in 0..9
10R in 0..9 9000M in 1..9 900O in
0..9 90N in 0..9 Y in 0..9 - Evaluation lhs/rhs
- lhs in 1000..9918
- rhs in 9000..89919
- Merging of sides
- constraint in 9000..9918
- Consequence
- M 1
- S 9
- O in 0..1
- Propagation of alldifferent
- O 0
12Reasoning
- Re-evaluation of equality
- 10009 91E in 2..8 D in 2..8 10R in
2..8 90001 9000 90N in 2..8 Y in
2..8 - lhs in 9204..9816, rhs in 9182..9728, eq in
9204..9728 - N \ 2, E \ 8
- Re-evaluation, ...
- Continuing the process gives
- M 1, S 9, O 0, E in 4..7, N in 5..8, D in
2..8, R in 2..8, Y in 2..8
13Starting labeling
- First variable is E, first value is 4
- Propagation on equality gives
- 10009 914 D in 2..8 10R in 2..8
90001 9000 90N in 5..8 Y in 2..8 - results in N 5, D 8, R 8, Y 2
- Propagation on alldifferent fails
- Backtracking to last choice
14First alternative
- Next value for E is 5
- Propagation on equality gives
- 10009 915 D in 2..8 10R in 2..8
90001 9000 90N in 5..8 Y in 2..8 - results in N 6, R 8
- Constraint propagation (alldifferent equality)
gives - D 7, Y 2
- Problem solved
15Points to remember
- Even small problems create complex propagation
chains - The same constraint can be woken several times in
the same propagation loop - The order in which constraints are woken has an
influence on the speed, but not on the result - Propagation continues until no further
information is obtained - Search (under user control) required to find
ground solution - Basic structure of finite domain program always
the same - define variables
- define constraints
- user defined search
- typical pick variable and find value
16Success Stories for Constraint Logic Programming
17Overview
- Hardware design
- Compilation
- Financial problems
- Placement
- Cutting problems
- Stand allocation
- Air traffic control
- Frequency allocation
- Network configuration
- Product design
- Production step planning
- Production sequencing
- Production scheduling
- Satellite tasking
- Maintenance planning
- Product blending
- Time tabling
- Crew rotation
- Aircraft rotation
- Transport
- Personnel assignment
- Personnel requirement planning
18Five central topics
- Assignment
- Parking assignment
- Platform allocation
- Network Configuration
- Scheduling
- Production scheduling
- Project planning
- Transport
- Lorry, train, airlines
- Personnel assignment
- Timetabling, Rostering
- Train, airlines
19Stand allocation
- HIT (ICL Hong-Kong)
- assign ships to berths in container harbour
- developed with ECRCs version of CHIP
- then using DecisionPower (ICL)
- first operational constraint application
(1989-90) - APACHE (COSYTEC)
- stand allocation for airport
- Refinery berth allocation (ISAB)
- where to load/unload ships in refinery
20AIR FRANCE - APACHE
- Stand allocation system
- Originally developed for Air France, CDG2
- Packaged for large airports
- Complex constraint problem
- Technical operational constraints
- Incremental re-scheduler
- Cost model
- Max. nb passengers in contact
- Min. towing, bus usage
- Benefits and status
- Quasi real-time re-scheduling
- KAL, Turkish Airlines
21Network configuration
- RiskWise (PT)
- Locarim (France Telecom, COSYTEC)
- cabling of building
- Planets (UCB, Enher)
- electrical power network reconfiguration
- Load Balancing in Banking networks (ICON)
- distributed applications
- control network traffic
- Water Networks (UCB, ClocWise)
22RiskWise
- Traffic analysis/optimization for IP networks
- Find out end-to-end communication flows in the
network of an ISP - Suggest changes in network which optimize
investment - Handle incomplete data
23FRANCE TELECOM - LOCARIM
- Intelligent cabling system for large buildings
- developed with Telesystemes for France Telecom
- Application
- input scanned drawing
- specify requirements
- Optimization
- minimize cabling, drilling
- Reduce switches
- shortest path
- Status
- operational in 5 Telecom sites
- generates quotations
24Production scheduling
- Atlas (Monsanto)
- Herbizide production
- Cerestar (OM Partners)
- Glucose production
- KAPSS (Mitsubishi Chemical)
- offset printing plates
- Trefi Metaux (Sligos)
- heavy industry production scheduling
- Michelin
- rubber blending, rework optimization
25ATLAS (Monsanto)
- Scheduling system in chemical factory
- herbicide manufacturing and packaging
- integrated inventory control system
- Life system
- first phase operational since July 93
- second phase operational since March 94
- major revision in 98 (SAP connection)
- Developed jointly by
- OM Partners (Antwerp)
- COSYTEC
- Multi-user system
- multiple schedulers
- co-operative behavior
26DASSAULT - PLANE
- Assembly line scheduling
- developed by Dassault Aviation for Mirage 2000
Jet/ Falcon business jet - Two user system
- production planning 3-5 years
- commercial what-if sales aid
- Optimisation
- requirement to balance schedule
- minimise changes in production rate
- minimise storage costs
- Benefits and status
- replaces 2 week manual planning
- operational since Apr 94
- now used in US for business jets
27FINA - FORWARD
- Oil refinery production scheduling
- joint development by TECHNIP and COSYTEC
- incorporates ELF FORWARD LP tool
- Schedules daily production
- crude arrival -gt processing -gt delivery
- design, optimize and simulate
- Product Blending
- explanation facilities
- handling of over-constrained problems
- Status
- generic tool developed in 240 man days
- operational since June 94
- Operational at FINA, ISAB, BP
28Transport
- By Air
- AirPlanner (PT)
- Daysy (Lufthansa)
- Pilot (SAS)
- By Road
- Wincanton (IC-Parc)
- TACT (SunValley)
- EVA (EDF)
- By Rail
- CREW (Servair)
- COBRA (NWT)
29EDF- EVA
- Transportation of nuclear waste
- developed by GIST COSYTEC
- plans evacuation and transport for 54 sites
- Constraints
- availability of transport vehicles and vessels
- no and capacity of storage tanks
- compatibility of waste to vessels
- size of convoy, time
- Status
- operational since Oct 94
- 6 month plan in 5 minutes
30SERVAIR - CREW
- Crew rostering system
- assign service staff to TGV train timetable
- joint implementation with GSI
- Problem solver
- generates tours/cycles
- assigns skilled personnel
- Constraints
- union, physical, calendar
- Status
- operational since Mar 1995
- cost reduction by 5
31Personnel Planning
- RAC (IC-Parc)
- OPTISERVICE (RFO)
- Shifter (ERG Petroli)
- Gymnaste (UCF)
- MOSAR (Ministère de la JUSTICE)
32RFO - OPTI SERVICE
- Assignment of technical staff to tasks
- overseas radio broadcasting network - Radio
France Outre-mer - joint development by GIST and COSYTEC
- 250 journalists and technicians
- Features
- schedule manually, check, automatic
- rule builder to specify cost formulas
- Optimization
- minimize overtime, temporary staff
- compute cost of schedule
- Status
- operational since 1997
- installed worldwide in 8 sites
- Now used for other companies
- TSR
- Canal
33Rostering
- Ministère de la JUSTICE
- Rostering of prison guards
- Help to determine personnel needs
- Simulation / Calculation of anonymous rosters
- Provisional plans for one year
- Development by Cisi and COSYTEC
- 10 regional sites for 200 prisons
- Objectives
- planning obtained in minutes
- was 3 weeks manually
- reduction of overtime cost
- improved personnel satisfaction
- reduction of days lost
34Case Study A complex transportation problem
35TACT Transport planning and resource scheduling
- Transport planning and scheduling for SVF/Cargill
UK - delivering chicken/turkeys from farms to
factories - JIT arrival at factory
- combined
- planning
- scheduling
- assignment
- multi-resource problem, interaction between
resource types - Developed by COSYTEC
- Operational since 2/95
- Revising decision making process
- formalizing current procedures
- spread knowledge inside company
36Problem
- Satisfy order book with available resources
- Transport Qty of Type from Source to Sink
- Schedule operations
- Assign resources to activities
Depot
- Tour generation
- Start in depot
- Connect orders to tours
- Use of passive transport
- End in depot
37Integrated transport problem
- Loading
- Teams, Drivers, Forklifts, Lorries
- Transport
- Drivers, Lorries, Forklifts
- Unloading
- Drivers, Personnel, Storage Area, Lorries
- Cleaning
- Personnel, Lorries, Forklifts
38Application Look
Menubar
List
Gantt chart
Details and status
39Solver Architecture
Orders
How many trips?
Plan
When to leave or to arrive?
Schedule
Who is doing what?
Assignment
40Planning
- How many trips are required
- lorry types
- drag trailers
- transport restriction
- volume/weight limits
- Merging of orders
- same source/sink
- same type
- Fork lift requirements
- resource needed for loading
- take out with first trip
- bring back with last trip
- optimization
41Scheduling
- On departure side
- all trips for same order must be scheduled
together - no gaps
- no concurrency
- loading times depend on team, lorry type and
product - On arrival side
- JIT schedule
- producer/consumer behavior
- very limited storage area
- limited storage time
- minimum stock level required
42Producer/Consumer Behavior
43Assignment
- Find compatible resources for each activity
- multiple resource problem
- interaction between resources
- conflict resolution
- Respect constraints
- working time
- rest periods
- work load
- Balance use of resources of same type
- teams
- drivers
- Minimize use of outside resources
44User control
- The user is in command
- modification of constraints
- choice of strategies
- relaxation of constraints
- Different priorities of various users
- in-time delivery
- use of resources
- need for overtime
- balancing work load
- Need for compromise
- Improved reactivity
- events
- rescheduling
45Problem solver
- Large scale, complex model
- Inter-related problem solvers
- Use of global constraints essential
- cumulative
- diffn
- cycle
- Explanation facilities
- meta programming (Prolog feature)
- relaxation of global constraints possible in CHIP
- Re-scheduling/re-use of existing solution
- Constraint solver / constraint check
46The Cumulative global constraint
- Cumulative constraint
- Resource limits over periods of time
- Upper/lower limits
- Soft/hard limits
- Gradual constraint relaxation
- Application
- Resource restrictive scheduling, producer
consumer constraints, disjunctive schedule,
manpower constraints, overtime
47Cumulative
- Methods
- obligatory parts
- task intervals
- available space
- many more (25000 lines of C code)
- Concepts
- one constraint may be used for different purposes
48The Diffn global constraint
- Diffn constraint
- non overlapping areas on n-dimensional rectangles
- distances between rectangles
- limit use of areas
- relaxation
- Application
- layout, packing, resource assignment, setup,
distribution planning, time-tabling
49Diffn
- Methods
- obligatory parts
- region intervals
- max flow on assignment
- available space
- many others (32000 lines of C code)
- Concepts
50The Cycle global constraint
- Cycle constraint
- Finds cycles in directed graphs with minimal cost
- Assign resources, find compatible start dates
- Applications
- Tour planning, personnel rotation, distribution
problems, production sequencing
51Cycle
- Methods
- connected components
- bi-partite matching
- non-oriented graph concepts
- shortest/longest paths
- micro-rules
- many others (38000 lines of C code)
- Concepts
52Evaluation
- Operational since spring 1995
- Scheduling speed
- 8 hours manual work
- 15 min with TACT application
- Return on investment (estimated by customer) in 6
month - transport fleet constant at increasing demand
- Push button solution
- little manual interaction
- Application has stayed up-to-date for last five
years - new types of lorries
- changing status of catching teams
- ...
53Statistics
- 10 month project duration
- study, specification
- development
- implementation
- 36000 lines of CHIP code
- complete application in CHIP
- except AS/400 interface to ORACLE
- 7000 lines of code for solver
- explanation facilities
- automated constraint relaxation
- specialized lower bound calculation
54Summary
- Large scale problems can be solved with CLP
- Very high level language framework allows rapid
development - in industrial terms
- Complex, customer specific conditions can be
handled - Global constraints allow
- Expression
- Resolution of complex problems
- Most important
- Ease of modelling
- Speed of development
- Reactivity to customer demands
55Some pointers
- Constraint Archive
- www.cs.unh.edu/ccc/archive
- Constraints Journal
- www.wkap.nl/journals/constraints
- Principles and Practice of Constraint Programming
- www.cs.ualberta.ca/ai/cp
- CP99 in Washington,DC/ CP2000 in Singapore
- Practical Application of Constraint Technologies
and Logic Programming - www.practical-applications.co.uk/PACLP99
- On-line guide to Constraint Programming (R.
Bartak) - http//kti.mff.cuni.cz/bartak/constraints
- K. Marriott, P.J. Stuckey
- Programming with Constraints An Introduction,
MIT Press, 1998