Constraint Models for the Covering Test Problems Authors: Brahim Hnich, Steven D. Prestwich, Evgeny Selensky, Barbara M. Smith Speaker: Pingyu Zhang CSE.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction Problems
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 99 Chapter 4 The Simplex Method.
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
Stochastic greedy local search Chapter 7 ICS-275 Spring 2007.
Global Constraints for Lexicographic Orderings Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University)
Modelling a Steel Mill Slab Design Problem Alan Frisch, Ian Miguel, Toby Walsh AI Group University of York.
Chapter 4 The Simplex Method
Constraint Satisfaction Problems
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Boolean Satisfiability and SAT Solvers
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
CP Summer School Modelling for Constraint Programming Barbara Smith 4. Combining Viewpoints, Modelling Advice.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Schreiber, Yevgeny. Value-Ordering Heuristics: Search Performance vs. Solution Diversity. In: D. Cohen (Ed.) CP 2010, LNCS 6308, pp Springer-
Stochastic greedy local search Chapter 7 ICS-275 Spring 2009.
Chapter 2) CSP solving-An overview Overview of CSP solving techniques: problem reduction, search and solution synthesis Analyses of the characteristics.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Accelerating Random Walks Wei Wei and Bart Selman.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
NPC.
Custom Computing Machines for the Set Covering Problem Paper Written By: Christian Plessl and Marco Platzner Swiss Federal Institute of Technology, 2002.
10.3 Reformulation The Lex-Leader Method Shant Karakashian 1.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Solving Weakened Cryptanalysis Problems for the Bivium Keystream Generator in the Volunteer Computing Project Oleg Zaikin, Alexander Semenov,
© 2012 IBM Corporation Perfect Hashing and CNF Encodings of Cardinality Constraints Yael Ben-Haim Alexander Ivrii Oded Margalit Arie Matsliah SAT 2012.
The NP class. NP-completeness
More NP-complete problems
Constraint Satisfaction Problems (CSPs)
Richard Anderson Lecture 26 NP-Completeness
Instructor: Vincent Conitzer
Lecture 7 Constraint Satisfaction Problems
Richard Anderson Lecture 25 NP-Completeness
Chapter 34: NP-Completeness
Constraint Satisfaction Problems
Artificial Intelligence
Constraint satisfaction problems
CS 8520: Artificial Intelligence
Instructor: Aaron Roth
Constraint Satisfaction Problems
Constraint satisfaction problems
Presentation transcript:

Constraint Models for the Covering Test Problems Authors: Brahim Hnich, Steven D. Prestwich, Evgeny Selensky, Barbara M. Smith Speaker: Pingyu Zhang CSE 990 Advanced Constraint Processing, Fall

Outline Introduction & background CSP model – Naïve model, Alternative model, Integrated model Symmetry breaking Solving the CSP – Setting up the Ilog Solver, Experiment results SAT Model – Model, Experiment results 2

A combinatorial problem – A machine with 10 switches, each with two positions – 2 10 possible combinations to be tested before shipping! The Combinatorial Testing Problem Real world problems – Software interaction testing – Hardware testing – Testing of advanced materials – Interactions regulating gene expressions 3

Optimization Problem: CA( t, k, g ) Given – A set of k software ‘components’ to be tested – Each component can take g different values (alphabet) – A covering strength t Find – the minimum number of tests, b – Such that every combination of t components appears in some test 4 k=5 b=? t=3 b=2

Given: CA(t, k, g) of size b: b×k array – k: # of parameters – g: size of the alphabet – t: covering strength: for every subset of t parameters, each value combination appear at least once – Example CA(3, 5, 2), 2 5 =32? b=10 does it! Goal: Minimize b – Unfortunately, NP hard Mathematical Object: Covering Array 5

Challenges – How to model the problem into a CSP? – How to setup a solver? The general framework – Step 1: guess a CA size b – Step 2: encode the problem as a CSP and try to solve it – Step 3: if the CSP is solvable, reduce b by some value and repeat Steps 1—3. If CSP is not solvable, enlarge b by some value and repeat Steps 1—3. – The smallest solvable b is the optimum size. How about solving it with CSP 6

Outline Introduction & Background CSP model – Naïve model, Alternative model, Integrated model Symmetry breaking Solving the CSP – Setting up the Ilog Solver, Experiment results SAT Model – Model, Experiment results 7

Rows Each variable represents the value of one parameter in one vector: b×k matrix – Example: k=5 (x i1..5 ), g=2 (0/1), t=3 (every combination of three parameters), b=5 (a total of 5 combinations/rows) How to express constraints? – Every subset of t parameters must be combined in all possible ways A Naïve Matrix Model 8

