2D Rectangular Packing with LFF and LFF/T Presented by Y. T. Wu.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Computational Geometry
Traveling Salesperson Problem
An Introduction to Channel Routing
Searching on Multi-Dimensional Data
Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.
Algorithms and Data Structures Lecture 4. Agenda: Trees – fundamental notions, variations Binary search tree.
CS16: Introduction to Data Structures & Algorithms
Search in AI.
B+-Trees (PART 1) What is a B+ tree? Why B+ trees? Searching a B+ tree
Quad Trees By JJ Shepherd. Introduction So far we’ve only used binary trees to solve problems – Sort data – Search data – Confuse students Trees are not.
2D/3D Packing based on LFF (Less Flexibility First) principle.
2-dimensional indexing structure
Content Based Image Clustering and Image Retrieval Using Multiple Instance Learning Using Multiple Instance Learning Xin Chen Advisor: Chengcui Zhang Department.
Multiple-key indexes Index on one attribute provides pointer to an index on the other. If V is a value of the first attribute, then the index we reach.
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
Algorithm Design Techniques: Induction Chapter 5 (Except Section 5.6)
On Legalization of Row-Based Placements Andrew B. KahngSherief Reda CSE & ECE Departments University of CA, San Diego La Jolla, CA 92093
Shortest path algorithm. Introduction 4 The graphs we have seen so far have edges that are unweighted. 4 Many graph situations involve weighted edges.
Binary Search Trees1 ADT for Map: Map stores elements (entries) so that they can be located quickly using keys. Each element (entry) is a key-value pair.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part B Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
Processing Rate Optimization by Sequential System Floorplanning Jia Wang 1, Ping-Chih Wu 2, and Hai Zhou 1 1 Electrical Engineering & Computer Science.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
Routing 2 Outline –Maze Routing –Line Probe Routing –Channel Routing Goal –Understand maze routing –Understand line probe routing.
Multimedia Databases Chapter 4.
1 Shortest Path Calculations in Graphs Prof. S. M. Lee Department of Computer Science.
Mixed Non-Rectangular Block Packing for Non-Manhattan Layout Architectures M. Wu, H. Chen and J. Jou Department of EE, NCTU HsinChu, Taiwan ISQED 2011.
 Optimal Packing of High- Precision Rectangles By Eric Huang & Richard E. Korf 25 th AAAI Conference, 2011 Florida Institute of Technology CSE 5694 Robotics.
