JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

A Graph Theory Approach for Optimizing 3D Bin with Weight Constraint

1 P. Sivasankar, 2 S K Rajesh Kanna, 3 N. Lingaraj, 4 G. Suresh 1Assistant Professor, 2 Professor, 3Assistant Professor, 4Professor 1 Department of Mechanical Engineering, 1 Rajalaksmi Institute of technology, India [email protected], [email protected], [email protected] ,[email protected]

Abstract : In the age of digital marking, the problem of storing and transporting arbitrary products all over the world in shortest time and with less transportation cost is an important research challenge in recent days needed both by the manufacturer and the logistic industries. This can be satisfied by packing the products into bins and the bins should be packed into the containers with a minimum storage space by changing its position and orientations and those problems are called as bin packing problems. This research mainly focuses on identifying optimal solution for bin packing problems using graph theory approach. Additionally, the developed module used to solve the benchmark instances and compared with their results. The obtained results are in par with the best known solutions.

IndexTerms - Bin Packing, Graph Theory, Optimization

I. INTRODUCTION The minimization of product transportation and logistics cost is an open research problem of recent days, as the sizes as well as the dimension of products ordered online are increasing day by day along with the increase in unpredictable volume. So, a need arises to identify an optimal solution in less amount of time which packs the bins in less container space and by considering the real time packing constraints. These type of problems arises in a wide variety of contexts and the study of one dimensional Bin Packing Problem (BPP)started in the early 1970 ‟s[Michael et al]. BPP states that there are an unlimited number of bins of

arbitrary sizes and shapes of volume V i>0, which to be packed into the container of capacity C, a set of items with their weights,

wi, Ʃwi

of all the packed bins does not exceed the capacity of the container C and weight threshold W c. and the number of containers used for packing should be minimized. Thus the BPP became NP-Hard in strong sense [3]. The primary objective of this research is to minimize the number of containers required to pack all the available bins of prismatic shapes and arbitrary sizes. Thereby the transportation cost can be reduced and reduction in the logistic cost has been obtained by efficiently utilizing the available containers. Effective utilization of the container volume can be achieved by packing the bins without empty spaces, which the organization, seller and customers require. In this case, existing containers has been treated as rectangular prismatic shaped standard sized container, resource utilizations are packing of the bins of arbitrary volumes. Container capacity and maximum weight carrying capacity are the utilization threshold of the destination containers. The target is to identify the suitable bin packing pattern to minimize the destination containers and thereby maximizing the resource utilization, which in turn reduced the transportation cost of the product. Additionally, with more than one sized containers, the problem dimension increases. Besides this, there are many other considerations in the Bin Packing, but are not discussed in this paper. Not only Bin Packing Problems, but also the graph theory approach is also solving vast number of real world applications. Graph theory approach is an omnipotent mathematical tool which rephrases the real time applications into graphical form to provide unified solution to many classical problems in less time. In view of volume minimization problem, there exists various graph compression mechanisms. This research mainly focused on the solution of BPP in polynomial time, and to achieve the same, two offline graph theory based heuristics has been proposed. In the former approach, a vertex based weighted graph has been constructed from the available bins for packing, whereas each vertex in the graph represents the weight and volume of each bin to be packed in the container. Then, the heuristic chooses the real time packing constraints as the subset of the formulated vertices. The later heuristic approach is based on average weight criteria, which used to identify the minimal clique of the graph that to be packed in a container without exceeding the capacity of the container. The total number of clique partition is equal to the number of real time containers required.

Volume VI, Issue I, January/2019 Page No:2945 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

