A bacteria foraging algorithm for solving integrated multi-period cell formation and subcontracting production planning in a dynamic cellular manufacturing system

The bacteria foraging algorithm (BFA) is a new computation technique inspired by the social foraging behaviour of Escherichia coli (E. coli) bacteria. Since the introduction of the BFA by Kevin M. Passino, there have been many challenges in employing this algorithm to problems other than those for which the algorithm was proposed. This research aims to apply this emerging optimisation algorithm to develop a mixed-integer programming model for designing cellular manufacturing systems (CMSs), and production planning in dynamic environments. In dynamic environments, product mix and part demand vary under multi-period planning horizons. Thus the best-designed cells for one period may not be adequate for subsequent periods, requiring their reconstruction. The advantages of the proposed model are as follows: consideration of batch inter-cell and intra-cell material handling by assuming the sequence of operations, allowing for alternative process plans for part types, and consideration of machine copying, with an emphasis on the effect of trade-offs between production and outsourcing costs. The goal is to minimise the sum of the machines constant and variable costs, inter-cell and intra-cell material handling costs, reconstruction costs, partial subcontracting costs, and inventory carrying costs. In addition, a newly-developed BFA-based optimisation algorithm has been compared with the branch and bound algorithm. The results suggest that the proposed algorithm performs better than related works.


INTRODUCTION
Cellular manufacturing is described as a manufacturing method that produces part families within a single line or cell of machines serviced by operators and or robots that work only within the line or cell.
Cell formation (CF), as the first and most important step in designing cellular manufacturing systems, includes two fundamental tasks: part-family formation, and machine-cell formation.Part-family formation groups parts with similar geometric characteristics or processing necessities to determine the benefits of their similarities for design or manufacturing purposes.Because of the growing variety of consumer goods and shorter product life cycles, manufacturing organisations often face variations in product demand and product mix, leading to a dynamic or unstable production environment [19].In dynamic production environments, a multi-period planning horizon is considered in which the product mix or the part demand rate in each period might be different -e.g., cyclical products demand.As commonly discussed in the literature, traditional CMS has many operational advantages over other manufacturing systems, such as job shop and flow shop; yet there are also some drawbacks, such as the limitation in shop flexibility and machine utilisation [19].Traditional CMS discounts any changes in demand over time from product redesign and other factors.It assumes that product mix and part demand are constant for the entire planning horizon.Product mix passes on a set of part types to be produced in each period.In a dynamic environment, a planning horizon can be separated into smaller periods, where each has different product mix and demand requirements.Accordingly, the formed cells in a particular period may not be optimal or efficient for the next period.
To overcome the drawbacks of traditional CMS, the concept of the dynamic cellular manufacturing system (DCMS) has been introduced [19].DCMS involves the reconstruction of manufacturing cells, including part families and machine groups in each period.Reconstruction entails the substitution of existing machines between cells, called 'machine replacement'; adding new machines to cells, or 'machine copying'; and removing existing machines from cells.Recently, the advancing computational practice of swarm intelligence has promised solutions to many engineering and financial problems.It has been found to be a powerful method in domains where analytical solutions have not been very effective.
The Bacterial Foraging Optimisation (BFO), invented by Passino [18], is one such evolutionary computational approach.It is inspired by the foraging behaviour of Escherichia coli bacteria in human intestines.According to this approach, foraging is seen as an optimisation process: the bacterium strives to maximise the energy gained per unit of foraging time.The BFO has been successfully applied to various real-world problems, such as harmonic estimation by Mishra [15], transmission loss reduction by Tripathy et al. [26], active power filter for load compensation by Mishra & Bhende [16], power network by Tripathy & Mishra [25], load forecasting by Ulagammai et al. [27], independent component analysis by Acharya et al. [1], identification of nonlinear dynamic systems by Majhi & Panda [11,12] and Panda et al. [17], stock market prediction by Majhi et al. [14], and adaptive channel equalisation by Majhi et al. [13].
In this paper, the bacteria foraging algorithm (BFA), which is a kind of metaheuristic algorithm, is proposed for minimising the sum of the machine constant and variable costs, inter-cell and intra-cell material handling, reconstruction costs, inventory costs, back order costs, and subcontracting costs in dynamic machine cell formation problems.This paper is organised as follows: Section 2 introduces the literature review.Section 3 presents the proposed dynamic cell formation model.Section 4 overviews the optimisation of bacterial foraging and presents the proposed bacterial foraging algorithm.Computational experiences, with a number of test problems drawn from the literature, are shown in Section 5. Section 6 summarises the findings and draws conclusions.

