Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Patrick Prosser. An Example, Exam Timetabling Someone timetables the exams We have a number of courses to examine how many? Dept.
Advertisements

Approximation algorithms for geometric intersection graphs.
Heuristic Search techniques
Impact of Interference on Multi-hop Wireless Network Performance Kamal Jain, Jitu Padhye, Venkat Padmanabhan and Lili Qiu Microsoft Research Redmond.
ECE 667 Synthesis and Verification of Digital Circuits
Linear Programming (LP) (Chap.29)
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Traveling Salesperson Problem
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
PROBLEM SOLVING AND SEARCH
an incremental version of A*
Constraint Satisfaction problems (CSP)
Transportation Problem (TP) and Assignment Problem (AP)
IJCAI Russian Doll Search with Tree Decomposition Martí Sànchez, David Allouche, Simon de Givry, and Thomas Schiex INRA Toulouse, FRANCE.
Constraint Optimization Presentation by Nathan Stender Chapter 13 of Constraint Processing by Rina Dechter 3/25/20131Constraint Optimization.
Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
Tirgul 12 Algorithm for Single-Source-Shortest-Paths (s-s-s-p) Problem Application of s-s-s-p for Solving a System of Difference Constraints.
Maths of Constraint Satisfaction, Oxford, March 2006 Constraint Programming Models for Graceful Graphs Barbara Smith.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
Constraint Satisfaction Problems
Approximation Algorithms
Penn ESE Fall DeHon 1 ESE (ESE534): Computer Organization Day 19: March 26, 2007 Retime 1: Transformations.
Jean-Charles REGIN Michel RUEHER ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining.
Randomized Planning for Short Inspection Paths Tim Danner Lydia E. Kavraki Department of Computer Science Rice University.
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
Branch and Bound Algorithm for Solving Integer Linear Programming
Chapter 5 Outline Formal definition of CSP CSP Examples
Jin Zheng, Central South University1 Branch-and-bound.
Iterative Flattening in Cumulative Scheduling. Cumulative Scheduling Problem Set of Jobs Each job consists of a sequence of activities Each activity has.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 13, 2008 Retiming.
Domain decomposition in parallel computing Ashok Srinivasan Florida State University COT 5410 – Spring 2004.
Escaping local optimas Accept nonimproving neighbors – Tabu search and simulated annealing Iterating with different initial solutions – Multistart local.
 Optimal Packing of High- Precision Rectangles By Eric Huang & Richard E. Korf 25 th AAAI Conference, 2011 Florida Institute of Technology CSE 5694 Robotics.
Relaxation and Hybrid constraint processing Different relaxation techniques Some popular hybrid techniques.
Systems of Linear Equations and Inequalities (Chapter 3)
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
Vertical and horizontal shifts If f is the function y = f(x) = x 2, then we can plot points and draw its graph as: If we add 1 (outside change) to f(x),
Stocs – A Stochastic CSP Solver Bella Dubrov IBM Haifa Research Lab © Copyright IBM.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Column Generation By Soumitra Pal Under the guidance of Prof. A. G. Ranade.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Branch-and-Cut Valid inequality: an inequality satisfied by all feasible solutions Cut: a valid inequality that is not part of the current formulation.
Implicit Hitting Set Problems Richard M. Karp Erick Moreno Centeno DIMACS 20 th Anniversary.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Chapter 13 Backtracking Introduction The 3-coloring problem
Search: Advanced Topics Computer Science cpsc322, Lecture 9
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Consistency Methods for Temporal Reasoning
Finding a Path With Largest Smallest Edge
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems (CSPs)
Search: Advanced Topics Computer Science cpsc322, Lecture 9
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Sequence Pair Representation
Richard Anderson Lecture 28 Coping with NP-Completeness
Running example The 4-houses puzzle:
Constraints and Search
Exact Inference Continued
Constraint satisfaction problems
Chapter 6 Network Flow Models.
Backtracking and Branch-and-Bound
EE5900 Advanced Embedded System For Smart Infrastructure
Constraint Satisfaction
Constraint satisfaction problems
Discrete Optimization
Presentation transcript:

Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI

Overview Overview of the problem Techniques – Traditional Forward Checking Removal of Subsumed Variables Semantic Branching – Domain Specific Dynamic Symmetry Breaking Detecting Cliques of Displacement Variable and value ordering Experimental Results Solving the optimization problem 2

The Task The task is to “pack rectangles” Two computational problems 1.Optimization: Minimal Bounding Box Problem 2.Satisfaction: Containment Problem 3x4 4x4 x y 0,0 3

Minimal Bounding Box Given: A set of N rectangles of dimensions w i h i Find: The values of x i and y i which are the position of rectangle i such that – No two rectangles overlap & – Area of bounding box is minimal 4x4 2x2 4x2 Bounding box Slack wiwi hihi 4

Containment Problem Given: – An enclosing space of dimensions WH – A set of N rectangles of dimensions w i h i Find: The values of x i and y i which are the position of rectangle i such that – No two rectangles overlap & – All rectangles are inside the enclosing space In reality, we do not need to find the values of x i and y i but the relative positions of rectangles  ‘floating configuration’ 4x4 Consistent solution Inconsistent solution 5

Containment Problem: CSP Model Variables – For each rectangle, two variables x i, y i 1≤i≤N Constraints – Containment constraints (unary) 0 ≤ x i, 0 ≤ y i x i + w i ≤ W y i + h i ≤ H – Overlap constraints (binary) (L) i is to the left of j : x i + w i ≤ x j (R) i is to the right of j : x j + w j ≤ x i (A) i is above j : y i + h i ≤ y j (B) i is below j : y j + h j ≤ y i 4 W=8 H=8 w i =4 x i =5 h i =4 y i =1 0 ≤ 7, 0 ≤ ≤ ≤ ,0 Containment constraints Horizontal disjuncts Vertical disjuncts 6

Constraint Network 4x3 3x x1x1 x2x2 x3x3 y1y1 y2y2 y3y3 Containment constraints (unary constraints) – 0 ≤ x i, 0 ≤ y i – x i + w i ≤ W – y i + h i ≤ H Non-overlap constraints (binary constraints) – (L) i is to the left of j : x i + w i ≤ x j – (R) i is to the right of j : x j + w j ≤ x i – (A) i is above j : y i + h i ≤ y j – (B) i is below j : y j + h j ≤ y i 0≤y30≤y3 y3+h3≤Hy3+h3≤H x 1 + w 1 ≤ x 2  x 2 + w 2 ≤ x 1  y 1 + h 1 ≤ y 2  y 2 + h 2 ≤ y 1 7

The Meta CSP Model —Variables: all non-overlap constraints —Domains: 4 linear inequalities (Left, Right, Above, Below) —One global constraint requiring one linear inequality from each meta variable Solved by search, finding one solution: ‘floating configuration’ —Floyd-Warshall determines the consistency (and minimality) of system of linear inequalities 4 4x C 1,3 L: x 1 + w 1 ≤ x 2 R: x 2 + w 2 ≤ x 1 A: y 1 + h 1 ≤ y 2 B: y 2 + h 2 ≤ y 1 {L, R, A, B} C 1,3 C 1,2 {L, R, A, B} System of inequalities is consistent L R A B L LRA Root C 1,2 C 2,3 8

The Distance Graph Similar to Simple Temporal Problem The positional variables from the original CSP are the nodes in this graph Solved with F-W C 1,2  R: 1 to the right of 2 x ≤ x 2 x1x1 x2x2 x3x3 y1y1 y2y2 y3y3 WH L: x 1 + w 1 ≤ x 2 R: x 2 + w 2 ≤ x 1 A: y 1 + h 1 ≤ y 2 B: y 2 + h 2 ≤ y 1 {L, R, A, B} C 1,3 C 1,2 {L, R, A, B} C 2,3 4x4 4x33x

