Upload
knox-abbott
View
20
Download
1
Tags:
Embed Size (px)
DESCRIPTION
CPM!. JChoco. We jumped in, and took it for a spin. Some counting problems. Sudoku you got your hands dirty. search. Opening up the hood: part 1, search. So how does CP work?. BT: Chronological BackTracking Thrashing! FC: forward checking Thrashing! - PowerPoint PPT Presentation
Citation preview
It is rocket science
CPM
Just do it!
We jumped in and did it!
mantra
A constraint satisfaction problem (CSP) is a triple, (V,D,C) where V is a set of variables, each with a domain of values (in D) and a set of constraints C restricting the set of allowed values.The problem is then to find an assignment of values to variablesfrom their domains, such that the constraints are satisfied (sat) …or to show no such assignment exists (unsat)
Generally, this problem in NP-complete
looking under the hood search
looking under the hood search
Taking graph colouring as an example (simple & easy to visualise)
•chronological backtracking • backward checking• thrashing (slavishly repeating actions with same outcomes)
•chronological backtracking • forward checking• Also thrashes
•conflict directed backjumping• learning from dead-ends• check backwards or forwards
looking under the hood Arc consistency
looking under the hood Arc consistency
viewing the CSP as a graph (the constraint graph)
node consistency (1-consistency) and arc consistency (2-consistency)
looking under the hood Arc consistency
• AC3 for binary constraints (using revise)• Coarse grained ).( 3deO
looking under the hood Arc consistency
• Fine grained, two pass algorithms• AC4, AC6, …, AC8 ).( 2deO
looking under the hood Arc consistency
• Object oriented perspective (AC5)• Constraints as objects• Specialised revise function• Complexity then a function of revision
looking under the hood Arc consistency
• AC2001 • A simple trick makes coarse grained optimal (when we have no semantics to exploit)
looking under the hood Arc consistency
looking under the hood all different
looking under the hood all different
An example of a specialised constraint•N-ary•Use of Hall sets•Example was sudoku
looking under the hood all different
looking under the hood heuristics
looking under the hood heuristics
Static, topological properties
Fail-first, and it’s realisation
Constrainedness
Dual viewpoint heuristics
Promise
Regret
Domain Specific (example JSSP slack-based)
looking under the hood heuristics
A problemNumber Partitioning
• A variety of models• Static variable ordering heuristic• Symmetry breaking• Use of “scalar” constraint• Optimisation (minimise difference)• First experience of phase transition phenomena
A problemBin Packing
• A model presented• Modelling of bins using 0/1 variables and scalar• … and sum• Optimise as sequence of decision problems• Recognise decision variables• Effect of value ordering• First-fit decreasing heuristic• Symmetry breaking on bins
• lex or load?• Consider alternative model• Code & empirical study
A problem
Bin Packing N-Queens
Crystal Maze Job Shop Scheduling Problem
Graph Colouring
Number Partitioning
Banquet Planning
Meeting Scheduling Problem
Workforce Management
Stable Roommates
Super Tree ConstructionMatch Race Scheduling
Maximum Clique
A problem
Lecture Lecture
Lecture Lecture
Lecture
Lecture
Assessed Exercise
Assessed Exercise
Homework
For Information Only
For Information OnlyFor Information Only
Lecture
A problem
A problem
Phase Transition Phenomena Where are the hard problems?
• Ubiquitous • SAT, GCol, Number Partition, SAT, …
• Theory! (kappa)• Can use kappa to engineer heuristics!
Phase Transition Phenomena Where are the hard problems?
Discrepancy Search
• Limited Discrepancy Search … and why it might work• Improved LDS• Take discrepancies late or early?
Parallel CP (part 1)
Parallel CP (part 2)
Local Search
It’s search Jim, but not as we know it
Local Search
• TSP as a working example• Hill Climbing (HC)
• Cost function• Representation• Move operator
• HC gets stuck in local minima• Local search cannot prove optimality• Local search can be very very very fast
Local Search
Escaping local minima•Simulated annealing (SA)
• Needs an annealing schedule• Parameter need to be tuned
•Tabu Search (TS)• Tabu list and what to put in it
•Guided Local Search (GLS)•Genetic Algorithms (GA)
• Population based• Representation as chromosone• Cross over and mutation• Fitness function• Survival of the fittest
• Balance exploration with exploitation
5 lectures
Levels of Consistency
• Node Consistency (NC)• Arc-consistency (AC)• Path Consistency (PC)• Generalised arc-consistency (GAC)• Bounds consistency• Inverse Path Consistency (IPC aka PIC)• Singleton Arc-consistency (SAC)• … and others
So?
• Know about BT & FC and CBJ (high level)
• Know about levels of consistency and cost• NC, AC, PC, PIC, SAC, GAC
• Know about local search• HC, SA, TS, GA would suffice
• Discrepancy Search and Parallel Search• Why LDS? • Why parallel search?• What is best that can be had?
• Heuristics• What do they hope to achieve?• Can you suggest some?• Given a problem, what would be appropriate?
• …
So?Part 1 Preparing for the exam
• Model and Solve a given problem•Variables, domains, constraints, …•…, heuristics, symmetry break, alternative model
• Have a look at Ciaran’s slides on allDifferent
• If you were given a piece of choco3 code could you understand it?•“name that code”
• If you were given some variables, with domains, and constraints•Could you make the variables arc consistent?
• Have a look at the homework•Why not do the homework.?
• The last “Three Problems”•Ignore these. These were to give you insight to research in CP•This is a Masters course after all
• …
So?Part 2 Preparing for the exam
• Follow up the links on Barbara Smith’s AR33 notes
So?Part 3 Preparing for the exam
30 lectures were given
One of your challenges for the future is to “do more with less”.
You are now in a better position to do that.
Many of the really important, and unseen, computational challengesare hard: resource allocation, packing, production scheduling, workforcemanagement, routing problems, transportation problems, matching, rostering,timetabling, energy use, energy planning ….
Few people stop to think how these problems are actually addressed, if at all.
You have looked at some of these problems. You have tried to model and solve them, sometimesusing complete search (bt, fc, cbj, mac), quasi-complete (lds) and incomplete (local search),finding appropriate heuristics and trying to locate “the really hard problems”
Last Words