The Economic Production Quantity (EPQ) model can be considered as an extension to the well-known Economic Order Quantity (EOQ) model, and it is a technique to find out optimum production quantity by considering costs of procurement, inventory holding, and shortage. As the first assumptions of the EPQ model may not be valid for many real-life conditions, many researchers have developed EOQ and EPQ models. In real-life manufacturing systems, generation of defective items is inevitable. Hence, many researchers consider producing defective items in EOQ and EPQ models. For instance, Hayek and Salameh (2001) assumed that all of the defective items produced are repairable and derived an optimal operating policy for the EPQ model. The basic assumptions of this model are allowing backorders; all of the defective items are reworked and become perfect quality. They also consider rework time in their model. Rosenblatt and Lee (1986) proposed an EPQ model for a production system which contains defective production. The basic assumption in their model is that the production system produces 100% non-defective products from the starting point of production until a time point which is a random variable. At this time point, the system becomes out of control and starts to produce defective items with a percentage of production until the end of production period. Also, they assumed that the distribution of time passes is exponential until the system gets out of control. Kim and Hong (1999) extended Rosenblatt and Lee's model with the assumption that the time passes are arbitrarily distributed until the system gets out of control. Salameh and Jaber (2000) developed an EPQ model for circumstances where a fraction of the ordered lot is of imperfect quality and has a uniform distribution. Their model assumed that shortage is not permitted. Chiu et al. (2007) presented a procedure to determine the optimal run time for an EPQ model with scrap, rework, and stochastic machine breakdowns. In real-life manufacturing systems, generation of defective items and random breakdown of production equipment are inevitable.

Hou (2007) presented an EPQ model with imperfect production processes, in which the setup cost and process quality are functions of capital expenditure. This model illustrates the relationship among production run length, setup reduction, and process quality improvement in an imperfect production system. He showed that investment in setup reduction leads to reduction in optimal production run length and reduces lot size, whereas investment in process quality improvement leads to an increase in optimal production run length and increases lot size. At the end, he proposed that it is very important to investigate the optimal allocation of investment between both options. In several cases, producing new or transforming defective products takes place on a common facility. Consequently, it is necessary to coordinate the production and rework activities with respect to the timing of operations and with regard to the appropriate lot sizes for both processes. Buscher and Lindner (2007) presented a lot size model which addresses all of these aspects. In addition, they cited that it is very important how completed units are assigned at one stage to partial lots - called batches - for shipment to the next operation.

Liao et al. (2009) studied maintenance and production programs with the EPQ model for an imperfect process involving a deteriorating production system with increasing hazard rate. The imperfect repair restores the system to an operating state but leaves its failure until perfect preventive maintenance (PM) is performed. They introduced two types of PM, namely imperfect and perfect PM. The probability that perfect PM is performed depends on the number of imperfect maintenance operations performed since the last renewal cycle. In addition, they represent that if the PM rate is estimated based on the actual data, analysts can use the learning curves to project the PM costs in the integrated EPQ model.

One of the most important aspects of the extension of EOQ and EPQ models is to fuzzify their parameters. For instance, in the research of Lee and Yao (1998), they fuzzified demand and production quantity to solve economic production quantity per cycle.

In this paper, we develop the EPQ model by assuming that each produced lot contains some imperfect items and scraps. In addition, we have more than one kind of products along with warehouse space limitations. Under these conditions, we formulate the problem as a nonlinear programming model and propose a genetic algorithm to solve it. At the end, we present a numerical example to illustrate the applications of the proposed methodology and identify the optimal value of the parameters of the genetic algorithm.

The remainder of the paper is as follows: in ‘Problem definition’ and ‘Problem modeling’ sections (Method), the definition and the modeling of the problem are presented, respectively, followed by a genetic approach in ‘The solution algorithm’ section to solve the model. In the ‘A numerical example’ section, a numerical example to demonstrate the application of proposed algorithms is presented. Finally, in the ‘Conclusions’ section, the paper wraps up with the conclusion and some recommendations for future research.


Problem definition