LITERATURE REVIEW
The idea of the dynamic cellular manufacturing system (DCMS) was introduced by Rheault [19].Seifoddin & Djassemi [23] introduced a simple dynamic part assignment (DPA) procedure and evaluated its effects on the performance of cellular manufacturing systems.In this procedure, rerouting of parts among machine cells is permitted for better use of machines.Baykasogylu & Gindy [4] developed a simulated annealing-based procedure for dynamic layout.Tavakkoli-Moghaddam et al. [24] discussed solving a cell formation (CF) problem in dynamic conditions by applying some traditional meta-heuristic methods such as the genetic algorithm, SA, and tabu search.
Jeon & Leep [9] developed a methodology that can be used to form manufacturing cells, applying both a new similarity coefficient based on the number of alternative routes during machine failure, and demand changes for multiple periods.The methodology is divided into two phases.A new similarity coefficient, which takes into account the number of available alternative routes during machine failure, is suggested in Phase I.A new methodology for cell formation, which considers the scheduling and operational aspects in cell design under demand changes, is begun in Phase II.
Defersha & Chen [6] proposed a comprehensive mathematical model for the design of CMS, based on the tooling requirements of the parts and the tooling available on the machines.The model integrates dynamic cell configuration, alternative routings, lot splitting, sequence of operations, multiple units of identical machines, machine capacity, workload balancing among cells, operation cost, cost of subcontracting part processing, tool consumption cost, setup cost, cell size limits, and machine adjacency constraints.
Defersha & Chen [7] developed a mathematical programming model following an integrated approach to cell configuration and lot sizing in a dynamic manufacturing environment.The model development also takes into account the impact of lot sizes on product quality.The solution of the mathematical model is to minimise both production and quality-related costs.
Boulif & Atif [5] studied manufacturing cell formation, considering the dynamic behaviour of the production system.First, they discussed the importance of considering the dynamic aspect of the problem, which has been insufficiently studied in the related literature.They further argued that, by considering a multi-periodic planning horizon, the problem can be resolved according to two strategies: passive and active.
Safaei et al. [20] developed a mixed-integer programming model to design the cellular manufacturing systems (CMSs) under dynamic environments.The advantages of the proposed model are that it takes into account the batch inter-cell and intra-cell material handling by assuming the sequence of operations; and it considers alternative process plans for part types, as well as machine copying.The major constraints are maximum cell size and machine time-capacity.The aim is to minimise the sum of the machine constant and variable costs, inter-cell and intra-cell material handling, and reconstruction costs.An efficient hybrid meta-heuristic method, based on mean field annealing and simulated annealing (MFA-SA), is applied to solve the proposed model.In this case, the MFA technique is used to generate a good initial solution for SA.Safaei et al. [21] presented an integration of explicit uncertainty for a cell formation problem (CFP) with a dynamic condition in cellular manufacturing systems (CMS).A fuzzy approach was developed to solve an extended mixed-integer programming model of the dynamic CFP, in which piecewise fuzzy numbers are coefficients in the objective function and the technological matrix.The method is proposed to find out the optimal cell configuration in each period, with the optimal achievement of fuzzy objectives under the given constraints.
Safaei et al. [22] proposed an integrated mathematical model of multi-period cell formation and production planning in a dynamic cellular manufacturing system (DCMS) with the aim of minimising machines' inter-cell and intra-cell travelling costs, reconstruction, partial subcontracting, and inventory carrying costs.Emphasis is placed on the effect of the trade-off between production and outsourcing costs on the re-configuration of the cells in cellular manufacturing systems (CMSs) in a dynamic environment.
Bajestani et al. [3] presented a multi-objective dynamic cell formation problem, where the total cell load variation and sum of the miscellaneous costs -i.e., machine cost, inter-cell material handling cost, and machine replacement cost -are minimised concurrently, and a new multi-objective scatter search (MOSS) is designed for finding the local Pareto-optimal frontier.
Ah Kioon [2] presented and analysed a comprehensive model for the design of cellular manufacturing systems.A recurring theme in the research is a gradual approach when formulating CMS models.The proposed model is comprehensive, with a more integrated approach to CMS design, where production planning and system reconstruction decisions are integrated.
Deljoo et al. [8] discussed solving a cell formation problem in dynamic conditions using the genetic algorithm (GA).Some errors related to model formulation were discussed, while a new improved formulation for dynamic cell formation (DCF) problem was presented.
Mahdavi et al. [10] presented an integer mathematical programming model for the design of cellular manufacturing systems in a dynamic environment.The benefits of the proposed model are as follows: consideration of multi-period production planning, dynamic system reconstruction, duplicate machines, machine capacity, available time of workers, and worker assignment.The intention of the proposed model is to minimise holding and backorder costs, inter-cell material handling costs, machine and reconstruction costs, and hiring, firing, and salary costs.
As a general rule, incorporation of the theories of CMS design and PP is meant to be basic to the modelling and simulation of the real production environments.In fact, variations in product mix, volume, and introduction of new products are the key aspects that validate the incorporation of the CMS and PP.The research in this paper refers to the model of Safaei [22].The purpose of a typical PP problem is to minimise total production-related costs such as variable production, inventory, and shortage costs, over a fixed planning horizon [22].The main constraints of PP problem areas go beyond: 1) the inventory balance equation for balancing the inventory and/or shortages with those from the previous period, production quantity, and demand quantity; 2) capacity constraints that ensure that the total workload for each supply (labour, machines, etc.) does not exceed the capacity in each period [22].Because of the dynamic environment of PP problems, the incorporation of CMS and PP makes problems very complex and difficult to compute.The reason is that the cell rearrangement is the vital operational feature of the CMS design in the dynamic environment, all of which must be considered in a real incorporated model [22].
Meta-heuristics methods, including Genetic Algorithm (GA), Simulated Annealing (SA), Tabu Search (TS), Ants Colony Systems (ACS), Particle Swarm Optimisation (PSO), and Bee Swarm Optimisation (BSO), are popular algorithms for solving cell formation problems using MPIM (Machine Part Incidence Matrix).Therefore it is believed that the opportunity exists for a wide range of research into the application of meta-heuristic techniques on cell formation, by considering real-life production factors and the effects of meta-heuristic tools' parameters that are set up to provide guidelines for users.As a consequence, it is advisable to examine the performance of meta-heuristic models using real-value matrices.This research initiates the application of a bacteria foraging algorithm in dynamic cell formation.The model has been tested using a wide variety of problems reported in the literature, and has been found to produce consistently good results.The major purpose of this work is to develop a simple yet efficient methodology that is capable of producing quick solutions for shop floor managers with minimal computational efforts.

