Loading in 5 sec....

2D Rectangular Packing with LFF and LFF/TPowerPoint Presentation

2D Rectangular Packing with LFF and LFF/T

- 99 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about ' 2D Rectangular Packing with LFF and LFF/T' - hansel

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

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(r1, r2, r3,…, rn) 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

- Flexibility of objects to be packed cannot be calculated, but follow this order in general:
larger objects < smaller objects

- Flexibility of empty space follows this order:

LFF Algorithm

- What is a corner?
- It is a point which is bounded in two directions

Corner bounded

on bottom

and left

Corner bounded

on bottom

and right

Corner bounded

on top and left

Corner bounded

on top and right

- As the packed object are all rectangles, all corners are 90º

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

- A “Multi-dimensional Binary Tree”

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 Kj(p) and Kj(q)
- For example, when j=0, if K0(p)>K0(q), q is LOSON;
if K0(p)<K0(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

e (1, 10, 3, 13)

a (6, 1, 7, 3)

b (2, 6, 4, 9)

c (9, 7, 12, 8)

c (9, 7, 12, 8)

b (2, 6, 4, 9)

e (1, 10, 3, 13)

d (1, 4, 3, 7)

d (1, 4, 3, 7)

a (6, 1, 7, 3)

Fig. 1b) Placement of these 16 labelled rectangles in a 4-d binary tree

Fig. 1a) 16 labelled rectangles on a grid 0 x 13 in size

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-INTERSECT-REGION

- 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

- 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)

- 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>
- Sort all these quinary-tuples in lexicographical order
- For each candidate COPM, do a) to c) to find its fitness function value (FFV).
- Pseudo-pack this COPM
- Pseudo-pack all the remaining rectangles based on the current COPM list and with a greedy approach, until no more COPM can be packed
- 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

- Pick the candidate COPM with the highest FFB and really pack the corresponding rectangle according to the COPM
- Mark the rectangle as packed
- 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 <longer side, shorter side, orientation, x1, y1>
- 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 pts B has a larger tightness value (4) than A(3)

- A parameter q
- Greedy Search done for the COPMs of the q longest rectangles only

- Tightness

A

B

LFF/T – An Improvement of LFF

The LFF/T algorithm:

Starting with an empty work space (bounding rectangle)

- 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)
- Sort all these quinary-tuples in lexicographical order
- For each candidate COPM, do a) to c) to find its fitness function value (FFV).
- Pseudo-pack this COPM
- 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

- Pick the candidate COPM with the highest FFB and really pack the corresponding rectangle according to the COPM
- Mark the rectangle as packed
- Return to step 1 until no more packing can be done

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

Download Presentation

Connecting to Server..