Elsevier

Computers & Operations Research

Volume 86, October 2017, Pages 110-123
Computers & Operations Research

An iterative merging algorithm for soft rectangle packing and its extension for application of fixed-outline floorplanning of soft modules

https://doi.org/10.1016/j.cor.2017.05.009Get rights and content

Highlights

  • An iterative merging packing (IMP) algorithm for soft rectangle packing problem.

  • Prove IMP guarantees feasible layout under some conditions.

  • A strategy systematically assigns deadspace on the outline to rectangles.

  • A verified efficient algorithm for fixed-outline floorplanning with soft modules.

Abstract

We address an important variant of the rectangle packing problem, the soft rectangle packing problem, and explore its problem extension for the fixed-outline floorplanning with soft modules. For the soft rectangle packing problem with zero deadspace, we present an iterative merging packing algorithm that merges all the rectangles into a final composite rectangle in a bottom-up order by iteratively merging two rectangles with the least areas into a composite rectangle, and then shapes and places each pair of sibling rectangles based on the dimensions and position of their composite rectangle in an up-bottom order. We prove that the proposed algorithm can guarantee feasible layout under some conditions, which are weaker as compared with a well-known zero-dead-space packing algorithm. We then provide a deadspace distribution strategy, which can systematically assign deadspace to modules, to extend the iterative merging packing algorithm to deal with soft packing problem with deadspace. For the fixed-outline floorplanning with soft modules problem, we propose an iterative merging packing based hierarchical partitioning algorithm, which adopts a general hierarchical partitioning framework as proposed in the popular PATOMA floorplanner. The framework uses a recursive bipartitioning method to partition the original problem into a set of subproblems, where each subproblem is a soft rectangle packing problem and how to solve the subproblem plays a key role in the final efficiency of the floorplanner. Different from the PATOMA that adopts the zero-dead-space packing algorithm, we adopt our proposed iterative merging packing algorithm for the subproblems. Experiments on the IBM-HB benchmarks show that the proposed packing algorithm is more effective than the zero-dead-space packing algorithm, and experiments on the GSRC benchmarks show that our floorplanning algorithm outperforms three state-of-the-art floorplanners PATOMA, DeFer and UFO, reducing wirelength by 0.2%, 4.0% and 2.3%, respectively.

Introduction

Rectangle packing problem (Baker et al., 1980), which aims to place a set of rectangles onto a rectangular outline, is one of the representative problems in combinational optimization. For the packing problem dealing with rectangles with fixed dimensions, there are a lot of heuristics (He, Huang, Jin, 2012, He, Ji, Li, 2015, Huang, Chen, Xu, 2007, Lesh, Marks, McMahon, Mitzenmacher, 2005) and meta-heuristic methods (Gonçalves, 2007, Gonçalves, Resende, 2010, Hopper, Turton, 2001). The soft rectangle packing (SRP) problem deals with soft rectangles whose areas are fixed and aspect ratios (the ratio of rectangle height to rectangle width) can be adjusted in certain ranges.

In the research of SRP, if deadspace is allowed on the outline, there are plenty of works to determine the upper bound on the optimal area of the outline. By dividing rectangles into groups based on their areas and placing them one at a time in an area non-increasing order, Young and Wong (1997) give an upper bound min{(1+1/r),5/4,(1+α)}Atotal, where Atotal is the total area of all the rectangles, Amax  is the maximum rectangle area, α=2Amax/(rAtotal) and r ≥ 2 is the shape flexibility of each rectangle. Based on the same packing strategy but more detailed analysis, Peixoto et al. (2000) give a more delicate upper bound (1+1/(|r|γ1)), where γ is the smallest j ≥ 2 such that group j is not empty. Yang et al. (2005) adjust the rectangle grouping rule in (Peixoto et al., 2000) and propose an upper bound min{1.131,(1+β)}×Atotal, where β=Amax/(2rAtotal) and r ≥ 2.25. Nagamochi (2006) proves that if the area of the outline is no less than Atotal+0.10103Amax and the length of the outline’s shorter side is no less than Amax/3, then all the rectangles can be packed with each rectangle’s aspect ratio is no more than 3.

