Facility Layout using Genetic Algorithm

Siddhant Bansal
Meditab Software, Inc.
siddhant2697@gmail.com

About

This is a web page dedicated to the work done by me at Meditab Software, Inc.

Abstract

For any organization to make the maximum profit it is important to have an efficient and effective manufacturing unit. For such a unit it is necessary to give special attention to facility layout. Facility layout is defined as an effective arrangement of different manufacturing units to achieve desired production results. There are a few things that can be considered for facility layout like, total available space, time for manufacturing a single batch of product, user access points of the machine for convenient operations. An efficient layout is the one which ensures a steady and smooth flow of equipment, production material, and manpower at minimum expense.

Manually figuring out the best possible layout satisfying all the constraints can be a difficult task as there can be infinitely many ways of arranging a facility with n number of constraints. This is the reason we consider Genetic Algorithm to find the best layout for us with the given set of constraints.

1. Introduction

Layout Optimisation Problem refers to the problem of determining positions of modules in a layout for optimizing multiple constraint objectives specific to the problem statement. The discussed problem statement can be divided into two subdivisions as continuous layout optimization problem and discrete layout optimization problem. Researchers like [1], [2], [3], [4] have contributed immensely for the continuous layout optimisation problem, whereas [5], [6], [7] made numerous efforts for a discrete layout optimisation problem. Apart from mentioned categorization, there are also additional possible ways of categorizing Layout optimization problem as an equal-area problem, unequal area problem [8], Quadratic Assignment Problem (QAP) and Quadratic Set Covering Problem (QSCP) [9].

General Configurations in Facility Layout

Fig.1: Few of the many possible ways in which 4 modules can be arranged in a facility.

For solving the above-mentioned problem scenarios, a wide array of algorithms have been employed. Genetic algorithms were used by [9] for flexible manufacturing system optimisation, genetic search by [10] for unequal-area facility layout optimization, genetic programming by [11] for Geometry and sizing optimisation of the discrete structure. This problem statement has also been assessed by researchers from diverse applied engineering fields. [12] have explored the same for optimizing placement of components on the PCB using genetic algorithms. The above-mentioned methods use vectors as the representation of the modules (units to be arranged in a given space called environment). Whereas our approach uses 2D matrices as the representations of the modules and produces some good environment.

The work can be explored in two phases, first by learning about Genetic Algorithms in Section 2. Then by analyzing the environment created by us called ELOPE (Evolutionary Layout Optimization Playground and Evaluator) in Section 3.

2. Genetic Algorithm

The genetic algorithm is a type of evolutionary algorithm that tries to mimic the actual biological process in the hope of discovering good solutions which were first introduced by [13]. The genetic algorithm is analogous to Darwinian natural mutation and selection, it is a part of ‘randomized heuristics’ which does not depend on the prior knowledge of various features of the domain whereas it depends on the randomized choice of operators.

2.1 Basic flow of the algorithm

The genetic algorithm transforms a population of individual solutions repeatedly. At each iteration, the algorithm chooses some individuals randomly from the current population which acts as the parents to produce the offsprings for the coming generation. The process continues for some generations, and the population evolves toward a local or global optimal solution.

Three main steps are used in the algorithm to create the future generation from the current generation:

  1. Selection rules select the parents, that are used to create the next generation.
  2. Crossover is used to define rules of combining parents to generate children.
  3. Mutation is used to apply random changes to some of the individuals from the new generation.

Let us learn about all the above steps one by one.

2.2 Selection

First of all the fitness score of the entire population is calculated. Fitness score indicates the value of a particular individual, in our case the more the fitness score of an environment is the better it is. The population is then sorted on the fitness score. Then we use any one of the following two techniques for the selection of the parents:

  1. Here we generate a random number between the minimum and maximum score. The individuals who have the score higher than this number are taken to the next step of crossover.
  2. In this second method either 0 or 1 is generated. If 1 is generated then all the environments at even index are chosen, else the once at odd index are chosen and taken to the next step of crossover.

2.3 Crossover

Crossover is used for exploring the sample space in the Genetic Algorithm, we implement 2 different crossover strategies, they are as follows:

  1. In the most basic strategy, we choose any environment at random and take the module’s position from it for creating a new environment. If there is any conflict in creating the environment then a completely new environment is used as a child.
  2. The second strategy involves using the fitness score of the environment. The environment with a higher score is given an 80% probability of contributing to the crossover process, whereas the one with the lower score is given the remaining 20% probability.

For old population P, new population P′ is generated as P′ = C (P) where C is a crossover function.

Crossover demo

Fig.2: Crossover operation between Parent 1 and Parent 2 results in Child (a new environment).

2.4 Mutation