Each variable represent the value of one parameter in one vector: b×k matrix How to express constraints? – Every subset of t parameters must be combined in all possible ways – Introduce additional boolean variables A Naïve Matrix Model Describes the situation where x 1, x 2, x 3 are assigned 0 at vector 1 9

Each variable represent the value of one parameter in one vector: b×k matrix How to express constraints? – Every subset of t parameters must be combined in all possible ways A Naïve Matrix Model 10

Each variable represent the value of one parameter in one vector: b×k matrix How to express constraints? – Every subset of t parameters must be combined in all possible ways – Question: How many columns are there for this example? A Naïve Matrix Model 11

Each variable represent the value of one parameter in one vector: b×k matrix How to express constraints? – Every subset of t parameters must be combined in all possible ways. – Express coverage constraints over columns (in general, columns) – Clearly, this is not very efficient… A Naïve Matrix Model 12

What did we learn from last model? – Setting up variables is simple and straightforward. – Expressing constraints is cumbersome and introduces numerous assistant variables. Each variable represents a t-tuple in a vector (compound variable), domain is all possible values for the tuple. Alternative Matrix Model Domain of C 1,1 Assignm ents for x 1, x 2, x 3 00, 0, 0 10, 0, 1 20, 1, 0 30, 1, 1 41, 0, 0 51, 0, 1 61, 1, 0 71, 1, 1 13

How to express constraints? – Now, each column represents all assignments for one specific tuple. – In each column, every number in the range 0 to 2 t -1 should appear at least once, and at most… – Question: How many times each number appears at most in a column? – Enforcing such a global constraint on each column. ( constraints in total) Alternative Matrix Model 14

Improvement over the last model? Are we done? Alternative Matrix Model 15

Intersection Constraints – Values assigned to compound variables in the same vector should be consistent. – In every row, if two variables share some positions, we impose a binary constraint stating the allowed pairs of values. Alternative Matrix Model Allowed tuples (0,0), (0,1), (1,0), (1,1), (2,2), (2,3), (3,2), (3,3), (4,4), (4,5), (5,4), (5,5), (6,6), (6,7), (7,6), (7,7) 16

How many Intersection Constraints for each row? – For each compound variable, # of variables sharing ONE position is – # of variables sharing TWO positions – Continues until the case of sharing (t-1) positions For the CA(3, 5, 2) example – # of variables sharing ONE position is 3 – # of variables sharing TWO positions is 6 – 10 variables in each row, (3+6)×10/2 = 45 constraints. Alternative Matrix Model 17

How many Intersection Constraints for each row? – Reduction 1: the red constraint is redundant with the conjunction of the two blue constraints and it can be removed. – In general, constraints between variables that share fewer than t-1 positions in common, can be removed. Alternative Matrix Model 1,2 1,4 1 18

How many Intersection Constraints for each row? – Reduction 2: a clique can be reduced to a path. – The savings are more obvious if k gets bigger. Alternative Matrix Model (1, 2, 3) (1, 2, 7)(1, 2, 4) (1, 2, 6)(1, 2, 5) (1, 2, 3) (1, 2, 7)(1, 2, 4) (1, 2, 6)(1, 2, 5) 19 1,2

How many Intersection Constraints for each row? – Apply reduction 1: 45  30 Alternative Matrix Model 20

How many Intersection Constraints for each row? – Apply reduction 1: 45  30 – Apply reduction 2: 30  20 Alternative Matrix Model 21

Still, the # of intersection constraints is a problem  – Why not apply the intersection constraints on the naïve model? To summarize so far – Naïve model suffers from # of additional variables. – The alternative model suffers from # of intersection constraints. – Can we combine the strengths together? Alternative Matrix Model Implicit connections 22

Channeling constraint – explicitly express connections between compound variable and its corresponding t variables in the naïve model. – There are totally channeling constraints, each with arity t+1. – Enforcing GAC on them leads to assignment of x or domain reduce of c – Eliminate all intersection constraints. Combining them together: an Integrated Model Extensionally(0,0,0,0), (1,0,0,1),(2,0,1,0),(3,0,1,1),(4,1,0,0), (5,1,0,1),(6,1,1,0),(7,1,1,1) Intensionally C 1,1 =4x 11 +2x 12 +x 13 23

Outline Introduction & Background CSP model – Naïve model, Alternative model, Integrated model Symmetry breaking Solving the CSP – Setting up the Ilog Solver, Experiment results SAT Model – Model, Experiment results 24

CA has both row and column symmetries: any two cols/rows Another less obvious symmetry: value symmetry Size of the symmetry group: – So we must deal with them! Symmetry 25

For row and column symmetries – [Flener02] Theorem1: For a matrix model with row and column symmetry in some 2-d matrix, each symmetry class of assignments has an element where both the rows and the columns of that matrix are lexicographically ordered. – Naïve model: Impose lexicographical ordering constraints on both rows and columns of the matrix – Alternative model: rows are the same, columns are not as powerful, but can be help – Integrated model: can apply lexicographical ordering on either original or alternative matrix, but not both. Symmetry Breaking 26