Also the developed approach can points towards a new era for solving multi-dimensional bin packing problem with conflicting constraints. The organization of this paper is as follows: The research work carried out by various researchers in the BPP is described in section II and the basic concepts of the related to the work are given in section III. Section IV elaborates the proposed algorithm and its implementations. Section V contains experimental results and in the final section VI concludes the research findings. II. LITERATURE REVIEW In this section, some of the major related works to solve the BPP are discussed in brief. Jnasen and Ohring [1997] consider time constrained scheduling problem where there was a set of jobs J with execution time t(j) to be machined in M machines and an undirected graph had constructed to identify the sequence of machining such a way the machines are utilized to the maximum [15]. Peter and Benny explained the representation of edge disjoint triangles in the graph having vertices n along with its compliments. Jansen and Ohring developed the heuristic for solving the time constrained scheduling problems and in this research importance have not been given to the computational and packing time. Rajesh and Saravanan [2012] developed for solving the ID bin packing problems without constraints. Epstein and Levin [2006] attempted to solve the BPP with conflicts using conflict graph approach by mainly improving the upper bounds on the graphs, interval graph and bipartite graphs along with the adaptation of weighting systems to analysis and identification of the best instances[16]. Rajesh kanna et al [2015] developed the ant colony based algorithm for solving the rectangular bin packing problem and proved that the algorithm is in par weith the standard heuristics. Mcclosekey and Shankar [2005] solved the BPP using the approach of Clique Graph and polynomial time approximation algorithm[17]. Rajesh et al [2012] developed a hybrid algorithm combines the genetic algorithm and tuning algorithm to solve the 3D container loading problem. Codenotti et al [2004] investigated the BPP by structurally arranging the available bins and packed them into the container from the lowest common ancestorhas low height[18]. Bujtas et al [2011] had used graph theory to solve BPP by constructing a graph G with lower and upper bound on its edges (bins to be packed into the container) and weights on its vertices (containers used to pack)[19]. Alexandr et al extended the Bollobás and Eldridge theorem on graph packing to hyper graphs packing and used two n vertex hyper graphs for experimentation. Rajesh and Malliga developed binary coded algorithm using evolutionary genetic approach to solve the bin packing problems with six major packing constraints. Richard et al formulated digraph approach for identifying the best packing paths and the algorithms used by the authors are Berge type augmenting configuration theorem, a min ‐max characterization, and a reduction to bipartite . Debajit and Samar developed a graph based algorithm for solving the 1D bin packing problems by considering the weight of the boxes. Raphael used regular tournament with n vertices having pair wise arc ‐disjoint directed triangles and constructed regular tournaments with a feedback arc set. Shachnai and Tami developed the heuristic algorithm for solving the online bin packing problems with constraints. Basu explained the analysis of algorithms in detail. Most of the above discussed literatures are hybridization of graph algorithms and exiting heuristics for solving BPP, as BPP categorized under NP hard problems. So in this research, attempt have been made to identify the minimum clique graph partition with weight constraint, which is the suitable bin packing sequence which utilizes less number of containers for multi container BPP.

III. BIN PACKING PROBLEM USING GRAPH THEORY Initially the real time problems have to be converted in the graphical format, so that the graph theory approach has been used to identify the best packing sequence. The considerations made in this research to construct the graph are as follows. A Graph G is having set of vertices Vt(G) and set of edges E(G) connecting the vertices [West]. The vertices hold the weight values and the edge holds the relations associated between the end vertices. Vt(G) ϵ {bin1, bin2, …..bin n}, Whereas, bin represents the available items to be packed into the containers. Thus a vertex weighted graph has been constructed virtually.

Vertex weighted graph is a unidirectional inter connected graph and the each vertex in the graph is assigned with a bin weight values. The values include the weight of the bin and its volume as positive values.

Vt i(G) = {W i, V i}

Whereas, W i and V i are the weight and volume of the bins to be packed into the container of capacity C and maximum weight threshold Wt(C).

A Null Graph is a graph whose edge set isnull [Deo andNarsingh].This type of graph has been used to construct the dynamically varying bin packing problems and to hold the temporary bin data during execution of multi container loadingproblems. N(G) = { Null, Null}

Volume VI, Issue I, January/2019 Page No:2946 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

A Clique is a set of combination of bin sequence to be packed into a container represented in a graph G connected by adjacent vertices. Each clique in the graph represents the bins to be packed in the respective containers. For example 7 bins and 3 containers can be represented as follows. C(G) = {1-3-4} C1 {2-5-7} C2 {6} C3

Any vertex Vt(i) in the graph G having complete sub graph or clique in its adjacent Adj(i) is commonly called as simplicial vertex and can be used to arrange the vertices in an eliminating order.

Chordal Graph is a simple graph inwhich every cycle of length four and greater has a cycle chord. Each vertex Vt iin the vertex

