The research on the triangle packing problem has important theoretic significance, which has broad application prospects in material processing, network resource optimization, and so forth. Generally speaking, the orientation of the triangle should be limited in advance, since the triangle packing problem is NPhard and has continuous properties. For example, the polygon is not allowed to rotate; then, the approximate solution can be obtained by optimization method. This paper studies the triangle packing problem by a new kind of method. Such concepts as angle region, corneroccupying action, corneroccupying strategy, and edgeconjoining strategy are presented in this paper. In addition, an edgeconjoining and corneroccupying algorithm is designed, which is to obtain an approximate solution. It is demonstrated that the proposed algorithm is highly efficient, and by the time complexity analysis and the analogue experiment result is found.
Solving NPhard problems is always the bottleneck task for computer science and techniques. However, in recent years, many research results have indicated that there is no a complete, accurate, and fast solving algorithm for this kind of problem at all. People tend to focus on searching for a quick and practical approximation algorithm; see, for example, [
Triangle packing problem is that given a known length and width of rectangle empty container and N triangles of definite size and shape; namely, the three sides of a triangle are known, and the question is whether the N triangles can be placed into the rectangle container. If we can, then give position and orientation of each triangle in the rectangle. If no, give a negative answer to this problem. Since triangle in the plane can be continuously translated and rotated, there are infinite numbers of placements which are detrimental to solve the problem. And so the placement should be limited always. The strategy in [
Triangular packing problem is a special case of a polygon packing problem but is still NPhard. For now, there is no a quick and complete solving algorithm, and the heuristic method is still an ordinary method; see, for example, [
In Section
Triangles in a same plane are said to be intersectant, if the overlapping area of two triangles is larger than zero. Or else the two triangles are said to be nonintersectant.
For two nonintersectant triangles in the same plane, if there exists one intersection at least between two edges which are from each triangle, then the two triangles are said to be tangent, as shown in Figure
Tangent triangle.
For two edges from two tangent triangles, respectively, if the following conditions are satisfied:
There exists only one intersection (O) for the two triangles;
An angle formed by the two edges is a positive angle and less than
In the angle of
Angle region.
To judge whether there is an angle region formed by two tangent triangles, it is just to take out two edges with common vertex from each of triangles and judge that whether the two triangles form a positive angle less than
By the definition of angle region, whether the two edges of the tangent triangles can form angle region is unrelated to the size and shape of the triangle that will be put into the angle region.
Depending on the two triangles’ different positions, the two tangent triangles may form zero, one or two angle region, which is shown in Figures
Zero angle region.
One angle region.
Two angle regions.
These angle regions look like the scraps generated during the material machining processes. If we make use of these scraps, then the ratio of utilization of material can be increased on basis of practical production experiences. It is illustrated through practice to sufficiently increase the ratio of material, and then the position of the filter within the vessel should be stable. Whether a plane figure is precarious depends on shiftable degree of freedom and the rotatable degree of freedom. For a triangle, the rotatable degree of freedom refers to a clockwise or counterclockwise rotation of one triangle with the origin at one of its vertexes, and here the triangle is still in the rectangle container after be rotated, and the triangle cannot conflict with other triangles around it; namely, there is no overlapping part between the rotated triangle and other triangles, which means you can rotate the triangle freely; similarly, the translatable degree of freedom refers to a translation of one triangle along two opposite directions of one of the straight lines on which one edge of the triangle lies in the barycentric coordinate of the triangle as the initial point, when the triangle is still in the rectangle container after the manipulation of translating, and the triangle cannot conflict with other triangles around it; namely, there is no overlapping part between the translated triangle and other triangles, which means you can translate the triangle freely.
If a triangle with the barycentric coordinate as the initial point can translate freely along any straight line where a edge of the triangle lies, then the triangle is deemed to be impending. Apparently, the position of this kind of triangle is unstable, such as the triangle 1 shown in Figure
Instability of triangle.
If a triangle can translate freely along one straight line only or rotate freely around a certain vertex, this kind of position is pushable and swingable, and also it is unstable, such as the triangles 2 and 3 shown in Figure
Generally speaking, the position where a triangle cannot translate freely along one straight line only or rotate freely around a certain vertex is stable, such as the triangles 4, 5, 6, and 7 shown in Figure
If one edge of the triangle 1 is conjoined with a edge of another triangle 2, namely, the length of the overlapping part is more than zero and the triangle 1 can only translate along the edge of the triangle 2, then the position of the triangle 1 is pushable. Pushing the triangle 1 along the edge of the triangle 2, if the triangle 1 is just tangent to a third triangle and the edge of the triangle 1 is still conjoined with the edge of the triangle 2, then the position of the triangle 1 is stable.
In general, compared with the positions of triangles 4 and 7, the positions of triangles of 5 and 6 can easily divide the space, which is bad for making use of space. It is reasonable to assume that the positions of triangles 4 and 7 are better than those of triangles 5 and 6. For this reason, we have the following definitions.
Corneroccupying action: If one edge of a triangle is conjoined with a initial or terminal edge of a angle region, namely, the length of the overlapping part is more than zero and another edge of the triangle is conjoined with a terminal or initial edge of the region, then the process of putting the triangle into the angle region is called a corneroccupying action. In the case, the angle opposite to the third edge is called the cutin angle.
It can find a corneroccupying action in this way: pushing a edge which is conjoined with a initial or terminal edge of the triangle region of a triangle outside a rectangle container into the rectangle container, if when the triangle cannot be put away any more (when the triangle is tangent to the terminal or initial edge), the edge of the triangle is still conjoined with the initial or terminal edge of the angle region, then the process of putting the triangle into the position is called corneroccupying action. Therefore, the problem of putting a triangle into an angle region formed by two tangent triangles can be transformed to a issue of position relation between the edge of triangle and the line segment. Thereby, the search space can be confined in a limited number of points from a continuous Euclidean space.
The conjoint degree of a corneroccupying action: If one edge (the length is
For two edges of an angle region, if the angle between a edge which is conjoined with a triangle and another edge which is tangent to the triangle is
The conjoint degree and the conformity degree are used to measure the adjacent degree between the filling triangle and the position where the filling triangle will be placed. The bigger the conjoint degree and the conformity degree of a corneroccupying action are, the higher the adjacent degree is.
As shown in Figure
Rectangle container.
Pattern: A pattern refers to a kind of ordered pair
At the first moment,
In the
Based on the edgeconjoining strategy and the corneroccupying strategy, a heuristic algorithm for solving triangle packing problem is provided below.
Given the initial pattern
Set
If
Choose a reasonable corneroccupying action with the highest priority to perform according to corneroccupying strategy. If there exists only one reasonable corneroccupying action according to corneroccupying strategy, then fill the triangle according to this corneroccupying action, and go to Step
Choose a reasonable corneroccupying action with the highest priority to perform according to conjoiningoccupying strategy. If there exists only one reasonable corneroccupying action according to conjoiningoccupying strategy, then fill the triangle according to this corneroccupying action; if not, fill the triangle according to the first corneroccupying action.
Add three vertical coordinates of the triangle performing the corneroccupying action to the
For the initial pattern
Firstly, calculate the time complexity of all the angle regions formed by m triangles in
Given two triangles, take out one edge from each of them, if it will take
It will take
Secondly, calculate the time complexity of all the corneroccupying actions of putting
If it will take
Thirdly, calculate the time complexity of judging whether each corneroccupying action is a reasonable corneroccupying action.
If it will take
Finally, calculate the time complexity of finding out the corneroccupying action with the highest priority from all the reasonable corneroccupying actions.
If it will take
At this moment, a triangle has been put in the rectangle container, and then switch to a new pattern. it will take
Similarly,
In the initial pattern,
That is to say, the time complexity of the proposed algorithm is
In this section, we have developed a program to verify the effectiveness of the proposed algorithm, and the experimental data is included in Table
Experimental data.
Example no.  Edge lengths of rectangle containers  Edge lengths of triangles  Graphic outputs  Algorithm results 

1  80, 80 

Figure 
two triangles left 
 
2  700, 400  225.0, 275.5, 160.0 
Figure 
one triangle left 
166.0, 174.9, 55.0  
278.9, 134.0, 245.0  
229.0, 190.0, 299.0  
108.0, 260.0, 279.7  
296.0, 278.2, 300.4  
167.6, 293.2, 273.5  
 
3  200, 200 

Figure 
Success! 
 
4  400, 300  166.0, 174.9, 55.0 
Figure 
Success! 
278.9, 134.0, 245.0  
229.0, 190.0, 299.0  
108.0, 260.0, 279.7  
296.0, 278.2, 300.4  
167.6, 293.2, 273. 
Input is the following:
the length and width of rectangle container (error is 0.1),
the edge length of each triangle to be put into (error is 0.000001).
Output is the following:
the utilization (error is 0.1%),
computing time (error is 0.01 second),
the sequence to put the triangles into the rectangle container,
the vertex coordinates of triangles to be put,
the calculating error is 0.000001; the display unit is pixels.
The authors declare that there is no conflict of interests regarding the publication of this paper.
This work was supported in part by the Key Project of Technology Department of Henan Province of China under Grant 122102210042, the Scientific and Technological Brainstorm Project of Henan Province of China under Grant 12B520054 and the 863 Program of China under Grant 2011AA01A201.