#### Abstract

The packing problem of unit equilateral triangles not only has the theoretical significance but also offers broad prospects in material processing and network resource optimization. Because this problem is nondeterministic polynomial (NP) hard and has the feature of continuity, it is necessary to limit the placements of unit equilateral triangles before optimizing and obtaining approximate solution (e.g., the unit equilateral triangles are not allowed to be rotated). This paper adopts a new quasi-human strategy to study the packing problem of unit equilateral triangles. Some new concepts are put forward such as side-clinging action, and an approximation algorithm for solving the addressed problem is designed. Time complexity analysis and the calculation results indicate that the proposed method is a polynomial time algorithm, which provides the possibility to solve the packing problem of arbitrary triangles.

#### 1. Introduction

The solution of NP hard problem has both popularity and intractability, which is of great value in philosophy of science and real life. Packing problem in two-dimension plane is a typical NP hard issue, which is about how to use the two-dimensional space efficiently. To date, research results show that a complete axiomatic approach is not currently viable. Packing problem of unit equilateral triangles is actually a special case of the two-dimension packing problem. Therefore, researches on the packing problem of unit equilateral triangles are theoretically significant to look for an efficient approximate algorithm for a NP hard issue, especially for a general packing problem. Moreover, researches on the rational distribution of a set of unit equilateral triangles, which do not overlap mutually in a limited region, are extremely useful in practical application. The packing problem discussed in this paper is one of the key issues in the field of CAD/CAM, the task of which is to design a high-performance algorithm to improve the quality of a layout scheme for the purposes of saving raw materials, shortening the construction period, reducing the costs, increasing productivity, and so forth.

A classification approach for packing problem has been brought forward by Dyckhoff in 1990 (see, e.g., [1]), and an improved classification method has been proposed by Wäscher et al. in 2007 (see, e.g., [2]). Wäscher et al. have classified the packing problem into four cases, namely, one-dimensional (1D), two-dimensional (2D), three-dimensional (3D), and high-dimensional (-D) spaces. 1D packing problem only considers one factor, such as weight, volume, or length. 2D packing problem always considers two factors. Some common issues include geographic division of parking lots, trim of packing materials, and leathers. 3D packing problem considers three factors, usually the length, width, and height. For example, three dimensions should not go beyond the set bounds in ship or car loading process. -D packing problem is always the optimal operation of rectangle packing problem in space and time dimension. Reference [3] can be deemed as a world’s earlier result about -D packing problem, where the layout feature of rods with -1 unit sides has been analyzed, but a specific algorithm has not been described. Subsequently, Fekete et al. have published a series of articles to discuss the general -D packing problem (see, e.g., [4–6]). According to graph theory, a branch-and-bound framework and a tree searching algorithm have been provided based on all kinds of legitimate classifications. Typical examples regarding 1D and 2D spaces are presented, but the situations of 4D or more are not discussed. Moreover, the famous OR-Library and PackLib^{2} provide only the 2D and 3D packing instances; see [7, 8], respectively.

The most common packing problems in daily life include cloth cutting and steel processing. Nowadays, the academia has conducted large number of valuable studies on the 2D and 3D packing problems; see, for example, [9, 10]. 2D packing problem mainly includes circles packing problem, rectangles packing problem, and triangles packing problem. Based on the population control (PERM) strategy and corner-occupying approach, a new hybrid algorithm is proposed to solve the problem of packing equal or unequal circles into a larger circle container in [11]. In [12], a novel computational approach is designed to place identical nonoverlapping disks into a unit square, by which the radii are maximized. And based on the conjecture, a stochastic search algorithm that displays excellent numerical performance is developed. By elaborately simulating the movement of the smooth elastic disks in the container in the physical world, a heuristic quasiphysical strategy is provided in [13] for solving disks packing problem. Subsequently, based on the simulated annealing, that is, imitating the displacements of the objects under different temperature, the calculation speed is also improved. In [14], a coarse-to-fine quasiphysical optimization method is presented for solving the circle packing problem with equilibrium constraints, where the dense packing of circular disks satisfying the equilibrium constraints is considered. 3D packing problem is confined primarily to a cuboid packing problem, which mainly includes the block arrangement method [15], spatial representation technique [16], genetic algorithm [17], dynamic space decomposition approach [18], and sequence triplet method [19].