weighted graph G, having weight W i and volume V i respectively and the sum of weight and volume of the clique graph vertices

should be within the container capacity C j and Wt j. this problem is commonly called as Minimum Clique Partition withConstrained Weight (MCPCW) problem. The objective of the problem is identify the minimum number of cliques without exceeding the container capacity. Minimum Clique Partition withConstrained Weight (MCPCW) problem is NP-Hard and is defined as follows.Given theset S =

{b 1, b 2, …, b n}of n number of bins bi, satisfying the container capacity threshold, for example, for 3 partition problem, container capacity threshold should satisfy C/4 < b i

and weight of bins. B i = {W i, V i} and similarly container capacity C = {Wc, Vc}. b can be partitioned into m number of sub

elements or parameters e 1,e 2,…e k, such that for each k= 1, 2,…, m, in this research e i contains exactly two elements weight and volume. () = . The constructed polynomial time reduction equation Q for the considered BPP is as follows Q(P) = min {Cl}, Whereas, Cl = {Cl1, Cl2, …Clj} and each Clj = {B1, B2,…bn}, each Bi = {Wi, Vi} and all the Cli< C, where C = {Wc, Vc}. i.e. Q(P) = Min. {(w1, w2, …. Wn); (V1, V2,…Vn)} by satisfying ∑ ( ) ≤ Vc and ∑ ( ) ≤ Wc . Cl ϵ {Wcl, Vcl}, = ( ) ≤ (Wc / ) and V = ( ) ≤ (Vc / ) to claim that the identified solution is a feasible solution to an instance P of the k-partition MCPCW problem. In the obtained solution, if k is the least minimum, then the identified solution is the optimal solution or optimal sequence for the given BPP. A bin packing heuristic can also construct solution bin by bin i.e. First Fit Decreasing (FFD), Best-Two-Fit (B2F), etc. in this research, the solution obtained only after solving the graph. Also the considered offline algorithms have all the bin detail to be packed available before the packing starts along with the container details.

IV. EXPERIMENTAL IMPLEMENTATION In the BPP, the user defined data are the number of bins, its weight and the volume of each bin. Let, the set of bins represented

as a set S = {b 1, b 2,…b n}. The weight and volume of bins are represented by W= {w 1, w 2, …,w n} and V= {V 1, V 2, …,V n} respectively. Where ‘n’ is the number of available bins. The container volume is Vc and the maximum load carrying capacity of a

container is W c. In this research, in order to maintain the stability of the packed bins inside the container, larger bins need to be packed at the bottom layers and the smaller bins need to packed at the top layers to make the packing as a stable packing. So the developed algorithm sorted the user defined bins in larger to smaller volume bins, with the assumption that the weight and the volume of the bins are directly proportional. The sorted bins data re used to construct the graph. The graph used in this research for solving the BPP is weighted graph. In the constructed weighted graph, number of vertex is equal to the number of bins defined

by the user {b 1,….b n}. Each vertex of the graph is having the weight {w1,….w n} and the volume {V 1,…V n} data in it.

In the initial stage all the vertices are in isolated vertices {v 1,…,v n} form with their weight and volume data. These isolated vertices have to be linked through the edges to identify the best optimal sequence of packing pattern. The procedure to link the vertices with edges or links are as follows. All the vertices in the graph can have been linked with all other vertices either unidirectional or bidirectional. In order to reduce the complexity, in this research the unidirectional links have been used to relate the vertices. The each isolated sorted vertices have to be numbered from 1 to n. An edge or link has to be constructed between the

two vertices Vt i and Vt j is based on the following condition

Volume VI, Issue I, January/2019 Page No:2947 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

If [(i-j) x (W i-(W c-Wj))] ≥ 0 then

If [(i-j) x (V i-(V c-Vj))] ≥ 0 then Link can be formed Else Link should not be formed End of loop

Whereas Wc and Vc are the maximum weight carrying capacity and volume capacity of the container. i and j are the any two isolated vertices in the graph, not necessarily the adjacent vertices. If both the weight and volume conditions are satisfied, then the link will be formed otherwise, the developed algorithm checks for the next vertices j+1 and so on till j = n. similarly the i value have to incremented till i = n. thus the algorithm checked for the n! combinations to form the links between the vertices. Then the next stage is the clique formation, there may be any number of cliques in a graphs. But the conditions for identifying the cliques are as follows.