In this paper, we assume that a production company produces multi-products that receive raw materials from a supplier. All produced items are inspected, and the time of inspection is zero. After inspection, there are three types of products. The first type is perfect products, the second is defective but repairable items, and the third is defective and not repairable products. The second and third types are called imperfect and scrap, respectively. After separation of all products, the imperfect products are reworked and changed to perfect products. We assume that all imperfect products after reworking are changed to perfect products, and we sell scraps with reduced cost. We have three types of materials near the machine: (1) raw materials, (2) perfect products, and (3) reduced-cost products, all of which are called work in process (WIP) inventory. Other conditions are as follows:

  1. (a)

    There are n kinds of products.

  2. (b)

    The warehouse space of the company for all products is limited.

  3. (c)

    Shortage and delay are not allowed.

  4. (d)

    All parameters, such as demand rate, rate of imperfect and scrap items, and setup cost, are known and deterministic.

Under these conditions, we want to determine the optimal production quantity that minimizes total costs and satisfies the constraint, too, and we prove that the revenue of the inventory system does not depend on the lot size.

Problem modeling

For modeling, we have to extend the classical EPQ model with regard to the conditions of the problem. We note that in this problem, we have limited warehouse space and three types of products: perfect, imperfect, and scrap. In this section, at first, we define the parameters in the ‘Parameters and notations’ section. Then, we pictorially demonstrate the situation using an inventory graph in the ‘Inventory graph’ section. In the ‘Costs calculations’ section, we derived the different costs, and finally, we present the model of the problem in the ‘Problem formulation’ section.

Parameters and notations

For i = 1,…, n, we define the parameters of the model as follows:

n the number of products

Q i order quantity for product i

P i production rate for product i

D i demand rate for product i

A i setup cost for each cycle for product i

h i rate of holding cost for product i

M i price of one raw material for product i

S i setup time for product i

m i time of machining for product i

R i rate of production cost in unit time for product i

c i average of cost for producing any unit of product i

v i average of value added for product i

W ¯ i

average of invest value of work in process inventory for product i

Ī i average of inventory in warehouse for product i

p1ipercent of imperfect items for product i

p2ipercent of scrap items for product i

s1iprice of perfect products for product i

s2iprice of scrap items for product is

T i cycle time for product i

TP i sum of setup and production time in each cycle time for product i

t i average time of production for any unit of product i

f i required space for perfect product for product i

F total space of warehouse for all products

TCPitotal procurement cost for product i

TCOitotal setup cost for product i

TCIitotal inspection cost for product i

TCWIPitotal holding cost for work in process inventory for product i

TCHitotal holding cost for perfect products in warehouse for product i

TCtotal annual cost for all products

Inventory graph

In order to calculate all of the inventory's costs, it is necessary to survey the work in process and the warehouse inventory. For the problem at hand, the graph of quantity of raw materials in terms of time is demonstrated in Figure 1a. In addition, the graphs of perfect and scrap of work in process inventory in terms of time are shown in Figure 1b,c, respectively. In this problem, the rate of demand is constant, and then the graph of the quantity of final products in the warehouse is similar to the EOQ model which is illustrated in Figure 1d; it is obvious that only perfect products are delivered to the warehouse.

Figure 1
figure 1

Inventory graphs in terms of time: (a) raw material, (b) perfect products, (c) scrap items, and (d) product in the warehouse.

Cost calculations

In this model, shortage and delay are not permitted. Hence, total cost of all products per year (TC) is the sum of total providence cost (TCP), total setup cost (TCO), total inspection cost (TCI), total holding cost for work in process inventory (TCWIP), and total holding cost for inventory in the warehouse (TCH) for all products. In other words, we have

TC = i = 1 n TC P i + TC O i + TC I i + TC WIP i + TC H i .

However, before starting to calculate the costs, it is necessary to define some of the parameters. In any cycle, setup time, production time, and reworking time are equal to S i , m i Q i , and m i (p1iQ i ), respectively. Then, total setup and production time (TP i ) for product i is as follows:

TP i = S i + m i Q i + m i p 1 i Q i = S i + m i Q i 1 + p 1 i .

Then, the average of operation time for each unit of product i is equal to Equation 3:

t i = TP i Q i = S i Q i + m i 1 + p 1 i .