In the past decade, the rectangles packing problem has been widely studied by researchers at home and abroad; for instance, a population heuristic is proposed in [20]. An effective deterministic heuristic, namely, the Less Flexibility First strategy, is studied in [21]. A hybrid heuristic algorithm is provided in [22], which is based on the divide-and-conquer and greedy strategies. Unfortunately, to the best of authors’ knowledge, so far, the triangles packing problem and the convex polygons packing problem have not yet been discussed well. In [23], a preliminary study has been conducted on the general triangles packing problem, but further improvement and some indepth studies are required.

Therefore, the primary purpose of this paper is to study the packing problem of unit equilateral triangles according to the characteristic of the unit equilateral triangles and in the base of analysis of the general triangles packing problems. The main contribution of this paper can be listed as follows.(i)A mathematical description of the packing problem of unit equilateral triangles is proposed, and the characteristic and advantage of which are colloquially stated.(ii)A reasonable quasi-human strategy is formed according to the natural law of the “like attracts like."(iii)A new algorithm for solving the packing problem of unit equilateral triangles is presented based on the proposed quasi-human strategy.

#### 2. Problem Formulation

Packing problem of unit equilateral triangles: given one square container whose side is , if unit equilateral triangles can be put into the given container, then develop a concrete algorithm accordingly or else provide an opposite answer. Actually, the problem can be formally described as follows. For any given positive integer and one square container with every side of , let be the overlap area of the th triangle () and the th triangle (). Does there exist the following array of real numbers? Consider such that If there exists one which meets (i) and (ii), then provide the corresponding solution .

*Remark 1. *It is important to note that if the given is sufficiently large, it is very easy to find the solution constrained by (i) and (ii) to the packing problem of unit equilateral triangles. However, it is not an easy task to put the unit equilateral triangles into the square container quickly, when the given is relatively small. On the other hand, the packing problem of unit equilateral triangles can be described as follows. Given unit equilateral triangles, if these triangles can be put into a square container without overlap, then how long should the sides of the square container be at least?

Since figures in a plane can be translated and rotated continuously, there always is an infinite number of ways of layout scheme. Therefore, it is always to limit the placements of the filler when solving the packing problem quickly. The restriction policy in [1] only allows the polygons to translate but not to rotate; thus, the polygons packing problem can be converted into a NP complete problem.

*Definition 2 (tangency). *For two unit equilateral triangles in a same plane, if they intersect each other, but the overlapping area is zero, then the two triangles are said to be tangent. As shown in Figure 1, and are tangent to with each other, and and are also tangent.

*Definition 3 (angle region). *Given two tangent unit equilateral triangles, for any two sides which are taken from the two triangles, respectively, if all items below are matched:(1)there is one and only one point of intersection between the two sides, which is denoted by ;(2)the angle (let be the vertex) formed by the two sides is positive, but less than ;(3)in the angle of (2), there is on side of the two unit equilateral triangles, except these in (1),then the angle in (2) is said to be angle region of the two tangent triangles. Its size is called the angle of the angle region. The initial side of the angle in (2) is called the initial side of the angle region, and the terminal side of the angle in (2) is the terminal side of the angle region. The intersection in (1) is called the vertex of the angle region.

As shown in Figure 2, is tangent to at ; is an angle region of and . Size of the angle region is denoted by . and are the initial and terminal sides of the angle region, respectively.