When the outline contains no deadspace for the SRP, Beaumont et al. (2002) propose two extended problems of SRP, PERI-SUM and PERI-MAX, which aim to minimize the sum of the perimeters of the rectangles and to minimize the largest perimeter of the rectangles respectively. And they give a 7/4-approximate algorithm for PERI-SUM and a 2/3-approximation algorithm for PERI-MAX. Nagamochi and Abe (2007) present an O(nlogn) complexity algorithm that finds a 1.25-approximate packing solution for PERI-SUM and a 2/3-approximate packing solution for PERI-MAX, and the rectangles’ aspect ratio is at most max{ρ(outline),3,1+maxi=1n1{Ai+1/Ai}}, where ρ(outline) is the aspect ratio of the outline and Ai is the area of rectangles sorted in a non-increasing order. By modifying a divide-and-conquer strategy (Peixoto et al., 2000), Fügenschuh et al. (2014) give a 3/3-approximate algorithm for the PERI-SUM. Cong et al. (2006) propose a zero-dead-space (ZDS) packing algorithm, and prove that the algorithm can obtain feasible packing under some sufficient conditions.

The fixed-outline floorplanning of soft modules (FOFSM) problem is one of the main applications of SRP. Given a set of nets specifying the interconnections among modules, FOFSM aims to minimize the total wirelength of the nets while placing modules feasibly as required by SRP. There are two main kinds of methods for the FOFSM: the simulated annealing (SA) based method and the global-legalization (GL) based method.

In the SA-based method, we need to design a suitable representation to encode the layout, and to design an efficient method to synthesize a layout from a representation. As the shapes of the soft modules could vary continuously, it is difficult to synthesize a layout from a representation. Several analytical methods have been proposed to address this issue. Based on the sequence-pair representation (Murata et al., 1996), Young et al. (2001) propose a geometric programming approach using the lagrangian relaxation technique to synthesize layout from the sequence pair representation, and Kim and Kim (2003) adopted a construction method and a linear programming based method to perform the synthesizing. He et al. (2008) suggest an ordered quadtree representation. Given an ordered quadtree, they iteratively build and solve a group of four quadratic equations in four variables to determine the dimensions and coordinates of each module. Lin and Hung (2012) apply a left-right skewed binary tree (SKB-Tree) to encode a floorplan. To transform a SKB-Tree into a layout, they first divide the outline into a set of containers. Then, they place modules in each skewed right branch into the corresponding container iteratively.

The GL-based method consists of two stages: the global placement stage and the legalization stage. The global placement stage aims to evenly place modules onto the outline and to minimize the wirelength simultaneously. The legalization stage removes the overlap among modules to obtain an overlap-free layout. Ying and Wong (1989) heuristically model the two stages as unconstrained minimization problems and solve them by a modified self-scaling variable metric method (Oren, 1973). By transforming rectangular modules into circles, Luo et al. (2008) propose a convex optimization model called attractor-repeller (AR) to place modules in the first stage. They use a second order cone programming (SOCP) formulation to yield overlap-free layout and minimize the wirelength in the second stage. Lin and Hung (2011) present a unified convex optimization (UFO) floorplanner. By modifying the AR model, the UFO adopts a push-pull model whose objective is more accurate than that of AR in measuring the wirelength. UFO uses a SOCP as a legalization method to remove overlaps without considering the wirelength. By combining the advantage of the analytical approach and the slicing tree representation, Lin and Wu (2014) propose a F-FM floorplanner for the floorplanning problem with mixed-size modules. The F-FM adopts an analytical method Aplace (Kahng and Wang, 2005) as the placement tool, and constructs a generalized slicing tree (GST) (Yan and Chu, 2010) to capture feasible layout from the distributed layout.

In this paper, we propose an iterative merging packing (IMP) algorithm for the SRP with zero deadspace constraint (the area of the outline equals the total area of the rectangles). Similar to the construction of Huffman tree, IMP first merges all the rectangles into a final composite rectangle by iteratively merging two rectangles with the least areas. For each composite rectangle generated in the process, the merging direction (horizontal/vertical) and relative position (left-right/top-down) of the two sub-rectangles are not specified. Then, IMP places the final composite rectangle exactly onto the outline, and recursively determines the dimensions and positions of each pair of sub-rectangles based on the aspect ratio of their composite rectangle. Based on a novel deadspace distribution strategy, which assigns deadspace to some rectangles to extend their dimension flexibility, we extend IMP to solve SRP having deadspace.

