Constraint Programming for Industrial Applications H Simonis 2272021

















![Example of tree search credit([X 1. . X 10], 8, 10, my_delete, my_indomain, 4, Example of tree search credit([X 1. . X 10], 8, 10, my_delete, my_indomain, 4,](https://slidetodoc.com/presentation_image_h/175c9fe08cbd7bf92097bf5955058842/image-18.jpg)

















































- Slides: 67
Constraint Programming for Industrial Applications H. Simonis 2/27/2021 1
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 2 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 3
Constraint Satisfaction Problems (CSP) § Combinatorial Optimization Problems § Different problems with common aspects § § § § 4 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 5
Techniques behind CLP Predicate logic Logic Programming Unification Non-determinism Constraint propagation Consistency checking Demons Artificial Intelligence CLP tools Operations Research Simplex & Linear programming Integer programming Implicit enumeration Graph theory Combinatorics Spatial data structures Equation solving methods 6 Branch & bound Mathematics Flow algorithms Scheduling methods
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) 7
CLP tool history logic based Prolog III CLP(R) SNI Prolog CHIP Decision Power Prolog IV Eclipse 8 Charme Object cc(FD) Oz ALICE CHIP SEPIA CAL BNR Other base language CHIP V 4 CHIP V 5 Pecos Solver CHIP lib Claire
Classification of CLP solvers § Computation domain § Deterministic solver (search under user control) § Efficient methods § More than one application § Complete/incomplete § decide satisfiability of constraint sets § complexity of solver/ simplicity of programs § Methods § syntactic: domain independent § semantic: domain dependent 9
Constraint system structure Constraints Complete solver Boolean Rational Incomplete solver Interval Others Constraint solver Control Heuristics Variable selection Back tracking Value selection numerical Boolean Others Domain concept Metaheuristics semantic syntactic symbolic equality inequality disequality 10 Finite domains element cumulative diffn cycle among sequence
Computation domains § Finite domains § Linear arithmetic § Boolean § Pseudo Boolean § Non-linear arithmetic § Intervals § Sets, sequences, lists 11 the initial domains in Prolog III, CLP(R) and CHIP
Incomplete finite domain solver § Domain § finite sets of values § subsets of natural numbers § Need for enumeration § Classification criteria § § constraint granularity richness of constraint sets propagation results user definable constraints/control § Methods § explicit domain representation § bound propagation/ removal of interior values § heuristics based on domains 12
Need for global constraints X in {2, 3} Y in {2, 3} 1 Y 2 Z 3 U 4 U in {1, 2, 3, 4} Z in {1, 3} local reasoning, no action 13 X global reasoning, detect implications by bi-partite matching
Global constraints § Work on sets of variables § Global conditions, not local constraints § Semantic methods § § Operations Research Spatial algorithms Graph theory Network flows § Building blocks (high-level constraint primitives) § § § 14 Multi-purpose As general as possible Usable with other constraints Very strong propagation Acceptable algorithmic complexity
Constraint morphology precedence diffn cumulative sequence cycle case atmost, atleast circuit element Resource Tour Dependency among alldifferent setup disjunctive permutation = Different 15 prod/cons >=, distance Order
Search tree visualization § Generation of search tree representation at run-time § Shows parent child relation, failed sub-trees, success nodes § In examples here § leaf failure nodes suppressed § failure trees not collapsed § Interface a set of simple meta-call predicates § Supported by work in DISCIPL Esprit project § Declarative debugging § Visualization of constraint programming results § Understand behaviour of different strategies 16
Search tree tool Menubar Panel Tree view Other Views, here domain state Info Area 17
Example of tree search credit([X 1. . X 10], 8, 10, my_delete, my_indomain, 4, part(1, 2)), 18
Success Stories for Constraint Logic Programming COSYTEC – IC-Parc 2/27/2021 19
Overview 20 § Hardware design § Production scheduling § Compilation § Satellite tasking § Financial problems § Maintenance planning § Placement § Product blending § Cutting problems § Time tabling § Stand allocation § Crew rotation § Air traffic control § Aircraft rotation § Frequency allocation § Transport § Network configuration § Personnel assignment § Product design § § Production step planning Personnel requirement planning § Production sequencing
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 21
Stand allocation § HIT (ICL Hong-Kong) § § assign ships to berths in container harbour developed with ECRC’s version of CHIP then using Decision. Power (ICL) first operational constraint application (1989 -90) § APACHE (COSYTEC) § stand allocation for airport § Refinery berth allocation (ISAB) § where to load/unload ships in refinery 22
AIR FRANCE - APACHE § Stand allocation system § Originally developed for Air France, CDG 2 § 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 23
Network configuration § Risk. Wise (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, Cloc. Wise) 24
Risk. Wise § 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 25
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 26
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 27
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 28
Transport § By Air § Air. Planner (PT) § Daysy (Lufthansa) § Pilot (SAS) § By Road § Wincanton (IC-Parc) § TACT (Sun. Valley) § EVA (EDF) § By Rail § CREW (Servair) § COBRA (NWT) 29
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 30
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% 31
Personnel Planning § RAC (IC-Parc) § OPTISERVICE (RFO) § Shifter (ERG Petroli) § Gymnaste (UCF) § MOSAR (Ministère de la JUSTICE) 32
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+ 33
Case Study: Semi Process Industry 2/27/2021 34
ATLAS (Monsanto, Antwerp) § 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 PC/UNIX system § multiple schedulers § co-operative behavior 35
Manufacturing Process Formulation intermediate products Packaging Outside G Dr F 1 raw material F 2 L 1 L 2 L 3 Gr 36 L 4 finished products Holding area
Dynamic Scheduling Environment Sales forecast (6 month horizon) Orders (delay 1 day to 4 weeks) Stock level Arrivals (lead time 3 weeks) Data base Users update planned/realized Production Schedulers Factory Formulation Packaging Purchasing Production 37 Shop floor data
Scheduling Process Users Schedulers Factory Formulation Packaging Priority orders Fine tuning of sequence Purchasing Production Visualization of schedule (stock level, delays, down times. . . ) Production problems medium/long term impact short term reaction Old schedule New Schedule Re-scheduling Formulation Re-scheduling Packaging 38
Architecture IBM - VM Antwerp X 25 IBM - MVS SAS Brussels Scheduling CHIP USA ORACLE Users PC / XWindows GUI HP UNIX Ethernet 39 Planner Factory Scheduler Formulation Scheduler Packaging Production manager Purchasing
The system § Connection to other systems § Data download/upload from/to local and remote mainframes § End-user connection via PCs § Data base § Local on UNIX machine § ORACLE SQL standard § Forms/reports facilities § Multi-user tool § § 40 Multiple schedulers for parts of production Inventory control Production Multiple scenarios; one schedule
Constraint solver § Constraints handled § § § § Machine choice Sequence/ machine dependent set-up Manpower limits Component consumer constraints Finished product producer constraint Producer/consumer constraints for intermediate products Production planning for batch part § Number of batches for intermediate products § Optimum batch sizing § Limited stock levels 41
The Cumulative global constraint cumulative u. Cumulative constraint – Resource limits over periods of time – Upper/lower limits – Soft/hard limits – Gradual constraint relaxation u. Application – Resource restrictive scheduling, producer consumer constraints, disjunctive schedule, manpower constraints, overtime 42
Cumulative § Methods § § obligatory parts task intervals available space many more (25000 lines of C code) § Concepts § one constraint may be used for different purposes 43
The Diffn global constraint diffn u. Diffn constraint – non overlapping areas on n-dimensional rectangles – distances between rectangles – limit use of areas – relaxation u. Application – layout, packing, resource assignment, setup, distribution planning, time-tabling 44
Diffn § Methods § § § obligatory parts region intervals max flow on assignment available space many others (32000 lines of C code) § Concepts 45
The Cycle global constraint cycle u. Cycle constraint – Finds cycles in directed graphs with minimal cost – Assign resources, find compatible start dates u. Applications – Tour planning, personnel rotation, distribution problems, production sequencing 46
Cycle § Methods § § § connected components bi-partite matching non-oriented graph concepts shortest/longest paths micro-rules many others (38000 lines of C code) § Concepts 47
ATLAS - Summary § End-user system § Direct manipulation § Constraints not visible to user § Changes/strategies expressed via interface § Complex scheduling problem § Real-life, not pure problem § Interaction/conflicts between constraints § Incremental expression with constraints § Development effort (250 days) § § 48 Integration Data base reporting Graphical interface Problem solver
The CHIP system: Constraints and. . . Application XGIP QUIC Objects Solvers Application CHIP EMC/CLIC 49 CHIP++
Behind the scene § CHIP kernel § Prolog § Core Constraints § Global Constraints § Interfaces 175000 lines 15000 20000 140000 5000 lines § CLIC § EMC § QUIC 50 § XGIP graphics 20000 lines § Graphics libraries 17000 lines
A typical decision support application Solver GUI d. B 51 DATA Reporting Libraries
Application framework § Building blocks - data management and GUI § description, upload, download, windows, Gantt chart, lists, diagrams, panels § Built on top of comprehensive data model § single point of reference, maintenance, extensions § General enough for different application domains § manufacturing, transport, chemical, human resources § Obvious benefits § code size, application quality, development speed, decreased maintenance, etc. 52
Data model § Single point of reference § Object model expressed in CHIP++ § Meta program generates d. B model, hooks to GUI § Provides I/O to save and load object model 53
Needs of an industrial system § Lines of code for a live application § Development speed, tools, risk § Integration § User interface § Solver a must 54
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 55
The Future: Constraint Application Generators CHIP Factory 2/27/2021 56
Approach § CHIP Factory § Program generator for C++ § CHIP constraint library § Generates (complete) application from specification § § 57 data model user interface data base solver
Problem Description § Example application from LISCOS Project (BASF) § Two stage, continuous process scheduling problem § First stage production § § intermediate products (10) batch based process campaign based schedule setup times/costs on one line § Intermediate product storage § producer/consumer constraints § Second stage production § finished products (100) § machine choice, machine restrictions § variable production rates on machines 58
Problem Description (2) 59
Object Model 60
GUI Design list gantt chart 61
Constraint Model § Disj. Task constraints § Machine. Choice. Task constraints § Disj. Machine resource constraint § Machine choice resource constraint § Producer/Consumer constraint 62
Disj. Task constraints post(end_var == start_var + duration_var) post(duration_var == solver. convert. Duration. To. Domain(duration)) 63
Machine. Choice constraint diffn_entries(entries); forall(task, machine_choice_task, entries. add(task. start_var, task. resource_var, task. duration_var, 1) ); diffn_post(entries) 64
Finished Application 65
Summary § 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 66
Some 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 § CP 99 in Washington, DC/ CP 2000 in Singapore § Practical Application of Constraint Technologies and Logic Programming § www. practical-applications. co. uk/PACLP 99 § 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 67



































































