550 likes | 692 Views
Applications of Constraint Programming H.Simonis. What 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
E N D
What 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
Constraint 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
Constraint Satisfaction Problems (CSP) • Different problems with common aspects • Planning • Scheduling • Resource allocation • Assignment • Placement • Logistics • Financial decision making • VLSI design
Characteristics 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
Benefits 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
Techniques behind CLP Predicate logic Unification Non-determinism Logic Programming Constraint propagation Consistency checking Demons CLP tools Artificial Intelligence Operations Research Simplex & Linear programming Integer programming Implicit enumeration Branch & bound Flow algorithms Scheduling methods Graph theory Combinatorics Spatial data structures Equation solving methods Mathematics
Eclipse • 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 (> 500 sites)
Example problem • Solve the cryptarithmetic puzzle • Each character represents a digit • Different characters have different values • Numbers do not start with 0 SEND +MORE ------ MONEY
Example: 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 + 100*E + 10*N + D + 1000*M + 100*O + 10*R + E = 10000 *M + 1000*O + 100*N + 10*E + Y, labeling([S, E, N, D, M, O, R, Y]). Variable definition Constraints between variables Search routine
Constraint reasoning • Simplification (each variable occurs once) • 1000*S in {1..9}+ 91*E in {0..9} + D in {0..9} + 10*R in {0..9} = 9000*M in {1..9} +900*O in {0..9} + 90*N 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
Reasoning • Re-evaluation of equality • 1000*9+ 91*E in {2..8} + D in {2..8} + 10*R in {2..8} = 9000*1 +900*0 + 90*N 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
Starting labeling • First variable is E, first value is 4 • Propagation on equality gives • 1000*9+ 91*4 + D in {2..8} + 10*R in {2..8} = 9000*1 +900*0 + 90*N 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
First alternative • Next value for E is 5 • Propagation on equality gives • 1000*9+ 91*5 + D in {2..8} + 10*R in {2..8} = 9000*1 +900*0 + 90*N in {5..8} + Y in {2..8} • results in N = 6, R = 8 • Constraint propagation (alldifferent + equality) gives • D = 7, Y = 2 • Problem solved
Points 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
Success Stories for Constraint Logic Programming COSYTEC – IC-Parc
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 Overview
Five central topics • Assignment • Parking assignment • Platform allocation • Network Configuration • Scheduling • Production scheduling • Project planning • Transport • Lorry, train, airlines • Personnel assignment • Timetabling, Rostering • Train, airlines
Stand allocation • HIT (ICL Hong-Kong) • assign ships to berths in container harbour • developed with ECRC’s 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
AIR 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
Network 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)
RiskWise • 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
FRANCE 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
Production 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
Packaging Formulation Out finished products G Dr F1 Holding area L1 raw material L2 F2 L3 Gr L4 ATLAS (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
DASSAULT - 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
FINA - FORWARD • Oil refinery production scheduling • joint development by TECHNIP and COSYTEC • incorporates ELF FORWARD LP tool • Schedules daily production • crude arrival -> processing -> 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
Transport • By Air • AirPlanner (PT) • Daysy (Lufthansa) • Pilot (SAS) • By Road • Wincanton (IC-Parc) • TACT (SunValley) • EVA (EDF) • By Rail • CREW (Servair) • COBRA (NWT)
EDF- 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
SERVAIR - 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%
Personnel Planning • RAC (IC-Parc) • OPTISERVICE (RFO) • Shifter (ERG Petroli) • Gymnaste (UCF) • MOSAR (Ministère de la JUSTICE)
RFO - 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+
Rostering • 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
TACT: 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
Problem • 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
Integrated transport problem • Loading • Teams, Drivers, Forklifts, Lorries • Transport • Drivers, Lorries, Forklifts • Unloading • Drivers, Personnel, Storage Area, Lorries • Cleaning • Personnel, Lorries, Forklifts
Application Look Menubar List Gantt chart Details and status
Solver Architecture Orders How many trips? Plan When to leave or to arrive? Schedule Who is doing what? Assignment
Planning • 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
Scheduling • 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
Assignment • 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
User 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
Problem 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
cumulative The 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
Cumulative • Methods • obligatory parts • task intervals • available space • many more (25000 lines of C code) • Concepts • one constraint may be used for different purposes
diffn The 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
Diffn • Methods • obligatory parts • region intervals • max flow on assignment • available space • many others (32000 lines of C code) • Concepts
cycle The 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