Based on the IMP, we propose an iterative merging packing based hierarchical partitioning (IMP-HP) algorithm for the fixed-outline floorplanning with soft modules (FOFSM) problem. IMP-HP adopts the same hierarchical bipartitioning framework in PATOMA proposed by Cong et al. (2006), but we replace the packing algorithm as our IMP. IMP-HP uses a recursive bipartitioning to partition the original problem into a set of subproblems so as to minimize the interconnections among the subproblems, and it uses IMP to solve all the subproblems to get a solution. At each bipartition of IMP-HP, by dividing modules with the multilevel hypergraph partitioning algorithm hMetis (Karypis et al., 1999) and cutting the placed region parallel to the short edge, we partition a problem into two subproblems. If either of the subproblems cannot be feasibly solved by IMP, then we use the deadspace distribution strategy to assign deadspace to some infeasible modules to legalize the subproblems. The bipartition is implemented if and only if both the subproblems can be feasibly solved by IMP.

Our main contribution are the design of the packing algorithm IMP and the design of the strategy assigning deadspace to modules. For the IMP, we prove that it can feasibly place soft rectangles under some sufficient conditions. Compared with zero-dead-space (ZDS) (Cong et al., 2006), a popular packing algorithm which has sufficient conditions for feasible packing, the sufficient conditions of IMP are more weak. Experimental results also verify that IMP and ZDS have the same capability in handling soft rectangles having flexible dimensions, and IMP is more effective when the rectangles have stringent restrictions on the shapes. As for the deadspace distribution strategy, because it assigns deadspace to infeasible rectangles based on the extent that each rectangle’s dimensions exceed its feasible interval, a proper amount of deadspace can be distributed to the targeted rectangles, which can dramatically improve the flexibility of IMP.

The remainder of this paper is organized as follows. Section 2 presents the formulations of SRP and FOFSM. Section 3 describes the iterative merging packing (IMP) algorithm for SRP with zero deadspace constraint and analyzes its conditions for feasible packing. Section 4 presents an extension of IMP to solve SRP having deadspace. Section 5 presents the iterative merging packing based hierarchical partitioning (IMP-HP) algorithm for the FOFSM. Experimental results are presented in Section 6, and the final section ends with a conclusion.

Section snippets

Soft rectangle packing problem

Given a set of soft rectangles with each rectangle ri having fixed area si and aspect ratio interval [1/λi, λi] (λi ≥ 1 is the bounding factor), a fixed outline with width W and height H. The soft rectangle packing (SRP) problem aims to shape the rectangles and place them onto the outline without overlapping. Let (xi1, yi1) and (xi2, yi2) denote the coordinates of the bottom-left vertex and the upper-right vertex of ri, respectively. Let width wi and height hi represent the two dimensions of ri

An iterative merging packing algorithm for the SRP problem

This section presents an iterative merging packing (IMP) algorithm for the SRP with zero deadspace. We first introduce a concept of composite rectangle. Then we describe IMP in details and compare IMP with a popular SRP packing algorithm called zero-dead-space (ZDS) (Cong et al., 2006).

Extended algorithm for SRP problem with deadspace

The extended algorithm of IMP is used to handle the SRP problem having deadspace. The key issue is to define efficient strategy to assign deadspace to the rectangles to extend the dimension flexibility of the rectangles. In this way, IMP is more likely to handle all the rectangles feasibly. In the following part, we present two variants of deadspace distribution strategies, DDS1 and DDS2.

  • (1)

    DDS1: The idea is to assign deadspace to the rectangles in stage I of IMP, to make all the merging actions

Algorithm description