For value symmetries – Very simple: force the first row to be all 0s (no matter which model) – It does not conflict with row/column symmetry-breaking constraints (the first row is lexicographically smallest anyway) – Triggers better propagation. Symmetry Breaking 27

Outline Introduction & Background CSP model – Naïve model, Alternative model, Integrated model Symmetry breaking Solving the CSP – Setting up the Ilog Solver, Experiment results SAT Model – Model, Experiment results 28

Use ILOG Solver 6.0 Use compound variables as search variables – Coverage constraints expressed over compound variables Variable and value ordering – Values assigned in ascending order – Labeling variables by column (coverage constraints are on columns) – Lexicographical ordering within each column Symmetry-breaking constraints (as shown before) Channeling constraints – Extensional: GAC – Intensional: bounds consistency – Same for domain of binary alphabet: each value is a bound. However, solver may run faster on bounds consistency Setting up the solver 29

Results for CA(3, k, 2) – For alternative model, both with all/minimal intersection constraints – For integrated model, channeling constraints expressed both extensionally (GAC) and intensionally (bounds consistency). – * indicates finding optimal size of b. Experiment results 30

Results for CA(3, k, 2) – For integrated model, enforcing intensional constraints is cheaper than enforcing extensional constraints. Experiment results 31

Results for CA(3, k, 2) – Integrated model is better than alternative model – For k=12, integrated model has 220 channeling constraints, while alternative model has 594 non-redundant intersection constraints. Experiment results 32

Results for CA(4, k, 2) – Runtime limit is 1 hour (CA(4, 7, 2) for b=24 can’t finish in 1 hour). Experiment results 33

Outline Introduction & Background CSP model – Naïve model, Alternative model, Integrated model Symmetry breaking Solving the CSP – Setting up the Ilog Solver, Experiment results SAT Model – Model, Experiment results 34

Encoding the problem into CNF SAT (Example CA(2, 3, 2)) – Still have two matrices: original and alternative – Create a Boolean variable for EACH value of EACH variable. Local search model with SAT (1,2), (2,3), (1,3) 35

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (1,2), (2,3), (1,3) 36

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (3) (4) (1,2), (2,3), (1,3) 37

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (3) (4) (5) (1,2), (2,3), (1,3) 38

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (3) (4) (5) (6) (1,2), (2,3), (1,3) 39

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (3) (4) (5) (6) (1,2), (2,3), (1,3) 40

Encoding the problem into CNF SAT Local search model with SAT (1) (2) (3) (4) (5) (6) (1,2), (2,3), (1,3) 41

SAT local search algorithm – First, randomly assign all boolean variables. – Select a violated clause, flip the value of one variable in it (satisfy the clause, but may cause others to violate). – Repeat until timeout or satisfied. Variable selection heuristic – With probability p, randomly select a variable. (noise, set to.2,.3,.4) – With 1-p, pick variable with min score – Break ties by selecting the variable that was least recently flipped. – Freebie move: if there are multiple variables such that flipping them would not create new unsat clauses (score=0), break ties randomly. Setting up the solver # of unsatisfied clauses results from flipping v total # of flips in the past on all variables other than v Score = Smallest negative effect Prefer variables that have fewest flips 42

Results for local search model: CA(2, k, g) *bold denotes best results. HW: HWFSAT (2006) HR: Hartmann & Raskin 2004 CK: Chateaunef & Kreher 2002 MS: Meagher & Stevens 2005 NU: Nurmela

CA(3, k, g) CA(4, k, g) Results for local search model Better than the other 2 In fact, they are optimal, but do we know they are optimal? 44

Modeling CA problem into CSP – Naïve model – Alternative model – Integrated model Local search with SAT – Handles larger problems – Trade scalability with completeness – Combining results with CSP results may be valuable Summary 45

Page 203, first formula: Page 203, fifth line from bottom: variables Page 212, 20 th line from top: Small Typos in Paper 46

References – Hnich et al. ‘06: Constraints models for the covering test problems – Flener et al. ‘02: Breaking row and column symmetry in matrix models – Frisch et al. ‘02: Global constraints for lexicographical orderings – Gent et al. ‘95: Unsatisfied variables in local search – Hartman et al. ‘04:Problems and algorithms for covering arrays – Chateauneuf et al. ‘02: On the state of strength-three covering arrays – Meagher et al. ‘05: Group construction of covering arrays – Nurmela et al. ‘04: Upper bounds for covering arrays by Tabu search The switches and light bulbs shown on first slide is a real game – bulb-game-resurrects-1960s-idea.html bulb-game-resurrects-1960s-idea.html Literature 47

Discussion 48