Constraint satisfaction problems. Lirong Xia

Similar documents
Uninformed search. Lirong Xia

Comparison Sorts. EECS 2011 Prof. J. Elder - 1 -

Support Vector Machines

Coalitional Game Theory

Cloning in Elections

The Australian Society for Operations Research

Analyzing and Representing Two-Mode Network Data Week 8: Reading Notes

Cloning in Elections 1

Hoboken Public Schools. Algebra II Honors Curriculum

CS 4407 Algorithms Greedy Algorithms and Minimum Spanning Trees

Patterns in Congressional Earmarks

Dimension Reduction. Why and How

How hard is it to control sequential elections via the agenda?

FREEDOM ON THE NET 2011: GLOBAL GRAPHS

Title: Solving Problems by Searching AIMA: Chapter 3 (Sections 3.1, 3.2 and 3.3)

ECE250: Algorithms and Data Structures Trees

Explaining rational decision making by arguing

Political Districting for Elections to the German Bundestag: An Optimization-Based Multi-Stage Heuristic Respecting Administrative Boundaries

Maps, Hash Tables and Dictionaries

Analysis of the Reputation System and User Contributions on a Question Answering Website: StackOverflow

Computational Social Choice: Spring 2017

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

Overview. Ø Neural Networks are considered black-box models Ø They are complex and do not provide much insight into variable relationships

Networked Games: Coloring, Consensus and Voting. Prof. Michael Kearns Networked Life NETS 112 Fall 2013

Event Based Sequential Program Development: Application to Constructing a Pointer Program

Approval Voting Theory with Multiple Levels of Approval

Case Study: Border Protection

Introduction to Computational Social Choice. Yann Chevaleyre. LAMSADE, Université Paris-Dauphine

Influence in Social Networks

Studies in Computational Aspects of Voting

Voting and Complexity

Multi-Winner Elections: Complexity of Manipulation, Control, and Winner-Determination

Title: Local Search Required reading: AIMA, Chapter 4 LWH: Chapters 6, 10, 13 and 14.

Decomposition and Complexity of Hereditary History Preserving Bisimulation on BPP

Computational social choice Combinatorial voting. Lirong Xia

Subreddit Recommendations within Reddit Communities

Network Indicators: a new generation of measures? Exploratory review and illustration based on ESS data

Pathbreakers? Women's Electoral Success and Future Political Participation

Maps and Hash Tables. EECS 2011 Prof. J. Elder - 1 -

Hyo-Shin Kwon & Yi-Yi Chen

Introduction to Game Theory. Lirong Xia

Fine-Grained Opinion Extraction with Markov Logic Networks

Solutions of Implication Constraints yield Type Inference for More General Algebraic Data Types

oductivity Estimates for Alien and Domestic Strawberry Workers and the Number of Farm Workers Required to Harvest the 1988 Strawberry Crop

VOTING DYNAMICS IN INNOVATION SYSTEMS

Priority Queues & Heaps

Simple methods for single winner elections

Minimum Spanning Tree Union-Find Data Structure. Feb 28, 2018 CSCI211 - Sprenkle. Comcast wants to lay cable in a neighborhood. Neighborhood Layout

Priority Queues & Heaps

Computational Social Processes. Lirong Xia

DATA TO POLICY PROJECT. Using real data to solve real problems

Cluster Analysis. (see also: Segmentation)

Generalized Scoring Rules: A Framework That Reconciles Borda and Condorcet

Voting on combinatorial domains. LAMSADE, CNRS Université Paris-Dauphine. FET-11, session on Computational Social Choice

Parameterized Control Complexity in Bucklin Voting and in Fallback Voting 1

Doctoral Research Agenda

Australian AI 2015 Tutorial Program Computational Social Choice

On the Complexity of Voting Manipulation under Randomized Tie-Breaking

Computational Inelasticity FHLN05. Assignment A non-linear elasto-plastic problem

CSCI211: Intro Objectives

Complexity of Strategic Behavior in Multi-Winner Elections

HASHGRAPH CONSENSUS: DETAILED EXAMPLES

Aggregating Dependency Graphs into Voting Agendas in Multi-Issue Elections

Combating Friend Spam Using Social Rejections

Chapter 11. Weighted Voting Systems. For All Practical Purposes: Effective Teaching