Regarding our definition of R i , which is the rate of production cost per unit time, we can define v i and c i as follows:

v i = R i t i = R i S i Q i + m i 1 + p 1 i
c i = M i + v i = M i + R i S i Q i + m i 1 + p 1 i .

As in this model delay is not allowed, supply and demand are equal together. Hence, we have

1 p 2 i Q i = D i T i T i = 1 + p 2 i Q i D i .

In the ‘Parameters and notations’ section, we defined s1i and s2i as the price of perfect and scrap items, respectively. Then, average revenue in unit time is as follows:

TR i = 1 p 2 i Q i s 1 i + p 2 i Q i s 2 i T i = D i s 1 i + p 2 i 1 p 2 i D i s 2 i ; i = 1 , , n .

It can be seen that revenue in unit time does not depend on the lot size.

Now, with regard to Equations 2 to 6, we can calculate all costs. Since the annual rate of demand for each product is known, total provision cost for product i per unit time is obtained through Equation 8:

TC P = i = 1 n M i Q i T i = i = 1 n M i D i 1 p 2 i ; i = 1 , , n .

The cost of setup accrues only one time for each product. We can calculate total setup cost per unit time as follows:

TC O = i = 1 n A i T i = i = 1 n A i D i Q i 1 p 2 i ; i = 1 , , n .

In this paper, it is assumed that all of the products are inspected and all of the imperfect products after reworking are transformed to perfect quality. Then, any product is inspected only once after its production. Total cost of inspection per unit time equals Equation 10:

TC I = i = 1 n I i Q i T i = i = 1 n I i D i 1 p 2 i ; i = 1 , , n .

In this stage, we want to calculate the holding cost for work in process inventory. The most famous method to present the holding cost per unit time (CH) is as follows (Silver et al. 1998):

C H i = h i c i I ¯ i ,

where h i is the rate of holding cost for product i, so we have

C WIP i = h i w ¯ i ,

where w ¯ is the average monetary value for work in process inventory, that is, the sum of the monetary value of the average of raw materials, perfect items, and reduced-cost products. For any items, the average inventory of raw materials is the total of raw materials (it is equal to the surface under the graph of inventory) divided by the time of one cycle. The average of the monetary value of raw materials is obtained by multiplying the average inventory of raw materials by the price of any raw materials. Similarly, the average monetary value of perfect products and reduced-cost products can be calculated. Then, the average monetary value for all of the works in process inventory is as follows (Equation 13):

w i ¯ = 1 2 Q i TP i T i M i + 1 2 1 p 2 i Q i TP i T i c i + 1 2 p 2 i Q i TP i T i c i = 1 2 Q i TP i T i M i + c i = D i 2 1 p 2 i S i + m i 1 + p 1 i Q i 2 M i + R i S i Q i + R i m i 1 + p 1 i .

With regard to Equations 12 and 13, the average holding cost for work in process inventory is as follows:

TC WIP = i = 1 n h D i 2 1 p 2 i S i + m i 1 + p 1 i Q i 2 M i + R i S i Q i + R i m i 1 + p 1 i i = 1 , , n .

In this step, we want to calculate the holding cost, but at first, we have to estimate the average of inventory in the warehouse. Regarding Figure 1d, it is equal to Equation 15:

I i ¯ = 1 2 Q i 1 p 2 i T i T i = 1 2 Q i 1 p 2 i .

Then, the total holding cost is similar to Equation 16:

TC H = i = 1 n h i c i I i ¯ = 1 2 h i M i + R i S i Q i + R i m i 1 + p 1 i 1 p 2 i Q i ; i = 1 , n .

Now, we can calculate the total annual cost of all products using Equation 17:

TC = i = 1 n M i D i 1 p 2 i + A i D i Q i 1 p 2 i + I i D i 1 p 2 i + h i 2 [ D i 1 p 2 i S i + m i Q i 1 + p 1 i 2 M i + R i S i Q i + R i m i 1 + p 1 i + 1 p 2 i Q i M i + R i S i Q i + R i m i 1 + p 1 i ] ; i = 1 , , n .

Problem formulation