Based on a hierarchical partitioning framework (Cong et al., 2006) and our packing algorithm IMP, we propose an iterative merging packing based hierarchical partitioning (IMP-HP) algorithm for the FOFSM problem. IMP-HP hierarchically partitions the FOFSM problem into a set of subproblems and solves the subproblems by IMP. Because we perform a bipartition if and only if both the generated subproblems can be feasibly solved by IMP, legalization is guaranteed in the IMP-HP. And in case a

Experimental results

We implement IMP-HP (the source code is available on website https://github.com/ji759823501/IMP-HP) in the C programming language on a personal computer with 3.00  GHz CPU and 4.0 GB memory running Linux 13.3. For the parameters of hMetis, we set the unbalance parameter UBfactor=1,options[7]=1 and use default values for the other parameters. UBfactor is an integral parameter, suppose hMetis partitions a set of modules C1 into two subsets C2 and C3, UBfactor is used to balance the areas of the

Conclusion

In this paper, we address two variants of the soft rectangle packing (SRP) problem without deadspace and with deadspace, and extend the method for solving the fixed-outline floorplanning with soft modules (FOFSM) problem. For the SRP, we propose an iterative merging packing (IMP) algorithm. Compared with a popular packing algorithm called zero-dead-space (ZDS), IMP can handle more difficult instances that have tighter aspect ratio bounds on the rectangles and larger size gap between the

References (37)

  • A. Fügenschuh et al.

    Exact and approximation algorithms for a soft rectangle packing problem

    Optimization

    (2014)
  • J.F. Gonçalves et al.

    A parallel multi-population genetic algorithm for a constrained two-dimensional orthogonal packing problem

    J. Comb. Optim.

    (2010)
  • GSRC, Floorplan Benchmarks [Online]. Available:...
  • O. He et al.

    A novel fixed-outline floorplanner with zero deadspace for hierarchical design

    IEEE/ACM International Conference on Computer-Aided Design, 2008. ICCAD 2008.

    (2008)
  • IBM-HB, Floorplan Benchmarks [Online]. Available:...
  • A.B. Kahng et al.

    Implementation and extensibility of an analytic placer

    IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.

    (2005)
  • G. Karypis et al.

    Multilevel hypergraph partitioning: applications in vlsi domain

    IEEE Trans. Very Large Scale Integr. (VLSI) Syst.

    (1999)
  • J.G. Kim et al.

    A linear programming-based algorithm for floorplanning in vlsi design

    IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.

    (2003)
  • Cited by (14)

    • NHACR: A novel heuristic approach for 2D rectangle packing area minimization problem with central rectangle

      2021, Engineering Applications of Artificial Intelligence
      Citation Excerpt :

      As one of the most widely-studied packing problems, the two-dimension rectangle packing area minimization problem (RPAMP) (Wei et al., 2011; Oliveira et al., 2020) has been applied in lots of industry fields, such as chip design, integration of circuits, aerospace, apparel, platform layout and chemical industries (Ji et al., 2017; Gao et al., 2021b; He et al., 2015).

    • A Quasi-Newton-based Floorplanner for fixed-outline floorplanning

      2021, Computers and Operations Research
      Citation Excerpt :

      Hard modules have fixed shapes, while soft modules have fixed areas but variable aspect ratios. In this paper, we focus on handling the fixed-outline floorplanning problem with both hard modules and soft modules, which is harder than problems addressing only one type of modules, such as in (He et al., 2008; Ji et al., 2017) for only soft modules. Given a set of hard modules, a set of soft modules, and a netlist specifying the interconnections among the modules, the fixed-outline floorplanning problem aims to shape the soft modules and place all the modules on a fixed outline, and the goal is to minimize the total wirelength of the netlist.

    • Heuristic algorithm for RPAMP with central rectangle and its application to solve oil–gas treatment facility layout problem

      2018, Engineering Applications of Artificial Intelligence
      Citation Excerpt :

      In last several years, many approaches have been presented to solve RPAMP. Ji et al. (2017) proposed an iterative merging packing algorithm. However, this algorithm just can address the soft rectangle packing problem, which is a variant of RPAMP.

    View all citing articles on Scopus

    This work was supported by National Natural Science Foundation of China (Grant nos. 61472147, 61602196, 61370183 and 61272014).

    View full text