The mutation is used for exploiting the sample space in the Genetic Algorithm, we implement 3 different strategies in our plugin, they are as follows:

  1. Shift mutation: This strategy involves moving the module up, down, right or left by n number of blocks.
  2. Tilt mutation: This strategy involves rotating the module by 180 degrees.
  3. Rotate mutation: This strategy involves rotating the module by 90 degrees.

Mutation demo

Fig.3: Mutation operation taking a random individual and transforming the modules using various operations like shift, tilt and rotate.

2.5 Complete Algorithm

Here is the pseudo-code for implementing the Genetic Algorithm:

Input: desired fitness score, the maximum number of generations
Output: Parameter: Fitness strategy

  1. Generate Initial Population
  2. Set population score to zero
  3. Set generation number to zero
  4. while population score < desired score or generation number < maximum generations do
  5. Get sorted population, population score, and best individual score
  6. Perform selection
  7. Perform crossover
  8. Sort population
  9. Perform Mutation
  10. Increment generation number
  11. end while

The algorithm can be visualised as shown in Fig.4.

Flow diagram of Genetic Algorithm.

Fig.4: Flow of the genetic algorithm.

3. ELOPE: Evolutionary Layout Optimization Playground and Evaluator

Current ameliorations in Evolutionary Strategies have allowed us to achieve phenomenal accuracy invariants of optimization problems. However, for the layout optimization problem, there doesn’t exist a platform adept enough to challenge off-the-shelf algorithms to the fullest extent. For addressing the mentioned problem statement, we introduce Evolutionary Layout Optimization Playground and Evaluator (ELOPE), a platform for solving a large spectrum of layout optimization problems. ELOPE’s major contributions are its proposed 2D rectangular representation for the environment, multi-objective optimization, pre-defined plugins for evolutionary algorithms and visualization of the generated layouts.

3.1 About ELOPE

ELOPE, is a platform for evaluating and comparing different evolutionary algorithms for solving layout problems using evolutionary algorithms.
Major advantages of ELOPE are:

  1. ELOPE provides a scalable playground as it can be used to generate a diverse set of layout customizations for various applications.
  2. It provides a rich set of plugins that makes it easy to use for developing various functionalities on the top of it.
  3. It provides a visualisation module which can be used to visualise layouts generated by the algorithm.

ELOPE architecture information.

Fig.5: ELOPE’s architecture and interaction with the algorithm.

3.2 Architecture

The key idea for ELOPE is to avail the community with a comprehensive platform for solving the layout optimisation problems. ELOPE is written in Python to avail the implemented operations for matrix manipulation and its matured range of libraries for applied programming. This choice also caters the developers to prototype the ideas relatively faster and help direct the efforts on the algorithm than the interfaces. ELOPE stands out as a bridge between the problem statement and the algorithm employed to solve it. Fig.5 illustrates that relationship via the user-defined data-flow originating from the problem statement at hand. The interactions among the sub-modules of ELOPE and the optimization strategy of choice are also represented.

ELOPE represents the multi-floor space as a set of 3D grid boxes, which behave as the fundamental cell. Each grid box can be represented as Gx,y,z where x, y, and z where x ∈ {1,...,X}, y ∈ {1,...,Y} and z ∈ {1,...,Z}. The X, Y, and Z are the inputs derived from the application-specific configuration which denote the width, length, and the number of floors respectively for the floor space. Each grid box acquires a token value (g) from the grid token set (G). Here g ∈ G where,

where,
−2 represents blocked or unusable space
−1 represents vacant or usable space
0 represents the connections between modules
M represents module ID (explained later in this section)

3.3 Module

The physical components which are supposed to occupy the floor-space or in other words whose positions are to be optimized are addressed as module henceforth. The properties of the module (PM) for a single floor is represented as follows:

3.4 Application Specific Configuration

The information corresponding to the layout being optimised acts as an input for the ELOPE environment. This information is represented in a configuration file consisting of fields related to the physical floor-space, constraints, and specifications about the components to be placed optimally in the layout.

3.5 Constraint Enforcement

The ELOPE configuration file generates constraint enforcement which acts as an input for layout generator. Constraint enforcement can be categorized as general layout constraints and application layout constraints. Constraints are defined using the information from grid token set G. For example, general layout constraints include layouts containing non-overlapping modules, modules that should be represented within the boundary of layout whereas application-specific constraints include constraints such as user accessibility constraint, blockage constraint, and module adjacency constraint.

3.6 Plugins

