A New Quasi-Human Algorithm for Solving the Packing Problem of Unit Equilateral Triangles

and Applied Analysis 3


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 twodimensional 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, onedimensional (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][5][6]).According to graph theory, a branch-andbound 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 corneroccupying 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 divideand-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.

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 6 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, △ 1 and △ 2 are tangent to with each other, and △ 3 and △ 4 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.

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.
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 △ 1 clings to a side of others, then the triangle can only slide along the clinging side, and the position of △ 1 is said to be a slidable position.If △ 1 slides along the clinging side to cling to a third unit equilateral triangle △ 3 , where △ 1 still clings to △ 2 , then the position of △ 1 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 △ 1 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 △ 2 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 △ 3 (which can move left and right), △ 4 , and △ 5 (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 △ 6 and △ 7 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 sideclinging 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  1 ), set the length of overlapping part as  1 , then the side-clinging degree of the side-clinging action is  1 / max (1,  1 ).Specifically, if the other side of the unit equilateral triangle clings to another side (the length is  2 ) of the angle region, set the length of overlapping part as  2 , 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.

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  > 0; 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 ⟨ 0 ,  0 ⟩.Putting the th (0 <  ≤ ) 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 ( 1 and  2 ) as  1 and  2 , respectively.If  1 >  2 , then priority of the side-clinging action  1 is higher than  2 .
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 ⟨ 0 ,  0 ⟩, where  0 is the set of triangles constituting a given square container,  0 is the set of angle regions formed by four triangles constituting a given square container.Arrange angle regions and appropriate sideclinging actions in the pattern according to time sequences.
Step 1. Set  = 0,  =   , and the number of the unit equilateral triangles to be put into the container as  − .
Step 2. In the pattern   , if  −  = 0, then print the information indicating that all the triangles have been put into the square container and stop; if − ̸ = 0 and there is no appropriate side-clinging action to be performed, then print that it is failure to obtain the solution and stop; if  −  ̸ = 0 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  ≤  + 1 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.

Time Complexity Analysis of the Side-Clinging Algorithm
In general, one can assume that there are −1 unit equilateral triangles that have been put into the container at the pattern ⟨, ⟩; namely, there are  + 3 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  + 3 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 (3, 1)×(3, 1)× = 9 time units at most to find the angle region formed by the two triangles.Besides, it is easy to know that it will take ( + 3, 2) × 9 time units at most to find all the possible angle regions formed by  + 3 triangles in .According to the definition of angle region, two triangles can form two angle regions at most.Therefore, there will be up to 2 × ( + 3, 2) 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 +3 triangles is far less than 2×(+3, 2).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 2 time units at most.One can easily find that it will take up to ( + 3, 2) × 4 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  1 time units to judge whether two triangles can intersect each other and  2 time units to judge whether a unit equilateral triangle is in the square container, then it will take (+3, 2)× 4((−1)× 1 + 2 ) time units to find all appropriate side-clinging actions.

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 (±0.1);Number of unit equilateral triangles to be put (±0.000001).
The simulation results are shown in Figure 8, from which we can know that the computing speed of the suggested quasihuman 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.

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][27][28][29][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][32][33][34][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.