How to identify experts in the community?

Probabilistic earthquake early warning in complex earth models using prior sampling

Polydisciplinary Faculty of Larache Abdelmalek Essaadi University, MOROCCO 3 Department of Mathematics and Informatics

Genetic Algorithms with Elitism-Based Immigrants for Changing Optimization Problems

Hoboken Public Schools. College Algebra Curriculum

An Empirical Study of the Manipulability of Single Transferable Voting

Chapter 8: Recursion

Randomized Pursuit-Evasion in Graphs

Manipulating Two Stage Voting Rules

arxiv: v5 [cs.gt] 21 Jun 2014

Evaluation of election outcomes under uncertainty

Wind power integration and consumer behavior: a complementarity approach

Title: Adverserial Search AIMA: Chapter 5 (Sections 5.1, 5.2 and 5.3)

Hat problem on a graph

Complexity of Manipulating Elections with Few Candidates

PASW & Hand Calculations for ANOVA

Computational Social Choice: Spring 2007

File Systems: Fundamentals

Instructors: Tengyu Ma and Chris Re

Designing police patrol districts on street network

Estimating the Margin of Victory for Instant-Runoff Voting

Rural Sprawl in Metropolitan Portland

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

NP-Hard Manipulations of Voting Schemes

Universality of election statistics and a way to use it to detect election fraud.

Relative Performance Evaluation and the Turnover of Provincial Leaders in China

A comparative analysis of subreddit recommenders for Reddit

Planning versus Free Choice in Scientific Research

Coalitional Game Theory for Communication Networks: A Tutorial

Bribery in voting with CP-nets

Priority Queues & Heaps

The Integer Arithmetic of Legislative Dynamics

Economics 470 Some Notes on Simple Alternatives to Majority Rule

DYNAMIC RISK MANAGEMENT IN ELECTRICITY PORTFOLIO OPTIMIZATION VIA POLYHEDRAL RISK FUNCTIONALS

Party Cue Inference Experiment. January 10, Research Question and Objective

Transcription:

Constraint satisfaction problems Lirong Xia Spring, 2017

Project 1 Ø You can use Windows Ø Read the instruction carefully, make sure you understand the goal search for YOUR CODE HERE Ø Ask and answer questions on Piazza we may give bonus score to insightful answers Please be careful about spoilers Ø State (in the search graph) vs. node (in the search tree) add node in the search tree to fringe add state to the visited sets 2

Today s schedule ØConstraint satisfaction problems ØAlgorithms backtracking search filtering forward checking constraint propagation 3

Constraint Satisfaction Problems Ø Standard search problems: State is a black box : arbitrary data structure Goal test: any function over states Successor function can be anything Ø Constraint satisfaction problems (CSPs): A special subset of search problems State is defined by variables X i with values from a domain D (sometimes D depends on i ) Goal test is a set of constraints specifying allowable combinations of values for subsets of variables Ø Allows useful general-purpose algorithms with more power than standard search algorithms 4

Ø Variables: WA, NT, Q, NSW, V, SA, T Ø Domains: Example: Map-Coloring D = { red, green, blue} Ø Constraints: adjacent regions must have different colors WA NT { } ( WA, NT ) ( red, green ), ( red, blue ), ( green, red ),... Ø Solutions are assignments satisfying all constraints, e.g.: WA = red, NT = green, Q = red, NSW = green, V = red, SA = blue, T = green 5

Example: N-Queens ØFormulation 1: Variables: Domains: X ij { 0,1} Constraints i, j,k ( X ij, X ) ik {( 0, 0), ( 0, 1), ( 1, 0) } i, j,k ( X ij, X ) kj {( 0, 0), ( 0, 1), ( 1, 0) } i, j,k ( X ij, X ) i+k, j+k ( 0, 0), ( 0, 1), 1, 0 i, j,k X ij, X i+k, j k ( ), ( 0, 1), 1, 0 i, j X ij = { ( )} ( ) { 0, 0 ( )} N 6

Example: N-Queens ØFormulation 2: Variables: Domains: Constraints Q k { 1, 2,3,...N } Q 1 Q 2 Q 3 Q 4 Implicit: -or- Explicit: ( ) i, j non-threatening Q, Q { } ( Q 1,Q ) 2 ( 1, 3), ( 1, 4),... i j 7