Forward Checking Used to eliminate values from variables before they are even expanded 4x4 4x33x L: x 1 + w 1 ≤ x 2 R: x 2 + w 2 ≤ x 1 A: y 1 + h 1 ≤ y 2 B: y 2 + h 2 ≤ y 1 {L, R, A, B} C 1,3 C 1,2 {L, R, A, B} C 2,3 10

Removal of Subsumed Variables Make implicit assignments explicit 4x4 4x3 3x C 2,4 ← B C 1,2 ← B 4 4x3 1 C 1,4 ← B y1y1 y2y2 y3y3 H y4y y1y1 y2y2 y3y3 y4y4 y1y y2y y3y y4y

Semantic Branching When assigning a disjunct fails in a path, add the negation of the disjunct Allows for tighter path lengths Try: C 1,2  L 4 4x When C 1,2  A, we can keep the negation of C 1,2  L = x ≤ x 1 ¬(C 1,2  L) = x > x 1 = x ≤ x 1 x1x1 x2x2 x3x3 y1y1 y2y2 y3y3 WH x1x1 x2x2 x3x3 y1y1 y2y2 y3y3 WH

Dynamic Symmetry Breaking Every constraint has – 2 vertical disjuncts & – 2 horizontal disjuncts Because of symmetry, we only need to consider – 1 vertical disjunct & – 1 horizontal disjunct When a given disjunct fails, the other can be safely pruned If C 1,2  L fails… 4 4x3 4 C 1,2  R will also fail A B C D A B C D 13

Tracking Cliques of Displacement (1) Scenario – A set of rectangles is such that the sum of their widths/heights exceeds the width/height of enclosing space – Every horizontal/vertical arrangement of those rectangles will fail Situation detected with Displacement Graph – One graph for vertical displacement – One graph for horizontal displacement 4x4 4x

Tracking Cliques of Displacement (2) Displacement graph – One vertex for each rectangle – Edges are added when An assignment is done Only horizontal/vertical disjuncts remain If the maximum weighted clique exceeds W/H, no solution exists Operation – Build graph – Add edges before each assignment is made – Checks graph for max weighted clique (NP- Hard!!) – Backracks if weight exceeds W/H… 4x4 4x

Tracking Cliques of Displacement (3) Example 4x4 4x C 2,4 {L, R, A, B} C 2,3 {L, R, A, B} C 1,4 {L, R, A, B} C 3,4 {L, R, A, B} C 1,3 {L, R, A, B} C 1,

Variable & Value Orderings Variable ordering – Select the largest rectangles first – Dynamic variable ordering because of singleton assignment (domino effect) Value ordering – Choose the disjunction with the minimal increase in area – Break ties by choosing the disjunction with the least amount of slack 17

Solving the Optimization Problem Rejected idea: decrease W/H iteratively & look for ‘smaller’ arrangements Mechanism uses Branch & Bound – Assume w l / h l are lower current bound on W/H (obtained from the displacement graph) Area of bounding box of current (best) solution is A – Update W   A/ h l  H   A/ w l  4x4 4x x4 4x A B L R A ABL Root A B L R h l = 11 Wl=4Wl=4 A = 44 Wl=5Wl=5 W   44/11  = 4 H   44/5  = 8 h l = 11 18

19

Incremental Minimal Bounding Box Problem Comparable to the previous best solver on the problem that solver was tuned for. Both of the best solvers come from a CSP representation of the problem. The 2 nd best solver is also a CSP solver. It uses a bitmap to draw the boxes to keep track of their positions 20

Larger blocks do not slow down the solver. 21

22

Technique Effectiveness Semantic branching has the largest effect. When semantic branching is enabled, symmetry breaking has the next largest impact When semantic branching is disabled, removal of subsumed variables is more important. Clique detection the least, but at least 15% for the N = 17 test 23

Experimental Results Summary Comparable to the best known solver for the specific problem of finding the minimum-area rectangles with increasing square size More flexible than the best known solver Able to handle larger rectangles without any loss of performance Found that the semantic branching concept has the biggest affect 24

Questions? 25