If ( + + ) ≤ (Wc / ) then If ( + + ) ≤ (Vc / ) then Subset or cliques can be formed. Else Subset or cliques cannot be formed. End of loop Whereas the x and y denotes the two isolated vertices not belongs to any subset or in any packing pattern. Similarly all the vertices have been verified and the sub sets have to be formulated. The sample formulated graph with 10 bins is shown in the Fig. 1.

Figure 1 : Sample Graph constructed for the Set S = {15,13,12,10,8,6,5,4,3,2,} with Wc = 20 .

Another sample graph for node 5 as the i th node is shown in the Fig. 2. Similarly edges have to be constructed for all the vertices of the graph.

Figure 2 : Sample Graph constructed for the Set S = {15,13,12,10,8,6,5,4,3,2,} with Wc = 20 for Vertex 5.

The Graph produced from the sorted sequence is in decreasing order (w 1≥ w 2≥ …≥wn), and the ordering have to satisfy the

following conditions to became a perfect elimination ordering. In the sorted sequence, Wi ≥ W j ≥ W k and vertex i and j are

connected. Then always W i + W j≤Wc and V i + V j ≤ V c, similarly, W i + W k≤Wc and W j + W k ≤ W c. As it is satisfying the edge formation rules, the vertices j and k can be connected. Also the vertices i and k can be connected. Then the ordering became

perfect elimination ordering. Combining the above equation, it became W j + W k ≤ 2(W C-Wi) and substitute Wj = W i, the equation

became W j + W k≤WC. This condition is applicable for the whole ordering in the sorted graph from i=1 to n. So, it proved that the ordering is the perfect elimination ordering. The feasible and optimal solution to the BPP can be obtained by minimizing the k value. In order to make the feasible solution, the sum of weight and volume of the identified bins of each and every clique of the graph should be less than the load bearing capacity and container volume.

Volume VI, Issue I, January/2019 Page No:2948 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

Then the obtained solution can be a feasible solution for packing the selected bins. As the problem size increases, there are probabilities of getting more number of feasible solutions. But not all the feasible solutions are optimal. The optimal solution can be obtained only by identifying the minimum number of feasible clique from the set graph G and the algorithm used for identifying the optimal cliques is given below. StepI : User input

: No. of bins, its weight {w 1,….w n} and the volume {V 1,…V n} : No. of containers, its load bearing capacity Wc and maximum capacity Vc : Check for data completion and redundancy. If on-error repeat step I StepII :Encoding user input : Number of vertices ‘n’ = no. of bins : Weights and volume – stored in matrix format Step 3: If (n>0 AND no-error) then goto step 4 else goto step 11. Step 4: Sort the vertices in descending order oftheir weight. For i= 1 to n and j = i to n If Wi

The developed algorithm returns the number of clique partitions based on the available bins with each partition weight and volume not exceeding the container capacity. The selection of the neighbor is the critical part of the algorithm which decides the quality of the output of the problem. So the algorithm have been developed such a way that the current vertex along with its neighbor linked vertices which gives maximum total weight and volume within the maximum load bearing and volume capacity of the container. Also in some cases, to filter out the hidden best solutions, average weighted method also adopted. In this method, the subset or clique of the current vertex along B with its neighbor linked vertices which give maximum average weight and volume within the threshold limit of the container. In the real time packing the number of bins to be packed into the container is more than 500 bins, so the developed graph G is chordal graph and the cliques formed from the graph is also a chordal sub graphs. In forming the chordal sub graphs with the first vertex vi, the linked adjacent vertices Vj have to be checked and added along with Vi of the sub graph with total weight and total volume ≤ Container capacity. The added vertices are tabu and should not be added to the other sub graphs. The same procedures have to be repeated until vertex set is empty. The obtained solution is for the node is the node solution. Similarly node solution for all the nodes in the graph G i.e. ‘n’ number of nodal solution have to be formed and each nodal solution may have any number of feasible solutions. The experimental implementation is explained with the sample set of bins as follows.

Volume VI, Issue I, January/2019 Page No:2949 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