PROBLEM FORMULATION
In this section a new mixed-integer programming model of integrated DCMS and production process planning is formulated under the following assumptions [22].

Assumptions
1) Each part type has a number of operations that should be processed respectively as numbered.
2) The processing time for all operations of a part type on different machine types is known and determined.
3) The demand for each part type in each period is acknowledged and determined.4) The abilities and time-capacity of each machine type are known and constant over the planning horizon.5) The constant cost of each machine type is recognised.The constant cost is independent of the workload allocated to the machine, and entails rent or overall service costs.This cost is considered for each machine in each cell and period, whether the machine is active or idle.6) The variable cost of each machine type is recognised.Variable cost entails an operating cost that is dependent on the workload allocated to the machine.7) The replacement cost of each machine type from one cell to another between periods is recognised.All machine types can be moved to any cell.Replacement cost is the sum of uninstalling, shifting, and installing costs, where installing and uninstalling costs are supposed to be the same.Note that, if a new machine is added to the system, we have only an installing cost.On the other hand, if a machine is removed from the system, we have only an uninstalling cost.Thus we assume that the unit cost of adding a new machine or removing a current machine is half of the replacement cost [22].8) Parts are moved between and within cells as batches.As mentioned earlier, inter-and intra-cell batches have different costs and sizes.To reduce complexity, unit inter-and intra-cell travelling costs are constant for all moves, regardless of the distance travelled.In other words, we suppose that the distance between cells is the same, the distance between machines in each cell is the same, and also all machine types have the same dimensions [22].9) The maximum number of cells formed in each period is specified beforehand.10) The maximum cell size is known beforehand.A lower limit is not considered for the cell size, because we suppose that smaller cells are preferable.11) All machine types are supposed to be multipurpose.Thus, each machine type can carry out one or more operations without incurring a modification cost.Likewise, each operation-part can be carried out on different machine types with different processing times.12) Holding and backorders inventories are allowed between periods with known costs.Thus the demand for a part in a given period can be satisfied in the preceding or succeeding periods.13) Partial subcontracting is allowed.This means that all or only a part of the demand of the part types can be subcontracted in each period.Also, the time-gap between releasing and receiving orders -the lead time -is known in advance.