As we described earlier, the goal is to determine economic production quantity in order to minimize the total annual cost given in Equation 17 and satisfy the constraint.

Hence, we can formulate the problem as follows:

Min TC = i = 1 n M i D i 1 p 2 i + A i D i Q i 1 p 2 i + I i D i 1 p 2 i + h i 2 D i 1 p 2 i S i + m i Q i 1 + p 1 i 2 M i + R i S i Q i + R i m i 1 + p 1 i + 1 p 2 i Q i M i + R i S i Q i + R i m i 1 + p 1 i ; i = 1 , , n St: i = 1 n 1 p 2 i Q i f i F Q i > 0.

In the next section, we present an efficient algorithm to solve this objective function.

The solution algorithm

The formulation given in Equation 18 is a non-linear programming model which is hard to solve by conventional optimization techniques. Then, we have to use heuristic search. Simulating the natural evolutionary process of human beings results in stochastic optimization techniques, of which the most applicable is genetic algorithm (Gen 1997). Solving a non-linear programming problem by traditional techniques will lead to a local optimum solution. In other words, the global optimum cannot be obtained. If meta-heuristic approach such as genetic algorithm (GA) is used, we will get the closest solution to the global optimum (Shabani et al. 2011).

The usual form of GA was described by Goldberg (1989). Generally, conventional algorithms for optimization have a point-to-point approach and maybe they fall in local optima. However, GA performs a multiple directional search by maintaining a population of solutions. Each solution is called a chromosome. The chromosomes which improved in consecutive iterations are called generations. During each generation, the chromosomes are evaluated using some measures of fitness. To create the next generation, new chromosomes, called offspring, are formed by either crossover or mutation operator. In addition, the chromosomes that have higher fitness are kept for the next generation. After several generations, the algorithm converges to the best chromosome which hopefully represents the optimum or suboptimal solution to the problem.

In the next subsections, we describe the required steps to solve the aforementioned model by GA.

Initial conditions

The required initial conditions to start solving a model with GA are as follows:

  1. (a)

    Population size: It is the number of chromosomes that is kept in each generation, but its value changes in consecutive iterations to improve objective function; we denoted it by pop-size or N.

  2. (b)

    Crossover rate: It is defined as the ratio of the number of offspring produced by crossover operator and denoted by P C.

  3. (c)

    Mutation rate: It controls the number of chromosomes to undergo mutation operation and denoted by P M.


In the GA method, each individual in the population is called a chromosome, and any chromosome contains some genes. In this model, we present a chromosome by a matrix that has one row and n columns. Each column shows the quantity of production for each product. Figure 2 presents one chromosome for the problem at hand.

Figure 2
figure 2

Chromosome presentation.


Each chromosome in the GA method was evaluated with some measures, and we have to assign a fitness value for it. In this model, it signifies the value of the objective function. For a constrained optimization problem, the main issue is to control the feasibility of chromosomes. In order to control infeasible solutions, we have to employ penalty policy presented by Gen (1997). Because this problem is a minimization one, penalty is defined as a positive value. The more infeasible chromosomes, the more are the penalties. Hence, when a chromosome is feasible, its penalty is zero. In this case, the fitness function for a chromosome is the sum of its objective function and its penalty.

Initial population

To perform GA, at first, we have to define the first generation for the GA method randomly with regard to population size.


Crossover is the main genetic operator. It operates on two chromosomes at a time and generates offspring by combining the features of both chromosomes (Gen 1997). At first, we have to select a pair of chromosomes from the generation randomly with probability Pc. One simple way to achieve crossover is to create a binary chromosome randomly. We do not change the genes with a value of 0, but we consider the genes with a value of 1. To produce offsprings, genes of parents are crossed so that they have the same positions as those with a value of 1. Figure 3 demonstrates the crossover operation for the four products.

Figure 3
figure 3

An example of crossover operation.


Mutation is a background operator which produces a random change in chromosomes, and maybe it results in a chromosome with a higher fitness value. For our model, a chromosome is randomly produced as its genes are between 0 and 1. We do not change the genes with a value more than that of PM, but, we replace the genes with a value less than that of PM with a new random value within the boundaries of the parameter. Figure 4 shows an example of the mutation operator for the four products, and PM is equal to 0.05.