1 HEAPS & PRIORITY QUEUES Array and Tree implementations.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
B+ Tree What is a B+ Tree Searching Insertion Deletion.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Bus-Driven Floorplanning Hua Xiang*, Xiaoping Tang +, Martin D. F. Wong* * Univ. Of Illinois at Urbana-Champaign + Cadence Design Systems Inc.
Content Addressable Network CAN. The CAN is essentially a distributed Internet-scale hash table that maps file names to their location in the network.
Chapter 11 Heap. Overview ● The heap is a special type of binary tree. ● It may be used either as a priority queue or as a tool for sorting.
ANALYSIS AND IMPLEMENTATION OF GRAPH COLORING ALGORITHMS FOR REGISTER ALLOCATION By, Sumeeth K. C Vasanth K.
Graphs. Made up of vertices and arcs Digraph (directed graph) –All arcs have arrows that give direction –You can only traverse the graph in the direction.
Antonin Guttman In Proceedings of the 1984 ACM SIGMOD international conference on Management of data (SIGMOD '84). ACM, New York, NY, USA.
For Monday Read chapter 4, section 1 No homework..
Rectlinear Block Packing Using the O-tree Representation Yingxin Pang Koen Lampaert Mindspeed Technologies Chung-Kuan Cheng University of California, San.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
HEAPS. Review: what are the requirements of the abstract data type: priority queue? Quick removal of item with highest priority (highest or lowest key.
Local Search. Systematic versus local search u Systematic search  Breadth-first, depth-first, IDDFS, A*, IDA*, etc  Keep one or more paths in memory.
Copyright © 2012 Pearson Education, Inc. Chapter 20: Binary Trees.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 20: Binary Trees.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
How to identify complex events in the real world First part : Vision –Image segmentation –Checking for basic events : touching, intersecting, moving, pointing,
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 20: Binary Trees.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Sorting Cont. Quick Sort As the name implies quicksort is the fastest known sorting algorithm in practice. Quick-sort is a randomized sorting algorithm.
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 7: Labeling.
1 R-Trees Guttman. 2 Introduction Range queries in multiple dimensions: Computer Aided Design (CAD) Geo-data applications Support special data objects.
Traveling Salesperson Problem
Computational Geometry
Last time: Problem-Solving
Priority Queues and Heaps
Chapter 20: Binary Trees.
Chapter 21: Binary Trees.
Sheqin Dong, Song Chen, Xianlong Hong EDA Lab., Tsinghua Univ. Beijing
Spatial Indexing I R-trees
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
Continuous Density Queries for Moving Objects
Heaps By JJ Shepherd.
Donghui Zhang, Tian Xia Northeastern University
Presentation transcript:

2D Rectangular Packing with LFF and LFF/T Presented by Y. T. Wu

Overview  Introduction  The Problem  LFF Algorithm  LFF/T Algorithm – An Improvement  Experimental Results  Conclusion  Future Direction

Introduction  2D rectangular packing is to pack a set of rectangles into a bounding rectangle  There are many practical applications:  VLSI floor-planning  VLSI placement  Job-scheduling

Introduction  It is a NP-complete problem  Heuristics are proposed for solving these kind of problems  Existing algorithms:  Simulated Annealing  Genetic algorithms

The Problem  To determine whether a set of rectangles(r 1, r 2, r 3,…, r n ) with given length l and width w can be packed into a bounded rectangular container R  Goal:  Minimize total area for packing these rectangles  Maximize packing density

LFF Algorithm  What is LFF?  A quasi-human (cognitive) based heuristic  A deterministic algorithm inspired by Chinese ancient professionals for polygon- shape stone plates  Based on the concept of flexibility

LFF Algorithm  Two types of flexibility:  Flexibility of empty space follows this order: a corner < a side < a central void area a corner < a side < a central void area  Flexibility of objects to be packed cannot be calculated, but follow this order in general: larger objects < smaller objects larger objects < smaller objects

LFF Algorithm  What is a corner?  It is a point which is bounded in two directions Corner bounded on top and left Corner bounded on bottom and left Corner bounded on top and right  As the packed object are all rectangles, all corners are 90º Corner bounded on bottom and right

LFF Algorithm  Basic rules of LFF:  Objects must be packed to at least one corner  There must not be any overlapping of objects  Due to flexibilities, larger objects should be packed to corners first  If more than one available corner (i.e. a corner to which the packing does not overlap with other objects), use fitness cost function to choose the best one  Fitness cost function = total area of rectangle packed

LFF Algorithm  As mentioned in previous slide, overlapping of objects is not allowed  “Region query” is the process for detecting whether the region for insertion of new object is already occupied  In LFF, region query is operated by K-D tree, with K = 4

LFF Algorithm  What is K-D tree?  A “Multi-dimensional Binary Tree” struct kdtree{ kdkey_t kd_keys[4]; kdkey_t kd_lo_min_bound, kd_hi_max_bound,kd_other_bound; struct kdtree *kd_father; struct kdtree * kd_sons[2]; };  The packing is considered to be performed on a coordinate- plane on which all keys are representing points on that coordinate-plane

LFF Algorithm  The 4 kd_keys are:  K 0 (p) = x 1  K 1 (p) = y 1  K 2 (p) = x 2  K 3 (p) = y 2 (x 1, y 1 ) (x 2, y 2 )

LFF Algorithm  The two sons are LOSON and HISON  To determine whether a child q is LOSON or HISON of its parent p, compare their corresponding kdkey  Discriminator j is introduced to control the use kdkey for comparison. Compare K j (p) and K j (q)  For example, when j=0, if K 0 (p)>K 0 (q), q is LOSON; if K 0 (p)<K 0 (q), q is HISON  j increments as it goes down the tree, and reset to 0 when it reaches maximum, then repeat to increment again

LFF Algorithm  An example Fig. 1a) 16 labelled rectangles on a grid 0 x 13 in size Fig. 1b) Placement of these 16 labelled rectangles in a 4-d binary tree a (6, 1, 7, 3) b (2, 6, 4, 9) c (9, 7, 12, 8) d (1, 4, 3, 7) e (1, 10, 3, 13)

LFF Algorithm  Procedures for manipulating K-D Tree in LFF 2D rectangular packing:  KD-INSERT  KD-REGION-SEARCH  KD-SUCCESSOR  KD-INTERSECT-REGION

LFF Algorithm  KD-INSERT  It takes in a kd-node as parameter  Insert this node into the existing KD-TREE by calling the KD-SUCCESSOR to find out where should the node be inserted  KD-SUCCESSOR  It compares the jth kdkey of q and p to determine whether LOSON or HISON should be the next node

LFF Algorithm  KD-REGION-SEARCH  For each kd_node in the KD-TREE, call KD-INTERSECT- REGION to check whether that kd-node intersects with o if o is packed at the corner being evaluated, report overlapping, if any and quit checking  KD-INTERSECT-REGION  Test, based on a set of conditions, whether p intersects or touches with o if o is packed at the corner being examined  If yes, check whether they are touching  If yes, add p to the touches list to indicate that p touches with o  If no, return TRUE to indicate intersection

LFF Algorithm  The relationship between the KD-TREE operations and LFF  Before packing any objects, call KD-REGION- SEARCH to detect overlapping  If no overlapping is reported, call KD-INSERT to update the KD-TREE, indicating that the object is packed at the specific position and occupy there