Constraint Graphs: Goal test Ø Binary CSP: each constraint relates (at most) two variables Ø Binary constraint graph: nodes are variables, arcs show constraints Ø General-purpose CSP algorithms use the graph structure to speed up search. E.g., Tasmania is an independent subproblem! 8

Example: Cryptarithmetic Ø Variables (circles): FTUWROX1 X2 X3 Ø Domains: T W O + T W O F O U R { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Ø Constraints (boxes): alldiff ( F, T, U, W, R, O) O +O = R +10 X 1 9

Example: Sudoku Ø Variables: Each (open) square Ø Domains: { 1, 2,, 9} Ø Constraints: 9-way alldiff for each column 9-way alldiff for each row 9-way alldiff for each region 10

ØDiscrete Variables: Finite domains Varieties of CSPs Size d means O(d n ) complete assignments E.g., Boolean CSPs, including Boolean satisfiability (NPcomplete) Infinite domains (integers, strings, etc.) Linear constraints solvable ØContinuous variables: Linear constraints solvable in polynomial time by LP methods 11

Varieties of Constraints Ø Variables of Constraints Unary constraints involve a single variable (equiv. to shrinking domains): SA Binary constraints involve pairs of variables: SA WA green Higher-order constraints involve 3 or more variables: e.g., cryptarithmetic column constraints Ø Preferences (soft constraints): E.g., red is better than green Often representable by a cost for each variable assignment Gives constrained optimization problems 12

Standard Search Formulation ØStandard search formulation of CSPs (incremental) ØLet s start with the straightforward, dumb approach, then fix it ØStates are defined by the values assigned so far Initial state; the empty assignment, Successor function: assign a value to an unassigned variable Goal test: the current assignment is complete and satisfies all constraint 13

Search Methods Ø What would BFS do? Ø What would DFS do? Ø Is BFS better or DFS better? Ø Can we use A*? 14

Early detection of non-goal 15

Backtracking Search Ø Idea 1: only consider a single variable at each point Variable assignments are commutative, so fix ordering I.e., [WA = red then NT = green] same as [NT = green then WA = red] Only need to consider assignments to a single variable at each step Ø Idea 2: only allow legal assignments at each point Incremental goal test Ø DFS for CSPs with these two improvements is called backtracking search Ø Backtracking search is the basic uninformed algorithm for CSPs Ø Can solve n-queens for n 25 16

Backtracking Example 17

Improving Backtracking ØOrdering: Which variable should be assigned next? In what order should its values be tried? ØFiltering: Can we detect inevitable failure early? 18

Minimum Remaining Values ØMinimum remaining values (MRV): Choose the variable with the fewest legal values ØWhy min rather than max? ØAlso called most constrained variable Ø Fail-fast ordering 19

Example For every variable, keep track of which values are still possible Q X X X Q X X Q Q X X X Q X X Q Q X X X Q X X Q X X Q Q X X X Q X X Q X X X X Q Q X X Q Q X X X Q X X Q only one possibility for last column; might as well fill in now only one left for other two columns done! (no real branching needed!)

Choosing a value Ø Given a choice of variable: Choose the least constraining value The one that rules out the fewest values in the remaining variables May take some computation to determine this! Ø Why least rather than most? value 1 for SA value 0 for SA 21

Filtering: Forward Checking Ø Idea: keep track of remaining values for unassigned variables (using immediate constraints) Ø Idea: terminate when any variable has no legal values 22

Filtering: Constraint Propagating Ø Forward checking propagates information from assigned to unassigned variables, but doesn t provide early detection for all failures: step 1 step 2 step 1 step 2 Ø NT and SA cannot both be blue! Ø Why didn t we detect this yet? 23

Consistency of An Arc X Y Ø An arc is consistent iff for every x in the tail there is some y in the head which could be assigned without violating a constraint Delete from tail! Ø Forward checking = Enforcing consistency of each arc pointing to the new assignment 24

Arc Consistency of a CSP Ø A simple form of propagation makes sure all arcs are consistent: Delete from tail! X X X Ø If V loses a value, neighbors of V need to be rechecked! Ø Arc consistency detects failure earlier than forward checking Ø Can be run as a preprocessor or after each assignment Ø Might be time-consuming 25