Number of bins = 5; S = {b1, b2, b3, b4, b5} where B = {[10, 32]; [8, 26]; [5, 16]; [4, 12]; [2, 7]}, The isolated graph formed for the above given data is shown in the Fig. 3.

Figure 3: Isolated graph for the set B = {[10, 32]; [8, 26]; [5, 16]; [4, 12]; [2, 7]}

In the next stage, the links or edges are formed between the nodes based on the conditions and the constructed link graph is shown in the Fig. 4.

Figure 4: Linked graph and the Link weightage

The next stage is the identification of the adjacency vertices formation. The adjacency and the cliques are given in the Fig. 5. Form the Fig. 5, it is clear that the sub sets s2, s5, s7 are the optimal sub sets of the graph G.

Figure 5: Adjacency list and the possible cliques

V. RESULTS AND DISCUSSIONS The algorithm was in Visual basicand in Intel core i5 2.5 GHz processor of 4 GB RAM. The developed algorithms have been tested on three benchmark problems from OR Library. The first benchmark is BISCHOFF/RATCLIFF problem having 7 instances THPACK1-7 BR, which is a single container loading problem and took more computational time to achieve the results and the obtained results are not matching with the test instance. So the second benchmark is Davies and Bischoff (1999) test instances. There are 15 sets of benchmark instances, called BRD1 to BRD15, in which each set of data having100 instances and again in each instance, there are about 130items. Also the item types varied from 3 to 100 to make the problem more heterogeneous. For the instances, BRD 1 to BRD 7, the results are in par with the instances. For the instances BRD 8 to BRD 15, the results took more time and the results are deviating from the standard. The third dataset taken from Ngoi et al. (1994) and Loh and Nee (1992) and the comparison is given in the Table 1. As the computational time is more, it has not been included in the comparisons.

Volume VI, Issue I, January/2019 Page No:2950 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

Table 1: Comparison of propose algorithm with Ngoi et al. (1994) and Loh and Nee (1992) – Optimization level 1 Comparison Ngoi et al. Loh and Nee Proposed Algorithm problems (1994) (1992) (best of 10 iterations) Test data set # 1 62.50 78.12 76.23 Test data set # 2 80.73 76.77 78.32 Test data set # 3 53.43 69.46 56.45 Test data set # 4 54.96 77.57 59.23 Test data set # 5 77.19 85.79 81.21 Test data set # 6 88.72 88.55 88.23 Test data set # 7 81.81 78.17 79.61 Test data set # 8 59.42 67.58 65.36 Test data set # 9 61.89 84.22 65.85 Test data set # 10 67.29 70.10 66.74 Test data set # 11 62.16 65.44 64.59 Test data set # 12 78.52 79.33 76.36 Test data set # 13 84.14 77.03 72.87 Test data set # 14 62.81 69.09 65.66 Test data set # 15 59.46 73.56 62.36

VI. CONCLUSIONS In this paper, three dimensional bin packing problem has been solved only by considering the volume and not the orientation and position. As the graph algorithm consumes more time and space to process the larger dimension problems. Also the weight constraint and the stability constraint only considered for identifying the best bin packing pattern in this research. The objectives in this research are maximum total weight criteria and maximum container volume criteria. For Bischoff instance, the graph algorithm took more computation time. For Davis instances, for smaller problems, the developed graph algorithm gives good results and for higher order instances, it took more computational time. For Nogi instances, the results are comparable. From the experimental results it has been proved that the developed graph based algorithm provides better results for the small problems with less number of constraints. For the larger problems, it takes higher polynomial time and finds near optimal solutions. But for smaller problem benchmark problems, the results are better for all the instances and the graph logic outperforms for the problem without constraints.