Indices
(ℎ−1) +  ℎ The objective function given in Eq. ( 1) is to minimise the total sum of the machine constant and variable costs, inter-cell and intra-cell travelling cost, reconstruction cost, inventory cost, backorder cost, and subcontracting costs over the planning period.The first term represents the constant cost of all machines needed in all cells over the planning period.This cost is attained by the product of the number of machine type m allocated to cell c in period h and their associated costs.This term does not allow for extra machine copying, and forces the model to achieve maximum machine exploitation.The second term is the variable cost of all machines needed in all cells over the planning period.It is the sum of the product of the time-workload assigned to each machine type in each cell and their associated cost.This term balances the workload assigned to machines at each cell [20].It should be remembered that each machine type with low (or high) constant cost does not necessarily have a low (or high) variable cost, and vice versa.Thus there is a deal between the first and second terms of the objective function, with the remaining terms of the objective function for choosing the machines with high capability and low relatively cost.
In general, the proposed model picks a machine type based on four criteria: constant cost, variable cost, processing capabilities, and capacity [20].The third term computes the total inter-cell material handling cost.It is the sum of the product of the number of inter-cell transfers (i.e.,  ℎ/    ) resulting from both the consecutive operation of each part type and the cost of moving an inter-cell batch of each part type (  ).Likewise, the fourth term of the objective function calculates the total intra-cell material handling cost.It is the sum of the number of the product of intra-cell transfers (i.e.,  ℎ/    ) resulting from both the consecutive operation of each part type and the cost of moving an intra-cell batch of each part type (  ).The sequence of operations directly affects the inter-and intracell moving costs [20].If two consecutive operations of a part type that must be processed are assigned to different cells, then the system will acquire a unit inter-cell moving cost (  ).Conversely, if two consecutive operations of a part type are allocated to the same cell but to different machines, then the system will acquire a unit intra-cell moving cost (  ).From the modelling approach, if two consecutive operations j and j+1 of part p cause inter-or intra-cell moving in period h, then,  ℎ = ∑ � (+1)ℎ −  ℎ � = 1  =1 . On the other hand, if two consecutive operations j and j+1 of part p cause only inter-cell moving in period h, then,  ℎ = �∑  (+1)ℎ − ∑  ℎ  =1  =1 �.Consequently, if  ℎ −  ℎ = 1 , then intra-cell moving will be encountered [20].
Inter-cell and intra-cell moving costs are computed with respect to the third and fourth terms of the objective function.The coefficient 1/2 in the third and fourth terms is implanted because each inter-and intra-cell movement has been calculated twice, since moving from a cell or a machine corresponds to moving towards another cell or machine.
The fifth term of the objective function computes the reconstruction cost in a dynamic environment.This term is the sum of the number of products of relocated, added, and/or eliminated machines, and their associated costs.The coefficient 1/2 in this term is implanted because each replacement is considered twice in computations [20].
The last three terms are related to the total sum of the PP costs, including inventory carrying, backorder incurring, and subcontracting costs.The first term is the sum of the product of the inventory level for each part type at the end of the given period, and related cost.Similarly, the second term is the sum of the product of the backorder shortage level for each part type at the end of the given period, and related cost.The third term is the sum of the product of the number of the subcontracted parts and related cost [22].
Eq. ( 2) ensures that each part operation is assigned to one machine and one cell in each period.Eq. (3) guarantees that machine capacities are not exceeded, and thus satisfy the demand.Also, this equation determines the required number of each machine type in each cell, to avoid machine duplication.Inequality (4) makes certain that the maximum cell size is not violated.Eq. ( 5) is named 'balance constraint', and ensures that the number of machines in the current period is equal to the number of machines in the previous period, plus the number of machines being moved in, minus the number of machines being moved out.On the other hand, it ensures the conserving of machines over the time period, and remembers the available machine types in each period.
The last term of the objective function and combination constraint (6) sets up a connection between periods [20].Eq. ( 6) points out the balance inventory constraint between periods for each part type in each period.It denotes that the inventory level of each part at the end of each period is equal to the inventory level of the part at the end of the previous period, plus the quantity of production and quantity of subcontracting, minus the part demand rate in the current period.Eq. ( 7) finds out the inventory and backorder level of each part type in each period.Clearly, the total demand for all part types over the planning period must be fulfilled during the planning period.As a result, the inventory and backorder level of all part types in the last period must be zero [22].
Eq. ( 8) balances Eq. ( 2), guaranteeing that a portion of the part demand can be produced at the given period if its operations are allocated in the first constraint given in Eq. (2).Eq. ( 5), Eq. ( 6), and Eq. ( 7) establish a connection between periods.By removing these equations, the model will be fully decomposed into sub-problems corresponding to different periods [22].This decomposition approach can be used to obtain a lower boundary for the objective function value.By removing the last three terms of Eq. ( 1), and relaxing from the demands of Eqs. ( 6) -( 9), the basic DCMS model of Safaei et al. [20] can be obtained without considering outsourcing.Linearisation of the proposed model is explained fully in [22].By reconstructing Eq. ( 3) and ( 5

BFO operators
The survival of a species in any natural evolutionary process depends on its fitness criteria, which in turn rely on its food searching and motile behaviour.The law of evolution supports those species that have a better food searching ability, and either eliminates or reshapes those with a poor search ability.The genes of those species that are stronger propagate in the evolutionary chain, since they possess the ability to reproduce even better species in future generations.In the light of this, a clear understanding and modelling of the foraging behaviour in any evolutionary species is critical to its successful application in any nonlinear system optimisation algorithm.The foraging strategy of Escherichia coli bacteria in human intestines can be explained by four processes: chemo taxis, swarming, reproduction, and elimination-dispersal [18].
The characteristics of bacteria travelling in search of food are defined in two ways: swimming and tumbling, referred to together as 'chemo taxis'.A bacterium is said to be 'swimming' if it travels in a predefined direction, and 'tumbling' if moving in an altogether different direction.Mathematically, the tumble of any bacterium can be described by a unit length of random direction φ(j) multiplied by the step length of that bacterium C(i).In the case of swimming, this random length is predefined [18].
For the bacteria to reach the richest food location (i.e., for the algorithm to converge at the solution point), it is desired that the optimum bacterium, until a point of time in the search period, tries to attract other bacteria so that they converge together at the desired location (solution point) more rapidly [18].Achieving this entails a penalty function based upon the relative distances of each bacterium from the fittest bacterium until that search duration is added to the original cost function.Eventually this penalty function becomes zero when all the bacteria have merged into the solution point.The purpose of swarming is to make the bacteria congregate into groups and travel as concentric units of high density [18].Since a cell-to-cell attraction calculation is needed for all bacteria in swarming, swarming increases the computational time of algorithm execution, while it only slightly enhances the performance of the BFO algorithm.Thus swarming has not been considered in the proposed algorithm.
After evolving through several chemo tactic stages, the original set of bacteria reaches the reproduction stage.Here the best set of bacteria (selected from all of the chemo tactic stages) is divided into two groups.The healthier group of bacteria replaces the other group, which is eliminated due to its poorer foraging abilities.This effects a constant population of bacteria in the evolutionary process [18].After Nc chemo tactic steps, a reproduction step is taken.Let Nre be the number of reproduction steps to be taken.To expedite the convergence of the proposed algorithm, it is assumed that only 1/5 of bacteria reproduce.Let be the number of population members that have had sufficient nutrients to reproduce with no mutations.For reproduction, the population is sorted in the order of ascending accumulated cost.A higher accumulated cost means that a bacterium has not received many nutrients during its lifetime of foraging, and hence is not 'healthy' enough, making it unlikely to reproduce.Accordingly, the  −   least healthy bacteria die and the other   healthier bacteria are each copied into four places at the same location as their parents (S-Sr) bacteria had been copied.This method rewards bacteria that have encountered a lot of nutrients, and allows for a constant population size, which is convenient for coding the algorithm.
In the evolutionary process, any sudden unexpected event can occur that may drastically alter a smooth evolution, thus ultimately leading to the elimination of the set of bacteria and/or their dispersal into a new environment.Ironically, instead of disturbing the usual chemo tactic growth of the set of bacteria, this unknown event may place a newer set of bacteria nearer to the food location [18].
From a wide perspective, elimination and dispersal are parts of the population level's longdistance motion behaviour [18].In its application to optimisation, it helps to reduce the behaviour of stagnation (i.e., trapping bacteria in a premature solution point or local optima) that is quite often encountered in such parallel search algorithms [18].Let Ned be the number of elimination-dispersal events.In any elimination and dispersal event, every bacterium in the population is considered with probability ped to experience elimination and dispersal.

Problem-solving representation schema
To determine the solution representation schema, the two matrices  ℎ  , and  ℎ  have been used during each period, as shown in To generate neighborhood solutions, four heuristic operators have been used with respect to the proposed structure, shown in Figure 1, as follows:

Local-mutation on [X] matrix:
To implement this operator, an operation of a part in a period (e.g., operation j of part p in period h) is randomly selected and then randomly allocated to another machine as  ℎ  →  ℎ′  where  ℎ  ≠  ℎ′    ℎ′  ∈   .

Local-mutation on [Y] matrix:
To implement this operator, an operation of a part in a period (e.g., operation j of part p in period h) is randomly selected and then randomly allocated to another cell as  ℎ  →  ℎ′  where  ℎ′  ≠  ℎ  and1 ≤  ℎ′  ≤ .

Global-mutation on [X] matrix:
To implement this operator, a period (e.g., period h of part p) is randomly selected and then all its operations in this period are randomly allocated to other machines as  ℎ  →  ℎ′ ′ ∀ where  ℎ  ≠  ℎ′ ′ and ℎ′ ′ ∈   ∀ .

Global-mutation on [Y] matrix:
To implement this operator, a period (e.g., period h of part p) is randomly selected and then all its operations in this period are randomly allocated to the random cell as  ℎ  →  ℎ′ ′ ∀ where  ℎ  ≠  ℎ′ ′ and 1 ≤  ℎ′ ′ ≤  ∀ .These four operators are experimental and can be used with the same rate, but the system designer can tune this operator's applying rate to accelerate the convergence of the algorithm.In other words, when the tuning of the operators is changed, a significant improvement cannot be seen in the performance of BFA.After the implementation of each operator, the value of the decision variable  ℎ must be updated with respect to the entries of matrices [X] and [Y].This is done by using Eq. ( 10) and then the decision variables  ℎ + and  ℎ − are updated using Eq.(11).
If the intention is to find the minimum of Z (θ), θ€  , where the gradient Z (θ) cannot be measured or analytically described, then the bacterial foraging algorithm is employed to solve such a non-gradient optimisation problem.First, suppose that θ is the position of a bacterium and Z(θ) represents the combined effects of attractants and repellants from the environment with, for example, Z(θ) < 0, Z(θ) = 0, and Z(θ) > 0 representing the bacterium location in nutrient-rich, neutral, and noxious environments respectively.Basically, chemo taxis is a foraging behaviour that implements a type of optimisation where bacteria tend to climb up the nutrient concentration (i.e., find lower and lower values of Z (θ)), avoid noxious substances, and search for ways out of neutral media (avoid being at positions θ where Z (θ) ≥ 0).They implement a type of biased random walk [18].
Define a chemo tactic step to be a tumble followed by a tumble or a tumble followed by a run.Let t be the index for the chemo tactic step.Let k be the index for the reproduction step.Let l be the index for the elimination-dispersal event.Let represent the position of each member in the population of the S bacteria at the  ℎ chemo tactic step, kth reproduction step, and l the elimination-dispersal event.Also let Z(i, t,k,l ) denote the cost at the location of the  ℎ bacterium   ( t,k,l ) €  (we may drop the indices and refer to the  ℎ bacterium position as   ).Note that we shall interchangeably refer to Z as being a 'cost' (using terminology from optimisation theory) and as being a nutrient surface (in reference to the biological connections) [18].Let Nc be the length of the lifetime of the bacteria as measured by the number of chemo tactic steps they take during their life.The algorithm in Figure 2 represents the tumbling process.If at   (t+1,k,l) the cost Z(i , t+1,k,l ) is better (lower) than at   (t,k,l), then another step of swimming in the same direction will be taken; and again, if that step results in a position with a lower cost value than that of the previous step, another step will be taken.
The swimming continues as long as the cost reduces.However, this process is limited to a maximum number of steps, Ns.This means that the cell will tend to keep moving as long as it is heading in the direction of increasingly favourable environments.The algorithm in Figure 3 describes the swimming process:   From the viewpoint of factory management, satisfaction of constraint ( 4) is most critical.Therefore, for the changing solution representation schema, the application of a repairing programme is needed.The subroutine shown in Figure 5 is designed to solve this problem.Accordingly, when the algorithm reaches the final solution, it modifies the solution and tries to reallocate machines that occupy more than the maximum cell size to other cells that have fewer machines than their cell size constraint.
this summing up leads to: This relationship can be used to determine the solution representation schema for process planning parameters (  ℎ and  ℎ ), considering the following definition: Following this routine,   of part  at all periods is randomly selected from the summation of   and   (   +   ), and after that, each  ℎ at any period for each part is selected randomly from random part of   and then reduced from   of part  at all periods.Likewise,  ℎ of part  at any period is selected randomly from random part of   and then reduced from   of part p at all periods.Therefore the procedure shown in Figure 6 is proposed to determine  ℎ and  ℎ at each period for all parts: Step Step 4:  (ℎ−1) =  ℎ −  ℎ −  (ℎ−1) +  ℎ ,   =0 ∀, ℎ Step 5:  ℎ + =  ℎ   ℎ > 0 ℎ 0, ∀, ℎ Step 6:  ℎ − = − ℎ   ℎ < 0 ℎ 0, ∀,h For tumbling and swimming, the local mutation operation has been applied on [] ×ℎ and the [] ×ℎ matrix.To implement this operator, a part is randomly selected, and then its   amount is randomly selected, and therefore, as shown in Figure 6, all new  ℎ and  ℎ amounts are generated as  ℎ →  ℎ′ ,  ℎ →  ℎ′ ∀ℎ where p is not equal to the part that was selected in the previous tumbling or swimming to avoid local minima.
To construct cells and plan production concurrently, initially matrices [] ×ℎ and [] ×ℎ are formed.Then, based on the obtained  ℎ , the cells are formed simultaneously.This routine is followed in all tumbling and swimming steps in such a way that first  ℎ and  ℎ are determined, and then,  ℎ  and  ℎ  are created.Likewise, to choose the chemo taxis representation, the probability   is considered so that, if   > , then doing chemo taxing of  ℎ and  ℎ , otherwise, doing chemo taxing for  ℎ  and  ℎ  .The proposed bacteria foraging algorithm to solve the proposed mathematical model is shown in Figure 7.

COMPUTATIONAL RESULTS
In this study, an efficient algorithm based on the bacteria foraging phenomenon is proposed to solve the integrated dynamic cell formation and process planning problem.The algorithm has been coded in PC MATLAB and tested on a Pentium 4 machine T3400 2GHz with 1 GB RAM.The number of bacteria and number of reproduction steps in the population varied from problem to problem within the range of 5 to 25 and 10 to 1000, respectively.In contrast, the number of chemo tactic steps per bacteria lifetime, the limits of the length of a swim, and the number of elimination-dispersal events based on some designed experiments were fixed at 2, 10, and 5, respectively.These parameters may vary, depending on the decision maker who adjusts the algorithm.
The aim of this section is to verify the applicability of the proposed model through hypothetical examples with randomly-generated data.These examples are solved by the branch and bound (B&B) method using Lingo 8.0 software.They are generated according to the information provided in Table 1.In this table, the term 'U' indicates uniform distribution [20,21].
The instance 1-related data set is shown in Table 2. Instance 1 consists of five part types, five machine types, and three periods in which each part type is assumed to have three operations that must be processed respectively.Each operation can be performed on two alternative machines.Thus each part type has 2×3=6 process plans, and there are 6 8 combinations to select a process plan for each part type in each period.Therefore there are about ([6 + 3] 5 ) 3 = 9 15 combinations (because H=3) for allocating operation-parts to machines throughout the planning horizon [20,22].
First, the four columns of Table 2 (included at the end of this paper) include the machine information: capacity, constant cost, variable cost, and replacement cost.The quantity of demand for each part type, and the product mix for each period, are given in Table 2.The last rows of Table 2 show the inter-and intra-cell batch size, inventory and backorder costs, and the initial inventory for each part type.After linearisation, the proposed model consists of 1,125 integer variables, 1,575 non-integer variables, and 1,383 constraints in the example under consideration.The best solution was found after 29 seconds (Zbest) in detail, and the cell configurations for all periods corresponding to the best obtained solution from BFO for this instance are reported in Table 3 and shown in Figure 8.
In order to verify the performance of the BFO approach compared with B&B, 10 random instances have been solved according to Table 4.For simplicity, it is assumed that the capacities of the machines are independent of their types, but dependent on the length of the planning horizon [20].
Each problem is allowed to run on Lingo for 10,800 seconds (3 hours).However, because of the computational complexity, the proposed model could not be optimally solved within 10,800 seconds, or even over a longer time for medium-and large-sized instances.Thus, to solve the small-and medium-sized problems whose runtime was more than three hours, the software was interrupted after 3 hours and the best solution at that time was reported.Table 4 shows the comparison between the results obtained using B&B and the proposed BFO, corresponding to 10 small-and medium-sized problems in terms of computational time and the best solution obtained.To verify the performance of the proposed BFO algorithm, each problem has been run 20 times.The average CPU runtime and best solution obtained for each problem are reported in Table 4.As shown in Table 4, the proposed BFO algorithm solved problems in 8% (861/10,440) of the computational time of B&B, while qualified solutions show a 6% improvement -i.e., (497823 − 467743)/ 497823.

Table 4: Performance of the proposed BFO compared with B&B in term of approximately the same cost function
If the reproduction steps of BFO are relaxed until they reach the best solutions, then the results in Table 5 can be obtained for all mentioned data sets.As shown in this table, for all data sets, BFO obtained the best results in terms of the amount of cost function and computational time.Standard deviation in terms of the amount of cost function and computational time has been shown.Because of the one tailed p-values used in all instances, in terms of the resulting population, the mean difference between B&B and BFO is equal to zero.Therefore the statistical tests signify a better performance by the BFO algorithm in terms of the amount of the cost function and the computational time, compared with the B&B method.

Table 5: Performance of the proposed BFO compared with B&B in term of finding the minimum cost function
Table 6 shows the details of statistical test results obtained from the MINITAB software for data set 1 (smallest instance) and data set 10 (largest instance).
Finally, the data set 1 of size 5 × 5 × 3 is taken as an example to illustrate the convergence curve of the proposed BFO during reproduction steps.After 35 reproduction steps, the objective value Z is to be 160,000.It is reduced when the number of reproduction steps

Figure 5 .Figure 1 :
Figure 1: Solution representation schema in each period h

Figure 3 :
Figure 3: Pseudo-code of the swimming processTo satisfy the definition of  ℎ (= 1 if operation j of part type p is done on machine type m in cell c in period h) and constraint (2), the following subroutine is introduced (Figure4).As indicated in the subroutine, if operation j of part p during period h to cell c ( ℎ  = ) and machine m ( ℎ  = ) is assigned and   =1 then  ℎ = 1 else  ℎ = 0.

Figure 6 :
Figure 6: Production planning data initialisation procedure pseudo-code