Packing Bins Using Multi-chromosomal Genetic Representation and Better-Fit Heuristic A.K. Bhatia ⋆ and S.K. Basu ⋆⋆ Department of Computer Science Banaras Hindu University Varanasi-221005, India Fax: +91-542-2368285 swapankb@bhu.ac.in Abstract. We propose a multi-chromosome genetic coding and set-based genetic operators for solving bin packing problem using genetic algorithm. A heuristic called better-fit is proposed, in which a left-out object replaces an existing ob- ject from a bin if it can fill the bin better. Performance of the genetic algorithm augmented with the better-fit heuristic has been compared with that of hybrid grouping genetic algorithm (HGGA). Our method has provided optimal solu- tions at highly reduced computational time for the benchmark uniform problem instances used. The better-fit heuristic is more effective compared to the best-fit heuristic when combined with the coding. Keywords: Genetic Algorithm, Bin Packing Problem, Heuristics. 1 Introduction We apply genetic algorithm (GA) [8] to solve bin packing problem (BPP) which is NP-hard. For a given list of objects and their sizes, BPP consists of finding a packing of the objects using the minimum number of bins of the given capacity. Many online and offline heuristics [2] such as Next-fit (NF), First-fit (FF), Best-fit (BF), First-fit- decreasing (FFD), and Best-fit-decreasing (BFD) have been devised for the BPP. Existing GAs for the BPP use single-chromosome codings. Binary coding requires a chromosome of length n ∗ q bits, where n is the number of objects and q is the upper bound on the number of bins [10]. It forms lengthy chromosomes and the operators cre- ate infeasible strings requiring use of penalty terms during fitness evaluation. In Object membership coding, objects are assigned a bin number in the range [1,q]. The oper- ators produce infeasible chromosomes and so penalty terms are used to take care of infeasibility. Object permutation coding defines the chromosomes as permutations of the object indices. It requires specialized crossover operators such as PMX, OX, CX, CI [8, 10]. It is difficult to incorporate heuristics in the coding. Grouping representation [6] constructs a chromosome in two parts. The first part consists of the object membership coding. The second part consists of the groups present in the first part. The groups are termed as the genes and the genetic operators work on ⋆ Present address: National Bureau of Animal Genetic Resources, Karnal - 132001 (India). ⋆⋆ Corresponding author. N.R. Pal et al. (Eds.): ICONIP 2004, LNCS 3316, pp. 181–186, 2004. c Springer-Verlag Berlin Heidelberg 2004