Figure 4
figure 4

Graphical representation of mutation operator.

Chromosome selection

After producing the offsprings with the crossover and mutation operators and measuring their fitness value, we have to make the next generation based on the chromosomes which have the highest fitness. Then, we select N chromosomes among the parents and offsprings with the best fitness value. In this problem, we select the chromosomes that result in less cost.

Stopping criteria

Genetic algorithm is a sequence of computational steps that converge to optimal solution. We have to define some measures to stop the generations. Stopping criteria are a set of conditions that when the method satisfies them, a good solution is obtained. In this paper, we use two stopping criteria. At first, after some generations, the algorithm examines the values of fitness. If there is no improvement in the fitness function values for some consecutive generations, the algorithm stops. In another case, the algorithm continues for some generations again and checks the values of fitness another time.

Results and discussions

A numerical example

In order to demonstrate the application of the proposed genetic algorithm, we present a numerical example in this section. The values of all parameters are given in Table 1. In addition, we assume that the total space of the warehouse is 1,500.

Table 1 Data for the example

With this data, we run the proposed genetic algorithm for 110 times, but we only change the parameters of the genetic algorithm. We assume that the rate of crossover and mutation change is in the range of 0.45 to 0.85 and 0.005 to 0.05, respectively. Also, the number of chromosomes (pop-size) falls between 20 and 60. Next, we estimate the equation of regression of these results. In the next step, we optimized this equation with regard to the range of parameters. In addition, we assume that the pop-size is only an integer.

The optimized parameters are 0.85, 0.05, and 60 for crossover rate, mutation rate, and pop-size, respectively. Now, with these parameters, the graph of fitness value in terms of the number of generations is presented in Figure 5.

Figure 5
figure 5

The graph of convergence.

Figure 3 shows that the minimum cost is 8,584 and the algorithm converges after five generations.


One inevitable aspect of manufacturing systems is the production of defective products. In this paper, we developed a multi-product EPQ model with defective items and reworking. In addition, the warehouse space is limited for all products. In this condition, we formulated the problem as a non-linear programming, and in order to solve it, a much easier genetic algorithm was applied. At the end, we presented a numerical example to demonstrate the application of the proposed algorithm, and in this example, we optimized the parameters of the genetic algorithm. Also, for future research, some recommendations are presented as follows:

  1. (a)

    Other heuristic search techniques such as ant colony optimization or simulated annealing algorithm can be used to solve the presented model and compare their results with the proposed genetic algorithm.

  2. (b)

    In the future, researchers can add some limitations such as delay and shortage to the model. Aside from warehouse space constraint, they can consider constraints about budget and so on. Using some constraints together makes the problem too hard, and using a meta-heuristic approach to solve the model is inevitable.

  3. (c)

    We can extend the model in such a way that some parameters such as the rate of demand become random or fuzzy variables.

Authors' information

Dr. KFH is an assistant professor in the Department of Industrial Management at Islamic Azad University, South Tehran Branch. His research interests lie in the area of project management, statistics, knowledge management, operations management, and operation research. For about 15 years, he has taught undergraduate, graduate, and industry courses and carried out research in various aspects of industrial engineering and management. He has published research papers in journals such as the Research Journal of Applied Sciences Engineering and Technology, World Applied Sciences Journal, American Journal of Scientific Research, International Journal of Economic and Management Science, and Middle-East Journal of Scientific Research. Dr. CV is an assistant professor in the Department of Industrial Management at Islamic Azad University, South Tehran Branch. His research interests lie in the area of quality and productivity management, strategic management, innovation management, knowledge management, and operations management. For about 15 years, he has taught undergraduate, graduate, and industry courses and carried out research in various aspects of industrial engineering and management. He has published research papers in journals such as The TQM Journal, Innovation: Management, Policy & Practice, International Journal of Productivity and Performance Management, Business Strategy Series, Industrial and Commercial Training, etc. He is a senior member of the American Society for Quality (ASQ). AK holds a MA degree in the field of Industrial Management from Islamic Azad University, Qazvin Branch.