To judge whether there is an angle region formed by two tangent unit equilateral triangles, it is just to take out two sides with public vertex from each unit equilateral triangle and judge whether the angle formed by the two sides is positive and less than and verify that there is no other side of the two unit equilateral triangles with the angle. The computational procedure can be realized according to vertex coordinate of the triangle.

#### 3. Classification of an Angle Region and Side-Clinging Action

When a unit equilateral triangle is tangent to another unit equilateral triangle, zero, one, or two angle regions may be formed, which is shown in Figures 3, 4, and 5(a)–5(c), respectively.

**(a)**

**(b)**

**(c)**

Based on the long-term production practice of the human society, in order to put some fillers into a given container as much as possible, one always chooses some appropriate fillers which matches the size of the free space in the container first. Then, put these fillers into some relatively stable positions. This so-called stable position cannot be rotated or slide freely.

For a unit equilateral triangle, if it can be rotated clockwise or counterclockwise around one of its vertexes, then the unit equilateral triangle is said to be freely rotated or it is said to be restrictively rotated. Let one side of the unit equilateral triangle cling to a side of another; namely, the length of the overlapping part of the two unit equilateral triangles is greater than zero. If the triangle can move along the clinging side in one direction at most, then the unit equilateral triangle is said to be restrictively sliding or it is said to be freely sliding. One point should be noted that unit equilateral triangles cannot intersect others and must always be within the square container.

If a side of the unit equilateral triangle clings to a side of others, then the triangle can only slide along the clinging side, and the position of is said to be a slidable position. If slides along the clinging side to cling to a third unit equilateral triangle , where still clings to , then the position of is stable. If a unit equilateral triangle can slide or be rotated freely, then it is said to be impending. Obviously, the position of this unit equilateral triangle at the moment is extremely unstable, as is shown in Figure 6. If a unit equilateral triangle is restrictively sliding but freely rotated, then the position of which is actually unstable, as is shown in Figure 6. Moreover, if a unit equilateral triangle is restrictively rotated but freely sliding, the position of which is still unstable, as (which can move left and right), , and (which do not overlap with side of any triangle) are shown in Figure 6. Generally speaking, the placement of a unit equilateral triangle is stable, only if it is restrictively rotated and restrictively sliding, as and are shown in Figure 6.

In general, the more stable the position of a unit equilateral triangle is, the closer it will cling to other triangles and therefore the higher the space utilization will be.

*Definition 4 (side-clinging action). *If one side of a unit equilateral triangle clings to an initial or terminal side of an angle region (the overlapping part is greater than zero) and another side of the unit equilateral triangle is tangent to terminal or initial side of the angle region, then the process of putting the triangle into the angle region is said to be a side-clinging action.

One can find a side-clinging action in this way. Let the side of a unit equilateral triangle cling to the initial side or the terminal side of the angle region and push the side along or until it cannot move (the triangle is tangent to initial or terminal side of the angle region). If the side also clings to the initial side or terminal side of , then fix the unit equilateral triangle to the position where it is. Therefore, the problem of putting a unit equilateral triangle into an angle region formed by two given tangent unit equilateral triangles is converted into the positional relationship between a side of the unit equilateral triangle and a line segment; thus, the search space is limited to just a few points from continuous Euclidean space.

*Definition 5 (side-clinging degree). *If one side of a unit equilateral triangle clings to one side of an angle region (the length is ), set the length of overlapping part as , then the side-clinging degree of the side-clinging action is . Specifically, if the other side of the unit equilateral triangle clings to another side (the length is ) of the angle region, set the length of overlapping part as , then the side-clinging degree of the side-clinging action is .

*Remark 6. *Actually, side-clinging degree can be used to measure how well a unit equilateral triangle fits the position which is proposed to be filled. The bigger the side-clinging degree is, the better the triangle will fit.

#### 4. The Side-Clinging Algorithm

As shown in Figure 7, the square container can be deemed as a plane figure formed by four equilateral triangles.