ELOPE’s plugins are divided into 3 major categories:

  1. Module manipulation plugin: This set of the plugin is used to move the modules within the layout. They include:

    Shift Plugin: This plugin takes in the module id and shifts that particular module by n position in the given direction. A mathematical formulation of shift plugin is as follows: For right/left shift:

    For top/down shift:

    where,

    c, c′ represents the previous and new top left corner’s row position respectively
    d, d′ represents the previous and new top left corner’s column position respectively
    n represents the number of blocks to move

    Rotate Plugin: This plugin takes in the module id and rotates the module by 90 or 180 degrees, if and only if there is sufficient space to rotate the module.

  2. Layout manipulation plugin: This set of plugin modifies the layout as a whole. Geometric transformations applied to the layout can be included in this category.

  3. Layout assessment plugin: These plugins are used for assigning a score to the layout by assessing various parameters of the layout. ELOPE is equipped with various plugins like Euclidean distance, Manhattan distance, minimal path plugin, and minimal area plugin. What follows is a mathematical description of the minimal area and minimal path plugins.

3.7 Visualization module

The layout that is internally represented as a Numpy array is not a good way when it comes to visualizing the layout. This is the reason ELOPE comes with a visualization module for converting all the information from the Numpy array to a form that can be easily understood and visualized. Fig.6 shows the layout generated using Visualization Module.

Visualisation Module

Fig.6: The internal representation of the layout is converted to the form which is convenient for visualization. Demonstration of how the main layout looks after applying shift, delete and rotate plugin is shown.

3.8 ELOPE with Genetic Algorithm

ELOPE in Genetic Algorithm

Fig.7: The use of ELOPE to develop the genetic algorithm is demonstrated. The mapping of different strategies of genetic algorithm is shown with the corresponding modules of ELOPE used.

All these plugins of the genetic algorithm are developed using ELOPE. As shown in Fig.7, generate population is build using ELOPE’s Layout Generator, crossover and mutation is build using module and layout manipulation plugin, whereas selection and fitness strategy is developed using constraint enforcement and layout assessment plugin. This demonstrates the purpose of ELOPE in developing different algorithms.

4. Results

For getting an optimized industrial warehouse environment the algorithm was made to evolve until the desired score was achieved. In Fig.8, the tracks of the conveyor are represented between the modules. Clearly, in Fig.8 (a) the conveyor length is higher than as shown in Fig.8 (b) and also the area occupied by the modules and conveyor is reduced to a certain extent. Overall we get an optimized layout after evolving for 160 generations through the genetic algorithm.

Results!

Fig.8: (a) shows the initial layout where modules are placed randomly, (b) shows the optimized layout evolved after 160 generations, (c) represents the best layout score and (d) represents the overall generation score.

5. Conclusion

We have presented a way in which we can use ELOPE to apply the genetic algorithm for facility layout optimization. ELOPE can be elegantly used as a playground for developing, understanding and evaluating not just evolutionary algorithms but also Reinforcement Learning (RL) and other search optimization techniques. ELOPE in its future version aims to support various nuances of layout optimisation problems along with 3D visualisation modules.

6. References

  1. Kar Yan Tam and Shih Gong Li. A hierarchical approach to the facility layout problem. The International Journal of Production Research, 29(1):165–184, 1991.
  2. Drew J Van Camp, Michael W Carter, and Anthony Vannelli. A nonlinear optimization approach for solving facility layout problems. European Journal of Operational Research, 57(2):174–189, 1992.
  3. Kar Yan Tam. A simulated annealing algorithm for allocating space to manufacturing cells. The International Journal of Production Research, 30(1):63–87, 1992.
  4. Kar Yan Tam. Genetic algorithms, function optimization, and facility layout design. European Journal of Operational Research, 63(2):322–346, 1992.
  5. Gordon C Armour and Elwood S Buffa. A heuristic algorithm and simulation approach to relative location of facilities. Management Science, 9(2):294–309, 1963.
  6. Robert C Lee. Corelap-computerized relationship layout planning. J. Ind. Eng., 18(3):195–200, 1967.
  7. Tarek M Khalil. Facilities relative allocation technique (frat). International Journal of Production Research, 11(2):183–194, 1973.
  8. Kyu-Yeul Lee, Myung-Il Roh, and Hyuk- Su Jeong. An improved genetic algorithm for multi-floor facility layout problems having inner structure walls and passages. Computers & Operations Research, 32(4):879–899, 2005.
  9. Maheswaran Rajasekharan, Brett A Peters, and Taho Yang. A genetic algorithm for facility layout design in flexible manufacturing systems. International Journal of Production Research, 36(1):95–110, 1998.
  10. David M Tate* and Alice E Smith. Unequal-area facility layout by genetic search. IIE trans- actions, 27(4):465– 472, 1995.
  11. QZ Zheng, OM Querin, and DC Barton. Geometry and sizing optimisation of discrete structure using the genetic programming method. Structural and Multidisciplinary Optimization, 31(6):452–461, 2006.
  12. Fatimah Sham Ismail, Rubiyah Yusof, and Marzuki Khalid. Optimization of electronics component placement design on pcb using self organizing genetic algorithm (soga). Journal of intelligent Manufacturing, 23(3):883–895, 2012.
  13. John Henry Holland et al. Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. MIT press, 1992.