LFF Algorithm  The algorithm: Starting with an empty work space (bounding rectangle) 1.Based on the current packing configuration, find all possible COPMs for each unpacked rectangle, represent each COPM b a quinary-tuple 1.Based on the current packing configuration, find all possible COPMs for each unpacked rectangle, represent each COPM b a quinary-tuple 2.Sort all these quinary-tuples in lexicographical order 3.For each candidate COPM, do a) to c) to find its fitness function value (FFV). a)Pseudo-pack this COPM b)Pseudo-pack all the remaining rectangles based on the current COPM list and with a greedy approach, until no more COPM can be packed c)Calculate FFV of this candidate COPM as the occupied area. Note: Before the pseudo-packing for the next candidate COPM is tried, one needs to remove the previous pseudo-packed COPM 4.Pick the candidate COPM with the highest FFB and really pack the corresponding rectangle according to the COPM 5.Mark the rectangle as packed 6.Return to step 1 until no more packing can be done

LFF Algorithm  A sample case:  Suppose rectangles A(2x5), B(4x4) and C(6x4) are to be packed in a work space (8x8) and a rectangle P(6x3) at (0, 8) is already packed in previous iteration  COPM is represented as  COPM is represented as  As P is packed, one of the container’s corner is occupied, the available corners are: (0, 0), (0, 2), (3, 8), (8, 0), (8, 8)

LFF algorithm  The COPM list generated stores all feasible packing (no overlapping and within the bounding rectangle)  (6, 4, 1, 4, 2) – rectangle C vertically packed at (8, 8)  (6, 4, 1, 3, 2) – rectangle C vertically packed at (8, 0)  (6, 4, 1, 4, 0) – rectangle C vertically packed at (3, 8)  (5, 2, 0, 3, 6) – rectangle A horizontally packed at (8, 8) or (3, 8)  (5, 2, 1, 6, 3) – rectangle A vertically packed at (8, 8)  (5, 2, 0, 3, 0) – rectangle A vertically packed at (8, 0)  (5, 2, 1, 6, 0) – rectangle A vertically packed at (8, 0)  (5, 2, 1, 3, 3) – rectangle A vertically packed at (3, 8)  (5, 2, 0, 0, 0) – rectangle A vertically packed at (0, 2) or (0, 0)  For rectangle B, the generation is by checking all orientation against all corners, if feasible in location, it will shorten itself by deleting not feasible solutions

LFF Algorithm  Consider rectangle C is pseudo-packed to (8, 8) vertically, i.e., COPM (6, 4, 1, 4, 2)  The COPM list for next pseudo-packing step is shortened by removing all entries related to rectangle C as well as all entries packing rectangles to corner (8, 8) since it is already occupied  The list becomes:  (5, 2, 0, 3, 0) – rectangle A vertically packed at (8, 0)  (5, 2, 1, 6, 0) – rectangle A vertically packed at (8, 0)  (5, 2, 1, 3, 3) – rectangle A vertically packed at (3, 8)  (5, 2, 0, 0, 0) – rectangle A vertically packed at (0, 2) or (0, 0)  (4, 4, 0, 4, 0) – rectangle B horizontally or vertically packed at (8, 0)  (4, 4, 0, 3, 4) – rectangle B horizontally or vertically packed at (3, 8)  Packing continues until all rectangles are packed or no more available space for packing. Remove all rectangles and pseudo-pack C to another corner.

LFF/T – An Improvement of LFF  Introduce two new concepts:  Tightness For each candidate rectangle placement location, we look at the points that are immediate adjacent to each corner of the candidate rectangle (There are 8 points for measurement) The 8 corner-adjacent ptsB has a larger tightness value (4) than A(3)  A parameter q  Greedy Search done for the COPMs of the q longest rectangles only AB

LFF/T – An Improvement of LFF The LFF/T algorithm: Starting with an empty work space (bounding rectangle) 1.Based on the current packing configuration, find all possible COPMs for each unpacked rectangle, represent each COPM b a quinary-tuple <longer side, shorter side, orientation, x1, y1) 2.Sort all these quinary-tuples in lexicographical order 3.For each candidate COPM, do a) to c) to find its fitness function value (FFV). a)Pseudo-pack this COPM b)While there are rectangles remaining and there are spaces in the box, If there is a location that the next rectangle in the sorted list can fit, then,  For each legal corner moves of the rectangle, calculate the tightness values as described above  Choose the corner move with the highest tightness values and pseudo-pack this rectangle there  Update the corner lists and move to the next rectangle in the list Else Skip this rectangle Calculate FFV of this candidate COPM as the occupied area. Note: Before the pseudo-packing for the next candidate COPM is tried, one needs to remove the previous pseudo-packed COPM 4.Pick the candidate COPM with the highest FFB and really pack the corresponding rectangle according to the COPM 5.Mark the rectangle as packed 6.Return to step 1 until no more packing can be done

Experimental Results Problem No. of Rects Box Size Original LFF LFF/T (q=n) PackingDensity Packing Density ami * %95.84% ami * %97.12% playout629397* %99.26%

Conclusion  LFF/T can really improve the packing density of LFF  Reasons:  In LFF, there may be several corners result in the same FFV (fitness value). The algorithm will just arbitrary take one  Tightness value ensures that less gaps or spaces exist between any pair of rectangles, which in turn gives smaller dead space  LFF/T takes longer processing time  Both algorithms have their own advantages

Future Direction  Extension of LFF or LFF/T to 3D applications  Experiments will be carried out to see which one is more suitable