*Definition 7 (pattern). *A pattern refers to a kind of ordered pair at some points, where is the set of the four triangles constituting the square container and unit equilateral triangles which has been put in the container (each element in the set is denoted by three vertex coordinates of a triangle) and is the set of angle regions formed by triangles in .

At the first moment, let ; and there are four triangles constituting the square container in ; is the set of angle regions formed by four triangles constituting the square container. Then, initial pattern at this moment is denoted by . Putting the th triangle into the square container after the initial pattern, then the corresponding pattern is called the th pattern, which is denoted by . In the th pattern, let a triangle perform a side-clinging action; if the triangle is still in the square container and does not intersect any triangle in , then the side-clinging action is considered to be an appropriate side-clinging action.

*Side-Clinging Strategy*. Set the side-clinging degree of two appropriate side-clinging actions ( and ) as and , respectively. If , then priority of the side-clinging action is higher than .

Based on the side-clinging strategy, the quasi-human algorithm for solving a given packing problem of unit equilateral triangles can be presented as follows.

Given an initial pattern , where is the set of triangles constituting a given square container, is the set of angle regions formed by four triangles constituting a given square container. Arrange angle regions and appropriate side-clinging actions in the pattern according to time sequences.

*Step 1. *Set , , and the number of the unit equilateral triangles to be put into the container as .

*Step 2. *In the pattern , if , then print the information indicating that all the triangles have been put into the square container and stop; if and there is no appropriate side-clinging action to be performed, then print that it is failure to obtain the solution and stop; if and there are some appropriate side-clinging actions to be performed in , then go to Step 3.

*Step 3. *Perform the highest-priority side-clinging action according to the side-clinging strategy. If there is only one appropriate side-clinging action based on the side-clinging strategy, then put a unit equilateral triangle into the container according to the side-clinging action or according to the first corner-occupying action.

*Step 4. *Set and add the three-vertex coordinates of the triangle in Step 3 to . Accordingly, represents the set of angle regions formed by triangles in ; then, go to Step 2.

#### 5. Time Complexity Analysis of the Side-Clinging Algorithm

In general, one can assume that there are unit equilateral triangles that have been put into the container at the pattern ; namely, there are triangles in , and it will take time units to find and perform the highest-priority side-clinging action with respect to the th unit equilateral triangle. Sequence of the implementation is as follows.

*(**1) Time Complexity of Forming Angle Regions by ** Triangles in *. Given triangles, if it will take time units to judge whether the two sides taken from each triangle can form an angle region, then it will take time units at most to find the angle region formed by the two triangles. Besides, it is easy to know that it will take time units at most to find all the possible angle regions formed by triangles in . According to the definition of angle region, two triangles can form two angle regions at most. Therefore, there will be up to angle regions in .

*Remark 8. *In fact, it is impossible that a unit equilateral triangle is tangent to each triangle in the square container. Generally speaking, the number of angle regions formed by triangles is far less than . And this is exactly the essential reason for the fast property of the proposed algorithm.

*(**2) Time Complexity of All the Side-Clinging Actions for Putting the **th Unit Equilateral Triangle into All the Angle Regions in *. Assume that it will take time units to put a unit equilateral triangle into an angle region, with one side of the unit equilateral triangle clinging to one side of the angle region. Because there are only two different side-clinging actions to be performed while putting a unit equilateral triangle into a given angle region, it will take time units at most. One can easily find that it will take up to time units to put a unit equilateral triangle into all angle regions in .

*(3) Time Complexity of Judging Whether Every Side-Clinging Action Is an Appropriate Side-Clinging Action*. If it will take time units to judge whether two triangles can intersect each other and time units to judge whether a unit equilateral triangle is in the square container, then it will take time units to find all appropriate side-clinging actions.

*(4) Time Complexity of Finding the Highest-Priority Side-Clinging Action from All the Appropriate Side-Clinging Actions*. If it will take time units to compare the priority of two side-clinging actions, then it will take a maximum of time units to find the highest-priority side-clinging action.