REFERENCES [1] G. Michael R., R. L. Graham, and J. D. Ullman, “Worst-case analysis of memory allocation algorithms,” In Proceedings of the fourth annual ACM symposium on Theory of computing, pp. 143-150. ACM, 1972. [2] D. B. West, Introduction to graph theory, Vol. 2. Upper Saddle River: Prentice hall, 2001. [3] K. Jansen, and S. Öhring., “Approximation algorithms for time constrained scheduling,” Information and Computation 132, no. 2 (1997): 85-108. [4] L. Epstein, and A. Levin, “On bin packing with conflicts,” In Approximation and Online Algorithms, pp. 160-173. Springer Berlin Heidelberg, 2006. [5] B. McCloskey, and A. J. Shankar, “Approaches to bin packing with clique-graph conflicts,” Computer Science Division, University of California, 2005. [6] B. Codenotti, G. D. Marco, M. Leoncini, M. Montangero, and M. Santini, “Approximation algorithms for a hierarchically structured bin packing problem,” Information processing letters 89, no. 5 (2004): 215-221. [7] C. Bujtás, G. Dósa, C. Imreh, J. Nagy-GYörgy, and Z. Tuza., “The graph-bin packing problem,” International Journal of Foundations of Computer Science 22, no. 08 (2011): 1971-1993. [8] E.E. Bischoff and M.S.W. Ratcliff, "Issues in the development of Approaches to Container Loading", OMEGA, vol. 23, no. 4 (1995) pp.377-390. [9] Ngoi, B.K.A., Tay, M.L., Chua, E.S. (1994) Applying spatial representation techniques to the container packing problem, International Journal of Production Research 32 , 111-123.

Volume VI, Issue I, January/2019 Page No:2951 JASC: Journal of Applied Science and Computations ISSN NO: 1076-5131

[10] S.K. Rajesh Kanna, Jaisree, Balasundaram, Bharani kumar, “Optimization of 3D Constrained Rectangular Bin Packing Problem Using Recursive Ant Colony Algorithm”, IOSR Journal of Mechanical and Civil Engineering, July 2015, Vol.12, Issue 4 – vii, pp. no. 65-70. [11] S.K. Rajesh Kanna, M. SaravanaManigandan, “2PDC Heuristic Genetic Approach for Optimizing 1D Bin Packing Problems”, International Journal of Multidisciplinary Research and Advances in Engineering, Ascent Publishing House, Vol. 5, No. 2, May 2012, pp. 205-222. [12] S.K. Rajesh Kanna, P. Malliga, K.Sarukesi, “A 3D-Multi Constrained Arbitrary Sized Heterogeneous Box Packing Optimization Using Hybrid Genetic Approach”, Journal of Advanced Material Research, Trans-tek Publications, Feb 2012, Vols. 479-481, pp. 1825-1830. [13] S.K. Rajesh Kanna, P. Malliga, “Multi-Constrained Optimization of Rectangular Bin Packing Problem using Binary Coded Evolutionary Algorithm”, International Journal of Materials Manufacturing and Optimization, Serials Journals, Vol.3, No.1, Feb 2012, pp. 27-35. [14] DebajitSensarma, Samar Sen Sarma, "A NOVEL GRAPH BASED ALGORITHM FOR ONE DIMENSIONAL BIN PACKING PROBLEM", Journal of Global Research in Computer Science, Volume 5, No. 8, August 2014, page no. 1-4. [15] Shachnai, Hadas, and Tami Tamir. “Tight bounds for online class-constrained packing.” Theoretical Computer Science 321.1 (2004): 103-123. [16] Basu, S. K. “Design methods and analysis of algorithms.” PHI Learning Pvt. Ltd., 2013. [17] Deo, Narsingh. “Graph theory with applications to engineering and computer science.” PHI Learning Pvt. Ltd., 2004. [18] Richard C. Brewster Pavol Hell Sarah H. Pantel Romeo Rizzi Anders Yeo, " Packing paths in digraphs", Journal of Graph Theory, Wiley online Library, Volume 44, Issue 2, 2003, page no. 81-94. [19] Alexandr Kostochka, Christopher Stocker, Peter Hamburger, "A Hypergraph Version of a Graph Packing Theorem by Bollobás and Eldridge", Journal of Graph Theory, Wiley online Library, Volume74, Issue2, October 2013, Pages 222-235. [20] Raphael Yuster, "Packing Triangles in Regular Tournaments", Journal of Graph Theory, Wiley online Library, Volume74, Issue1, September 2013, Pages 58-66 [21] Peter Keevash, Benny Sudakov, "Packing triangles in a graph and its complement", Journal of Graph Theory, Wiley online Library, Volume47, Issue3, November 2004, Pages 203-216.

Volume VI, Issue I, January/2019 Page No:2952