
11dcf0aa02f54b64be6ca9a84953403b.ppt
- Количество слайдов: 34
CSP: Examples • Industrial applications: scheduling, resource allocation, product configuration, etc. • AI: Logic inference, temporal reasoning, NLP, etc. • Puzzles: Sudoku & Minesweeper Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 1
Constraint propagation • Removes from the problem values (or combinations of values) that are inconsistent with the constraints < 3, 5, 7 = 1, 2, 10 < < < 2, 4, 6, 9 = < 1, 6, 11 < < 5, 6, 7, 8 3, 5, 7 8, 9, 11 • Does not eliminate any solution Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 2
Sudoku as a CSP • • Each cell is a variable (decision) with the domain [1. . 9] (choices) Two models: Binary, 810 All. Diff binary constraints Non-binary, 27 All. Diff constraints of arity 9 Joint work with C. Reeson Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 3
Propagation algorithms: demo • Arc Consistency (AC) • Generalized AC (GAC) GAC on All. Diff [Régin, 94] • Arcs that do not appear in any matching that saturates the variables correspond to variablevalue pairs that cannot appear in any solution 1 • GAC on All. Diff c 1 c 2 2 is poly time c 3 3 c 4 4 c 5 5 c 6 6 c 7 7 c 8 8 9 c 9 Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 4
Minesweeper as a CSP demo • Variables are the cells • Domains are {0, 1} (i. e. , safe or mined) • One constraint for each cell with a number (arity 1. . . 8) Exactly two mines: 0000011 0000101 0000110, etc. Exactly three mines: 0000111 0001101 0001110, etc. Joint work with R. Woodward, K. Bayer & J. Snyder Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 5
Geospatial reasoning Google Maps Yahoo Maps Actual location Microsoft Live Local (as of November 2006) Joint work with K. Bayer, M. Michalowski & C. A. Knoblock (USC) Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 6
Building Identification (BID) problem • Layout: streets and buildings S 1 = Building = Corner building Si = Street S 2 B 1 B 3 B 4 S 3 B 5 B 6 B 7 B 8 B 10 B 9 • Phone book – Complete/incomplete – Assumption: all addresses in phone book correspond to a building in the layout S 1#1, S 1#4, S 1#8, S 2#7, S 2#8, S 3#1, S 3#2, S 3#3, S 3#15, … Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 7
Basic (address numbering) rules • No two buildings can have the same address • Ordering – Numbers increase/decrease along a street • Parity – Numbers on a given side of a street are odd/even Parity Ordering B 1 < B 2 < B 1 B 3 Odd B 2 B 4 Even Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 8
Additional information Landmarks Gridlines 1600 Pennsylvania Avenue B 1 S 1 #138 B 2 B 1 S 1 #208 B 2 S 1 Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 9
Query 1. Given an address, what buildings could it be? 2. Given a building, what addresses could it have? = Building S 1 = Corner building Si = Street S 1#1, S 3#15 S 2 B 1 B 3 B 4 S 3 B 6 B 5 B 7 S 1#1, S 1#4, S 1#8, S 2#7, S 2#8, S 3#1, S 3#2, S 3#3, S 3#15 B 10 B 8 B 9 Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 10
CSP model Increasing. East • Parity constraints • Ordering constraints • Corner constraints • Phone-book constraints • Optional: grid constraints S 2 B 1 B 2 B 1 c S 1 Odd. On. North B 2 B 1 B 3 B 4 B 5 Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 11
Example constraint network S 1 S 2 B 1 B 3 B 4 S 3 B 6 B 7 B 5 B 10 B 8 B 9 = Building = Corner building Si = Street S 1#1, S 1#4, S 1#8, S 2#7, S 2#8, S 3#1, S 3#2, S 3#3, S 3#15 Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 12
GTAAP: Task • Hiring & managing GTAs as instructors + graders – Given • • • A set of courses A set of graduate teaching assistants A set of constraints that specify allowable assignments – Find a consistent & satisfactory assignment • • Consistent: assignment breaks no (hard) constraints Satisfactory: assignment maximizes 1. number of courses covered 2. happiness of the GTAs • Often, number of hired GTAs is insufficient Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Motivation • Context – “Most difficult duty of a department chair” [Reichenbach, 2000] – Assignments done manually, countless reviews, persistent inconsistencies – Unhappy instructors, unhappy GTAs, unhappy students • Observation – Computers are good at maintaining consistency – Humans are good at balancing tradeoffs • Our solution – An online, constraint-based system – With interactive & automated search mechanisms Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Outline • Task & Motivation • System Architecture & Interfaces • Scientific aspects – Problem Modeling – Problem Solving – Comparing & Characterizing Solvers • Motivation revisited & Conclusions Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
System Architecture Password Protected Access for GTAs http: //cse. unl. edu/~gta Other structured, semi-structured, or unstructured DBs Password Protected Access for Manager http: //cse. unl. edu/~gta Local DB Cooperative, hybrid Search Strategies In progress Visualization widgets 1. Web-interface for applicants 2. Web-interface for manager Interactive Search Automated Search Heuristic BT Stochastic LS Multi-agent Search Randomized BT 3. A local relational database Graphical selective queries 4. Drivers for Interactive assignments Automated search algorithms Constraint Systems Laboratory February 18, 2009 View / edit GTA records Setup classes Specify constraints Enforce pre-assignments CSP Modeling Examples
GTA interface: Preference Specification Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Manager interface: TA Hiring & Load Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Outline • Task & Motivation • System Architecture & Interfaces • Scientific aspects – Problem Modeling – Problem Solving – Comparing & Characterizing Solvers • Motivation revisited & Conclusions Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Constraint-based Model • Variables – Grading, conducting lectures, labs & recitations • Values – Hired GTAs (+ preference for each value in domain) • Constraints – Unary: ITA certification, enrollment, time conflict, nonzero preferences, etc. – Binary (Mutex): overlapping courses – Non-binary: same-TA, capacity, confinement • Objective – longest partial and consistent solution (primary criterion) – while maximizing GTAs’ preferences (secondary criterion) Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Outline • Task & Motivation • System Architecture & Interfaces • Scientific aspects – Problem Modeling – Problem Solving – Comparing & Characterizing Solvers • Motivation revisited & Conclusions Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Problem Solving • Interactive decision making – Seamlessly switching between perspectives – Propagates decisions (MAC) • Automated search algorithms – – – Heuristic backtrack search (BT) Stochastic local search (LS) Multi-agent search (ERA) Randomized backtrack search (RDGR) Future: Auction-based, GA, MIP, LD-search, etc. • On-going: Cooperative/hybrid strategies Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Manager interface: Interactive Selection Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Dual perspective Task-centered view Constraint Systems Laboratory Resource-centered view
Heuristic BT Search • Since we don’t know, a priori, whether instance is solvable, tight, or over-constrained – Modified basic backtrack mechanism to deal with this situation • We designed & tested various ordering heuristics: – Dynamic LD was consistently best • Branching factor relatively huge (30) Shallowest level reached by BT after … 24 hr: 51 (26%) 1 min: 55 (20%) Max depth: 57 Constraint Systems Laboratory of the tree: 69 Depth February 18, 2009 CSP Modeling Examples Number of variables: 69 – Causes thrashing, backtrack never reaches early variables
Stochastic Local Search • Hill-climbing with min-conflict heuristic • Constraint propagation: – To handle non-binary constraints (e. g. , higharity capacity constraints) • Greedy: – Consistent assignments are not undone • Random walk to avoid local maxima • Random restarts to recover from local maxima Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Multi-Agent Search (ERA) [Liu et al. 02] • “Extremely” decentralized local search – Agents (variables) seek to occupy best positions (values) – Environment records constraint violation in each position of an agent given positions of other agents – Agents move, egoistically, between positions according to reactive Rules • Decisions are local – An agent can always kick other agents from a favorite position even when value of ‘global objective function’ is not improved ERA appears immune to local optima • Lack of centralized control – Agents continue to kick each other Deadlock appears in over-constrained problems Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Randomized BT Search • Random variable/value selection allows BT to visit a wider area of the search space [Gomes et al. 98] • Restarts to overcome thrashing • Walsh proposed RGR [Walsh 99] • Our strategy, RDGR, improves RGR with dynamic choice of cutoff values for the restart strategy [Guddeti & Choueiry 04] Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Optimizing solutions • Primary criterion: solution length – BT, LS, ERA, RGR, RDGR • Secondary criterion: preference values – BT, LS, RGR, RDGR – Criterion: • Average preference • Geometric mean • Maximum minimal preference Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
More Solvers… • Interactive decision making • Automated search algorithms – BT, LS, ERA, RGR, RDGR. – Future: Auction-based, GA, MIP, LDsearch, etc. • On-going: Cooperative / hybrid strategies Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Outline • Task & Motivation • System Architecture & Interfaces • Scientific aspects – Problem Modeling – Problem Solving – Comparing & Characterizing Solvers • Motivation revisited & Conclusions Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Conclusions • Integrated interactive & automated problemsolving strategies – Reduced the burden of the manager – Lead to quick development of ‘stable’ solutions • Our efforts – Helped the department – Trained students in CP techniques – Paved new avenues for research • Cooperative, hybrid search • Visualization of solution space Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples
Other sample projects 1. Graduate TA Assignment Project (GTAAP) • Modeling, search, GUI 2. Temporal Reasoning • Constraint propagation, search, graph theory 3. Symmetry detection • Search, databases (computational) 4. Structural decompositions • Databases (theory), tractability results Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 33
The Research • • • Modeling & Reformulation Propagation algorithms Search algorithms Decomposition algorithms Symmetry identification & breaking Constraint Systems Laboratory February 18, 2009 CSP Modeling Examples 34