Based on the above analysis, one can know that the maximum time units to put the th unit equilateral triangle into a square container should be , where , , , , and are constants. Thus, the time complexity of putting the th triangle is , and the time complexity of putting triangles will be no more than , which implies that the time complexity of the designed algorithm is . If there is no reasonable side-clinging action to perform, then stop. Thus, the order of magnitude of the total computing time is not more than .

In the process of solving the packing problem of unit equilateral triangles, we find that some similar packing problems can be solved by experience accumulated in long-term practice. For example, the triangles packing problem is the same as with bricklayers: how to place irregular stones to make the most of the limited space? Based on past experience, they always occupy corners first, then sides and centers. In fact, this idea just provides an arrangement sequence. Inspired by which, we only consider the properties of side-clinging actions for unit equilateral triangles, which can guarantee the compactness of placement method. According to the proposed side-clinging algorithm, an approximation algorithm for solving packing problem of general polygon can be developed in the future.

#### 6. Illustrative Examples

This program is developed by using Visual C++6.0. The simulation example is tested on a computer with Pentium 2.8 GHz processor and 1 G of RAM.

*Inputs*: Length of the side of the square container ; Number of unit equilateral triangles to be put .

*Outputs*: Utilization ; Computing time ; Sequence of putting unit equilateral triangles into a square container.

The simulation results are shown in Figure 8, from which we can know that the computing speed of the suggested quasi-human algorithm is polynomial time. However, the size of the square container for placing three unit equilateral triangles is the same as the case of four in some individual examples, indicating that space utilization of the container has yet to be improved. In future research, we will explore how to adjust and improve the quasi-human algorithm to increase the space utilization.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

#### 7. Conclusions and Future Work

In this note, a novel quasi-human algorithm for solving the packing problem of unit equilateral triangles has been proposed. We have categorized angle regions of two tangent triangles based on their position relations. Some concepts and terms have been defined, such as tangency, angle region, and side-clinging action, and the position stability of triangles has been analyzed. According to the side-clinging strategy, an effective quasi-human algorithm has been developed to solve the packing problem of unit equilateral triangles. On the basis of the simulation results, we can find that there is always only one angle region between two successive unit equilateral triangles, and the mount of angle regions can be relatively stable. Thus, search scope of available space for the subsequent triangles can be reduced, which is the root cause of the lower complexity of the suggested quasi-human algorithm.

Although the computational results are already very satisfactory, there are still many possible ways that may further improve the proposed quasi-human algorithm, such as the sound fuzzy method; see [24, 25] and references therein. As is well known, networked systems (NSs), complex networks, sensor networks, and multiagent systems are some important systems in daily life, and researches on which have become increasingly active in recent years, primarily due to their wide applications in many fields; see, for example, [26–30]. Naturally, how to apply our quasi-human algorithm to optimize resources in different systems is still a thoughtful issue. For another, disturbance (such as white noise and periodic narrowband noise) and incomplete information (such as data-packet dropouts and missing measurements) inevitably exist in many kinds of systems and networks; see, for example, [31–35], which will undoubtedly influence the feasibility of the suggested algorithm. Therefore, accuracy and robustness of the designed quasi-human algorithm in complicated background are a promising and valuable research direction in the future.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgments

This work was supported in part by the Key Project of Technology Department of Henan Province, China, under Grant 122102210042, the Scientific and Technological Brainstorm Project of Henan Province, China, under Grant 12B520054, the Young Teacher Foundation of Zhengzhou University, the Program for Professor of Special Appointment (Eastern Scholar) at Shanghai Institutions of Higher Learning, the Program for New Century Excellent Talents in University under Grant NCET-11-1051, the National Natural Science Foundation of China under Grants 61074016 and 61374039, and the Shanghai Pujiang Program under Grant 13PJ1406300.