1 Introduction

Linear programming (LP) has found numerous applications across various domains due to its ability to optimize limited resources and make informed decisions. In operations research and supply chain management, LP has been utilized for production planning, inventory management, and distribution optimization (Maravelias and Sung 2009). LP has also played a vital role in transportation and logistics, enabling efficient routing and scheduling of vehicles (Yang et al. 2015). In finance, LP has been employed for portfolio optimization, asset allocation, and risk management (Luenberger and Ye 2008). Additionally, LP has been applied in energy systems, healthcare resource allocation, telecommunications network optimization, and many other fields (Gass 2003). Its versatility and effectiveness make linear programming a valuable tool for decision-making in complex real-world problems.

Supply chain optimization has become increasingly important for businesses to ensure flexibility and responsiveness to changes in the market. A variety of LP, MILP, and MINLP models have been used in the industry to deal with strategic and operational problems associated with the design, long-term/midterm planning, and short-term operations of supply chains (Grossmann 2005; Shah 2005; Harjunkoski et al. 2014; Cafaro and Grossmann 2014; You and Grossmann 2008). Although these models are useful, some challenges may arise when they are implemented in operation. For instance, recommendations from a model that lead to changes in raw materials destination, transportation modes, or production and supply chain processes. The advantage of knowing the recommendations associated with the optimal solution of a model is to understand the potential that changes can bring. Furthermore, having alternate solutions in increasing order of objective provides additional valuable information as it can propose alternate solutions to reach similar benefits, evaluating possible changes that the decision-maker may implement, which in turn supports the understanding and interpretation of the decision-making.

In biological systems, degeneracy in linear programming models for metabolic networks represents multiple pathways and reaction networks that perform similar functions. In biological and chemical reactive systems, this phenomenon is often recognized and used to find different pathways to produce the same product. For identifying alternative optimum solutions of pathways in linear programming models, Lee et al. (2000) introduced a recursive MILP approach and used it to study metabolic networks. In this paper we propose an improved iterative MILP approach that will not only obtain alternate optimal solutions of pathways but will produce a solution pool of all the alternate solutions in the increasing order of value of the objective function.

Alternate solutions can also be interpreted as the extreme points that lie at the intersection of the convex polytope given by the linear constraints and the hyperplane of the optimal objective function value. A number of special purpose algorithms have been reported in the literature for finding all the extreme points of the convex polytope of a Linear Programming problem (Swart 1985; Matheiss and Rubin 1980). Aside from the fact that these algorithms have exponential complexity, they are not easy to implement. Therefore, our goal in this study is to develop an iterative MILP method, which has the advantage that it can readily be implemented in a modeling language (e.g. GAMS, AMPL, Pyomo).

The paper is organized as follows. Section 2 discusses the motivation for a linear programming supply chain optimization problem. In Sect. 3, the problem statement is given for finding alternate solutions for general LP problems. In Sect. 4, this paper introduces a comprehensive novel algorithm to find multiple alternate solutions of a given LP problem. After presenting the general methodology, Sect. 5 demonstrate the method on a 2 dimensional Linear Programming problem and on both a small and large supply chain model provided by Aurubis AG. Section 6 draws conclusions for the paper.

2 Motivating problem for finding alterante optima

Linear network flow problems are known to often having a high level of degeneracy. Therefore, they may exhibit multiple optimal solutions that have the same objective value. Finding all such solutions can provide useful information to the decision maker instead of simply reporting one single solution. Investigating the possibility of other solutions or the next-best solution in network flow problems offers even another layer of knowledge about the structure of the network problems. Providing the user of these models with a solution pool of N best solutions can provide useful information to the model user.

Let us consider a practical example. Suppose we want to optimize the flow of raw materials to a set of processing plants. Each processing plant is subject to processing constraints and product specification constraints. In real-life operations, ideally, decision makers want to optimize processes performing the minimal number of changes. This is mainly because changing a process requires a certain amount of effort and material procurement are subjected by long term contracts. Therefore, the enumeration of solutions in an increasing order can be a powerful tool to compare them to status quo and evaluate which one can provide the best financial gain over the number of process changes.

As a specific example of a linear network flow problem consider the graphical representation of a typical supply chain model shown in Fig. 1. As the materials flow from the suppliers to the customers, the goal is to optimize the flow to ensure the optimal coordination between the different components of the supply chain. In many occasions, disruptions or changes in the model may be introduced, which require resolving the LP model. Rather than obtaining a single solution from the LP model as is common practice, we aim to identify a specified number of alternate best solutions of the LP model, which may include degenerate and no-degenerate solutions. In the next section we address this problem in general form.

Fig. 1
figure 1

Supply chain layout

3 Problem statement

Alternate Solutions of an LP - Given an LP model shown in problem (1) below, our goal is to find the optimal solution as well as alternate solutions with the same objective value or with increasing objective value. More specifically, given an LP model expressed in terms of equality and inequality constraints as in (1), the goal is to find the N best solutions of the following problem:

$$\begin{aligned} \begin{array}{ll} \min &{} \quad z = c^T x \\ \text{ s.t. } &{} \quad Ax = b \\ &{} \quad D x \le e \\ &{} \quad x \ge 0 \\ \end{array} \end{aligned}$$
(1)

We propose in the next section an algorithm that can provide the user with a solution pool of the N best solutions of the LP in (1).

4 Algorithm to find alternate optimal solutions in linear programming models

4.1 Properties of an LP

Linear programming corresponds mathematically to the optimization of a linear objective function, subject to linear equality and linear inequality constraints (Charnes and Cooper 1957). A linear programming problem in its general form is given by model (1) in Sect. 3. We rewrite the model and include the variable bounds in the set of inequality constraints: \(Ex \le d\). The resulting model is then given by model (2)

$$\begin{aligned} \begin{array}{ll} \min &{} \quad z = c^T x \\ \text{ s.t. } &{} \quad Ax = b \\ &{} \quad E x \le d \\ &{} \quad x \in R^n \\ \end{array} \end{aligned}$$
(2)

An important property of a Linear programming problem is that the optimal solution is found at the extreme points of the feasible space (Chvatal 1993). Algorithms such as the simplex algorithm (Dantzig 1982) and the interior point methods (Karmarkar 1984) only find one extreme point. If we want to find alternative solutions of problem (2), we must enumerate alternative extreme points. The feasible space of a 2-dimensional LP is shown in Fig. 2 which shows the alternate solutions of an LP.

Fig. 2
figure 2

An example of a feasible space of a 2-dimensional LP

The stars marked in Fig. 2 represent all the vertex solutions of the LP and the shaded space indicates the feasible space of the LP. As can be seen from Fig. 2, the optimal solution lies at the point (3.5,2) with the objective value of 5.5. The LP shown has 3 alternate solutions with objective values of 10, 16 and 19.75. If we wish to traverse through all the vertexes and identify alternate solutions in increasing value of objective function, we need to identify the constraints that are inactive. The constraints marked in green in Fig. 2 are active for the optimum value of 5.5 while the ones marked in red are inactive. To identify the next alternate solution, point (8,2) which has an objective value of 10, we identify the active and the inactive constraints of the current best solution by adding slack variables to all the inequality constraints in our LP model. If the slack variable is strictly greater than zero of a particular constraint then the constraint is inactive, while a zero value of the slack variable implies that the constraint is active. We proceed by forcing at least one inactive constraint to be active by adding cuts using binary variables introduced in the proposed MILP formulation which allows us to traverse through all the vertex solutions.

4.2 MILP master problem

The general idea of the algorithm outlined in Sect. 4.1 is to identify the inactive constraints in the solution of the LP model and to force at least one of them to become active in order to define a new basis that will correspond to a new vertex point. We implement this algorithm by adding slack variables to the inequality constraints in our model and control the activity of these constraints by adding binary variables to the model. The set of inactive constraints are identified by the value of the slack variable. Hence, if the slack variable is strictly greater than zero (\(s_i > 0\) or \(s_i \ge \epsilon \) where \(\epsilon \) is an appropriate small number) we know that the constraint is inactive.

Specifically, let us consider the linear programming problem (2) in its general form for which the slack variables s are added shown in the following LP model (3)

$$\begin{aligned} \begin{array}{ll} \min &{} \quad z = c^T x \\ \text{ s.t. } &{} \quad Ax = B \\ &{} \quad E x + I s = d \\ &{} \quad s \ge 0 \\ &{} \quad x \in R^n \\ \end{array} \end{aligned}$$
(3)

Let us assume we obtain the optimal solution to the LP using the simplex method or interior point method (iteration K = 0). The MILP master problem corresponding to the LP model (3) for iteration \(K = 0,1,2,3...,N\) is shown below. To determine the activity of the constraints, binary variables \(y_i\) are introduced. \(y_i\) is a binary variable that for \(y_i = 1\) indicates whether the slack variable is zero, meaning the corresponding constraint is active. The MILP model (4) is shown below in which the inequalities are written for each individual constraint:

$$\begin{aligned} \begin{array}{lll} \min &{} \quad z = c^T x \\ \text{ s.t. } &{} \quad A x=B \\ &{} \quad e_i x+s_i-d_i=0 \hspace{0.75cm} &{} \quad \forall i \in \{1,2,...,m\}\\ &{} \quad s_i \le M\left( 1-y_i\right) \hspace{0.75cm}&{} \quad \forall i \in \{1,2,...,m\}\\ &{} \quad s_i \ge 0 \hspace{1.75cm}&{} \quad \forall i \in \{1,2,...,m\}\\ &{} \quad \sum \limits _{i \in W^k}^{} y_i \ge 1 \hspace{0.75cm}&{} \quad \forall k \in \{0,...,K-1\} \\ &{} \quad x \in R^m \\ &{} \quad y_i \in \{0,1\} &{} \quad \forall i \in \{1,2,...,m\}\\ \end{array} \end{aligned}$$
(4)

In problem (4), the individual inequality constraints in (2) are reformulated as equations: \(e_i x + s_i - d_i = 0\) using slack variables; \(s_i\). We add the Big-M constraints \(s_i \le M(1 - y_i)\) (M valid upper bound), which force the slack variable of the ith constraint to be \(s_i \le 0\) when the binary variable \(y_i\) is set to 1. Therefore, the constraint \(s_i \le 0\) and the non-negativity constraint on the slack variable \(s_i \ge 0\) forces the slack variable to be \(s_i = 0\). This forces the ith constraint to be active. We should note that the user may choose to use different \(M_i\) values for the constraint \(s_i \le M (1 - y_i)\) instead of using one single value of M. In this paper we have used a single Big-M to illustrate our algorithm.

The constraint \(\sum \nolimits _{i \in W^k}^{} y_i \ge 1 \hspace{0.5cm}, k = 0,1,...,K\) is the cut that allows us to move from the current solution to the next best solution. The summation is over the indexed set \(W^k\). The set \(W^k\) is the set of indices of all slack variables that are strictly greater than 0 (i.e. inactive constraints) for iteration K. For example, if \(s_1 = 10\), \(s_2 = 12\), \(s_3 = 0\), and \(s_4 = 2\), the indexed set W would be \(\{1,2,4\}\) since these slack variables are strictly greater than 0. This set is indexed over index k which goes from 0 to \(K-1\) where K is the current iteration. Therefore, for iteration K we add \(K-1\) cuts to ensure that we obtain the Kth best solution. We start our iterative algorithm with \(K = 0\) solving the LP in (3) and set \(W^0\) as the indices of the non-zero slack variables.

The index i is defined from 1 to m where m is the number of inequality constraints in the LP model. The binary variables \(y_i\) are added to all the inequalities in the original LP model. These variables are added at the start of the iterative algorithm. Therefore, all binary variables are introduced at the first iteration. The cuts are then added one at each iteration of the algorithm. It is possible that some of the variables in the set of basic variables be 0, which leads to degenerate solutions. Therefore, we define the indexed set \(W^k\) in model (4) to be the set of all slack variables that are strictly greater than 0 for iteration K.

4.3 Algorithm

The iterative MILP method to find the N best solutions of the LP in (2) consists of the following steps:

Step 0: The first step at iteration \(K = 0\) is to solve the LP model (3) to obtain the optimal solution. If feasible, define the index set \(W^0\) for those slack variables \(s_i > 0\).

Step 1: Reformulate the LP as the MILP in (4) replacing all inequality constraints with equality constraints and using slack variables. In model (4), adding the constraint \(s_i \le M (1 - y_i)\) forces the slack of the ith constraint to be active: \(s_i = 0\) when the binary variable \(y_i\) is set to be 1. The constraint \(\sum \nolimits _{i \in W^0}^{} y_i \ge 1\) is the integer cut that makes the current LP solution (3) to be infeasible and forces the move to the next best solution. If this MILP in (4) is infeasible, stop. Otherwise, go to step 2.

Step 2: (a) For each subsequent iteration \(K \ge 1\); solve the MILP model (4) and record the optimal objective value, optimal solution, and determine which slack variables are non-zero.

(b) Define an integer cut on the non-zero slack variables \(s_i > 0\) using the corresponding binary variables. The following constraints are then used as cuts in the iterative MILP model:

$$\begin{aligned} \sum \limits _{i \in W^k}^{} y_i \ge 1 \hspace{0.75cm}\forall k \in \{0,...,K-1\} \end{aligned}$$
(5)

These integer cuts are defined by the set of non zero slack variables in the previous iteration. Hence, these cuts allow us to move from the current solution to the next best solution without repeating solutions.

Step 3: Resolve the MILP model (4) and record the objective value and the solution. Keep adding cuts using step 2b.

Step 4: The exit block of our algorithm is when we reach the Nth best solution or when we get an infeasible solution in the MILP (4) in which case there are \(N-1\) alternate solutions for the given LP.

In summary, the LP problem (3) is first solved at iteration 0 to identify the current basis and optimal value. For \(K = 0,...,N-1\) iterations, the MILP master problem (4) is solved until the Nth best solution is reached or an infeasible solution is obtained. The convergence proof of the algorithm is given by the following proposition:

Proposition: Given the LP in (3), applying the proposed algorithm through the successive solution of the MILP in (4) in iterations \(k = 0,1,...,K\) will yield a non-decreasing sequence of vertex solutions \(z^k, k = 0,1,...,K\), such that \(z^k \le z^{k+1}, k = 0,1,...,K-1\), where each solution corresponds to an alternate solution of the LP in (3).

Proof: At each iteration \(k = 0,1,...,K\), the solution of the MILP in (4) corresponds to a vertex solution of the LP arising in (4) for the fixed optimal binary variables \(y^k\) with objective value \(z^k\). Furthermore, since the integer cut; \(\sum \nolimits _{i \in W^k} y_i \ge 1\) is added at iteration k, the integer solution \(y^{k+1}\) will be different from previous integer points \(y^0, y^1,..., y^k\), giving rise to a new vertex in point in the LP in (3). Moreover, since the feasible region is successively constrained with the addition of the integer cuts, the feasible region of the MILP \(F^{k+1}\) at iteration \(k+1\) is contained in the feasible region \(F^{k}\) at iteration k. Hence, it follows that \(z^k \le z^{k+1}, k = 0,1,...,K-1\). Q.E.D

In summary, in the proposed iterative algorithm, the first step is to solve the LP to obtain the optimal solution. In order to identify alternate vertex solutions, we force a change in the basis of the solution by defining a binary variable \(y_i\) for each slack variable \(s_i \ge 0\) and add unique cuts \(\sum \nolimits _{i \in W^k}^{} y_i \ge 1 \quad \forall k \in \{0,...,K-1\}\). By minimizing the objective function, the model selects the new basis such that the increase in the objective value is minimum. In this way, we obtain the next best vertex solution in the next iteration.

Fig. 3
figure 3

Algorithm for alternate solutions

We also present in “Appendix” a comparison of the proposed algorithm with the algorithm proposed by Lee et al. (2000) to clarify the differences between the two. It essentially reduces to the treatment of basic and non-basic variables in the full space of the LP (xs) in (3) in Lee et al. (2000), versus the treatment of active and inactive slack variables in our proposed method. As shown in the example of the “Appendix”, the proposed method requires one less iteration.

5 Results

The implementation of the algorithm is illustrated through three example problems. The first example illustrates an LP problem (with alternate solutions) expanded at each iteration of the algorithm. The second example is the implementation of the illustrative supply chain problem in Sect. 2. The third example is a large scale supply chain problem provided by Aurubis AG. The MILP model for each iteration was implemented in Pyomo (BynumMichael et al. 2021) in Python. For solving the MILP model, CPLEX 20.1 was used. All Pyomo and CPLEX settings were left at their default values. The computational experiments were conducted using an Intel Core i7 8565U @1.60GHz machine, with a RAM of 16GB.

5.1 Example 1: 2-dimensional LP

We illustrate the algorithm shown in Sect. 4 by implementing it on a 2-dimension Linear Programming problem shown in (6):

$$\begin{aligned} \begin{array}{ll} \text{ min } &{} \quad z = x_1+2 x_2 \\ \text{ s.t. } &{} \quad x_1 \le 8 \\ &{} \quad x_2 \le 10 \\ &{} \quad x_1+x_2 \le 8 \\ &{} \quad 3 x_1+1.5 x_2 \ge 9 \\ &{} \quad x_1-x_2 \le 3 \\ &{} \quad x_1 \ge 0 \\ &{} \quad x_2 \ge 0\\ \end{array} \end{aligned}$$
(6)

The corresponding feasible space of Model (6) is shown in Fig. 4. The optimal solution (obj value \(=\) 3) along with the 3 alternate solutions (obj value = 10.5, 12, and 16) are marked on the feasible space in Fig. 4:

Fig. 4
figure 4

Feasible space of Model 4

We first reformulate (6) in terms of slack variables,

$$\begin{aligned} \begin{array}{cl} \text{ Min } &{} \quad z = x_1+2 x_2 \\ \text{ s.t. } &{} \quad x_1-8+s_1=0 \\ &{} \quad x_2-10+s_2=0 \\ &{} \quad x_1+x_2-8+s_3=0 \\ &{} \quad 9-3 x_1-1.5 x_2+s_4=0 \\ &{} \quad x_1-x_2-3+\textrm{s}_5=0 \\ &{} \quad -x_1+s_6=0 \\ &{} \quad -x_2+s_7=0 \\ &{} \quad s_i \ge 0 \hspace{1.8cm} \forall i \in \{1,..,7\}\\ \\ \end{array} \end{aligned}$$
(7)

We next reformulate the LP to an MILP using both slack variables and binary variables. We replace all inequality constraints with equations using the slack variables. We add the constraint \(s_i \le M (1 - y_i)\) to control the activity of the inequality constraints. We also add the constraint \(\sum y_i \ge 1 \quad \forall i \in W^{k}\) which is the cut that allows us to move from the current solution to the next best solution. The reformulated MILP is shown in Model (8):

$$\begin{aligned} \begin{array}{cl} \text{ Min } &{} \quad z = x_1+2 x_2 \\ \text{ s.t. } &{} \quad x_1-8+s_1=0 \\ &{} \quad x_2-10+s_2=0 \\ &{} \quad x_1+x_2-8+s_3=0 \\ &{} \quad 9-3 x_1-1.5 x_2+s_4=0 \\ &{} \quad x_1-x_2-3+\textrm{s}_5=0 \\ &{} \quad -x_1+s_6=0 \\ &{} \quad -x_2+s_7=0 \\ &{} \quad s_i \le M\left( 1-y_i\right) \hspace{0.4cm} \forall i \in \{1,..,7\}\\ &{} \quad s_i \ge 0 \hspace{1.8cm} \forall i \in \{1,..,7\}\\ \\ &{} \quad \sum \limits _{i \in W^{k}} y_i \ge 1 \hspace{1cm} \forall k \in \{0,..,K-1\}\\ \\ &{} \quad y_i \in \{0,1\} \hspace{1.2cm} \forall i \in \{1,2,...,7\}\\ \end{array} \end{aligned}$$
(8)

Iteration 0: In this iteration we solve the LP in (7) and obtain the optimal solution. We do not have any cuts in this iteration. We record the value of the slack variables for the next iteration. We get an objective value of z = 3 for \(x_1 = 3\) and \(x_2 = 0\) which is the optimal solution. The table shown in Fig. 5 displays the slack variable values from the solution we obtain in iteration 0. In this case, \(s_1\), \(s_2\), \(s_3\), and \(s_6\) are non-zero slack variables. Therefore we obtain the set \(W^0\) = \(\{1,2,3,6\}\) and we add a cut over this set using the binary variables defined. Since we focus only on the non-zero slack variables in our algorithm, the presence of degenerate solutions does not affect our process.

Fig. 5
figure 5

Iteration 1: objective value z \(=\) 10.5

Iteration 1: We solve the MILP in (8) with the cuts defined by the set \(W^0\). The table shown in Fig. 6 displays the slack variable values from the solution we obtain in iteration 1. In this case, \(s_1\), \(s_2\), \(s_4\), \(s_6\), and \(s_7\) are non-zero slack variables. Therefore we obtain the set \(W^1 = \{1,2,4,6,7\}\) and we add a cut over this set using the binary variables defined. We keep all the cuts from the previous iterations to prevent repeating solutions. We obtain an objective value of 10.5

Fig. 6
figure 6

Iteration 2: objective value z \(=\) 12

Iteration 2: We solve the MILP in (8) with the cuts defined by the set \(W^0\) and \(W^1\). The table shown in Fig. 7 displays the slack variable values from the solution we obtain in iteration 2. In this case, \(s_1\), \(s_2\), \(s_3\), \(s_5\) and \(s_7\) are non-zero slack variables. Therefore we obtain the set \(W^2 = \{1,2,3,5,7\}\) and we add a cut over this set using the binary variables defined. We keep all the cuts from the previous iterations to prevent repeating solutions. We obtain an objective value of 12.

Fig. 7
figure 7

Iteration 3: objective value \(=\) 16

Iteration 3: We solve the MILP in (8) with the cuts defined by the set \(W^0\) and \(W^1\) and \(W^2\). This is the final iteration and we obtain an objective value of 16. Note that if we continue to add a cut on the positive slack variables we will get an infeasible solution as there are no more vertex solutions remaining. Hence, we terminate the algorithm after the 3rd iteration.

In summary, we obtain the following solution pool for the 2-d LP problem (Table 1):

Table 1 Solution pool for Example 1

In this way, we have illustrated the proposed iterative MILP algorithm that will produce a solution pool of all the alternate solutions in the increasing order of value of the objective function.

5.2 Example 2: Supply chain problem

Consider the supply chain model shown in Fig. 8. It is representative of a small supply chain network with 3 plants and 2 customers to demonstrate the application and effectiveness of our algorithm.

Fig. 8
figure 8

Supply chain problem

The optimization is subjected to the following constraints: Equation (9b) states the capacity constraint of each plant. Equation (9c) is a demand satisfaction constraint that ensures the sum of products from all plants is equal to the demand of the customer. Equation (9d) are the variable bounds. The objective of the model is to minimize costs (9a).

$$\begin{aligned} \begin{array}{lll} \min &{} \quad Z = \sum \limits _{i} \sum \limits _{j} C_i*F_{ij} &{} \quad (9a)\\ \\ s.t &{} \quad \sum \limits _{j} F_{i,j}\le Cap_i \quad \forall i &{} \quad (9b)\\ &{} \quad \sum \limits _{i} F_{i,j} = D_j \quad \forall j &{} \quad (9c)\\ &{} \quad F_{i,j}\ge 0 \quad \forall i, \forall j &{} \quad (9d)\\ \end{array} \end{aligned}$$

The parameters are shown in Tables 2, 3, and 4. Table 2 displays the transportation costs associated between the suppliers and the customers. Tables 3 and 4 displays the plant capacities and the customer demands respectively.

Table 2 Transportation cost ($ per unit) between suppliers and customers
Table 3 Plant capacities
Table 4 Customer demand

The LP supply chain model is optimized by minimizing costs subject to the constraints shown in the LP Model (9). When the LP optimization model is solved with the specified parameters, we obtain the cost $ 380K. The optimal solution for the optimization is given on the boxes in the arrows going from one node to another in iteration 1 (see Fig. 9). The algorithm is applied and the cuts have been added at every iteration to move to the next vertex solution. The first 4 iterations are shown in Fig. 9. The optimization is executed until all 13 vertex solutions are exhausted. The solution pool obtained is shown in Table 5 and the objective value at every iteration is visualized in Fig. 10. Note that solutions at iterations (1, 2), (4, 5, 6), (7, 8), and (9, 10) have the same value of the objective function and hence are degenerate solutions.

Fig. 9
figure 9

Solutions for the first 4 iterations

Table 5 Solution pool for example 2
Fig. 10
figure 10

Objective value at every iteration

The objective value at every iteration is given in Fig. 10. Thus, the algorithm obtains 13 alternate vertex solutions for the supply chain problem. This gives the user the ability to choose among these solutions considering practical considerations that are not explicitly included in the model. Hence, the proposed algorithm can provide the user with a solution pool of N best solutions of an LP model. In the next subsection, we implement on a large scale supply chain model.

5.3 Example 3: Large scale supply chain problem

5.3.1 Problem set-up

Let us consider the supply chain model shown in Fig. 11. It is representative of a supply chain model for Aurubis having 13 plants. The brown arrows indicates plants that can receive raw materials. The yellow arrow indicates the plants that produce products. The blue arrows indicates the intermediate flows between different plants. Note that some plants have multiple yellow arrows. Each yellow arrow denotes a unique product produced at that plant. Each raw material, intermediate flow and product is composed of different elements. The indices rm, p, elem, and prod represent the raw materials, plants, elements, and products. The set of links is a set of tuples to represent the intermediate flows between plants. For example, the tuple (1, 2) represents the intermediate flow from plant 1 to plant 2. There are 3 variables in the model to define the different kinds of flows: \(f_1\), \(f_2\), and \(f_3\). The flow \(f_1\) is the flow of raw materials to plants. The flow \(f_2\) is the intermediate flow for each link. The flow \(f_3\) is the flow of products from plants. The parameters defined for the problem are shown in Table 6.

Table 6 Parameters defined for the supply chain problem
Fig. 11
figure 11

Large scale supply chain example problem

Fig. 11 shows the supply chain problem with 13 plants. There are 167 raw materials and 16 unique products shown by the brown and yellow arrows respectively. The blue arrows indicate the intermediate flows between plants. Each of these flow is comprised of 25 different elements.

The optimization is subjected to the following constraints: Equation (10b) states that any amount of an element entering a plant is equal to the amount of that element leaving the plant. Equation (10c) is a demand satisfaction constraint that ensures the sum flow of products from all plants is greater than or equal to the demand of that product. Equation (10d) states that the total amount of raw materials and intermediate flows entering a plant is less than the capacity of the plant. Equation (10e) is the availability constraint of the raw material. Equation (10f) define variable \(g_3(prod)\) which is the total flow of a product from a plant. Equation (10g) and (10h) represents the product specification constraint of each product. Equation (10i), (10j), and (10k) are the variable bounds. The objective the model is to maximise profit (10a). The first 3 terms of the objective are the revenue from the product, the raw material deductions and the revenue from the raw materials while the 4th term is the losses associated with each product.

$$\begin{aligned} \begin{array}{lll} \max &{} \quad \quad z = \sum \limits _{prod} \sum \limits _{elem} f_3(prod,elem)*rev(prod) &{} \quad \\ &{} \quad + \sum \limits _{elem} \sum \limits _{p} \sum \limits _{rm} f_1(rm,p)*analysis(rm,elem)*ded(rm,elem)*price(elem) &{} \quad \\ &{} \quad + \sum \limits _{p} \sum \limits _{rm} f_1(rm,p)*rev(rm) \\ &{} \quad - \sum \limits _{elem} \sum \limits _{prod} f_3(prod,elem)*loss(prod,elem)*price(elem) &{} \quad (10a)\\ \text{ s.t. } &{} \quad \quad \sum \limits _{r m} f_1(r m, p)*analysis(rm, elem) \\ &{} \quad +\sum \limits _{p^{\prime }} f_2\left( p^{\prime }, p, elem\right) =\sum \limits _{p^{\prime }} f_2\left( p, p^{\prime }, elem\right) \\ &{} \quad \hspace{2cm}+\sum \limits _{prod} f_3(prod,elem) \quad \forall p, \forall elem &{} \quad (10b)\\ &{} \quad \sum \limits _{elem} f_3(prod, elem) \ge Demand(prod) \quad \forall prod &{} \quad (10c)\\ &{} \quad \sum \limits _{r m} f_1(rm, p)+\sum \limits _{p^{\prime }, elem} f_2\left( p^{\prime }, p, elem\right) \le Capacity(p) \quad \forall p &{} \quad (10d)\\ &{} \quad \sum \limits _p f_1(rm, p) \le Avail(rm) \quad \forall rm &{} \quad (10e)\\ &{} \quad g_3(prod) = \sum \limits _{elem} f_3(prod, elem) \quad \forall prod &{} \quad (10f)\\ &{} \quad f_3(prod, elem) \ge MinSpec(prod, elem) * g_3(prod) \quad \forall prod,\forall elem &{} \quad (10g)\\ &{} \quad f_3(prod, elem) \le MaxSpec(prod, elem) * g_3(prod) \quad \forall prod,\forall elem &{} \quad (10h)\\ &{} \quad f_1(rm, p) \ge 0 \quad \forall rm, \forall p &{} \quad (10i)\\ &{} \quad f_2(link, elem) \ge 0 \quad \forall link,\forall elem &{} \quad (10j)\\ &{} \quad f_3(prod, elem) \ge 0 \quad \forall prod,\forall elem &{} \quad (10k)\\ \end{array} \end{aligned}$$

5.3.2 Optimal solution of the LP

The LP supply chain model is optimized by maximizing profit subject to the constraints shown in Model (10). The optimal solution with the specified parameters yields a profit of €266.898 million. The solution for the optimization is given in Fig. 12.

Fig. 12
figure 12

Optimal solution of the supply chain LP

The objective value of the optimal solution is €266.898 million. The model statistics are given in Table 7.

Table 7 Model statistics for the LP supply chain problem

5.3.3 Generating alternate solutions

As described in Sect. 4.3, we first reformulate the LP and add slack variables to all the inequality constraints of our model. The reformulated model is given by model (11). The objective function (11a). The constraint (11b) is an equality constraint and therefore remains unchanged. We also add the traditional Big-M constraints to the slack variables shown in (11l)–(11s). The non-negative constraints on the slack variables is shown in (11t)

$$\begin{aligned} \begin{array}{lll} \max &{} \quad z = \sum \limits _{prod} \sum \limits _{elem} f_3(prod,elem)*rev(prod) &{} \quad \\ &{} \quad + \sum \limits _{elem} \sum \limits _{p} \sum \limits _{rm} f_1(rm,p)\\ &{} \quad *analysis(rm,elem)*ded(rm,elem)*price(elem) &{} \quad \\ &{} \quad + \sum \limits _{p} \sum \limits _{rm} f_1(rm,p)*rev(rm) \\ &{} - \sum \limits _{elem} \sum \limits _{prod} f_3(prod,elem)*loss(prod,elem)*price(elem) &{} \quad (11a)\\ \text{ s.t. } &{} \quad \sum \limits _{r m} f_1(r m, p)*analysis(rm, elem) \\ &{} \quad +\sum \limits _{p^{\prime }} f_2\left( p^{\prime }, p, elem\right) =\sum \limits _{p^{\prime }} f_2\left( p, p^{\prime }, elem\right) &{}\\ &{} \quad \hspace{2cm}+\sum \limits _{prod} f_3(prod,elem) \quad \forall p, \forall elem &{} \quad (11b)\\ &{} \quad Demand(prod) - \sum \limits _{elem} f_3(prod, elem) + s_1(prod) = 0 \quad \forall prod &{} \quad (11c)\\ &{} \quad \sum \limits _{r m} f_1(rm, p)+\sum \limits _{p^{\prime }, elem} f_2\left( p^{\prime }, p, elem\right) \\ &{} \quad - Capacity(p) + s_2(p) = 0 \quad \forall p &{} \quad (11d)\\ &{} \quad \sum \limits _p f_1(rm, p) - Avail(rm) + s_3(rm) = 0 \quad \forall rm &{} \quad (11e)\\ &{} \quad g_3(prod) = \sum \limits _{elem} f_3(prod, elem) \quad \forall prod &{} \quad (11f)\\ &{} \quad MinSpec(prod, elem) * g_3(prod) - f_3(prod, elemp) \\ &{} \qquad + s_4(prod,elem) = 0 \quad \forall prod,\forall elem &{} \quad (11g)\\ &{} \quad f_3(prod, elem) - MaxSpec(prod, elem) * g_3(prod) \\ &{} \qquad + s_5(prod,elem) = 0 \quad \forall prod,\forall elem &{} \quad (11h)\\ &{} \quad s_6(rm, p) - f_1(rm, p) = 0 \quad \forall rm, \forall p &{} \quad (11i)\\ &{} \quad s_7(link, elem) - f_2(link, elem) = 0 \quad \forall link, \forall elem &{} \quad (11j)\\ &{} \quad s_8(prod, elem) - f_3(prod, elem) = 0 \quad \forall prod, \forall elem &{} \quad (11k)\\ &{} \quad s_1(prod) \le M*(1 - y_1(prod)) \quad \forall prod &{} \quad (11l)\\ &{} \quad s_2(p) \le M*(1 - y_2(p)) \quad \forall p &{} \quad (11m)\\ &{} \quad s_3(rm) \le M*(1 - y_3(rm)) \quad \forall rm &{} \quad (11n)\\ &{} \quad s_4(prod,elem) \le M*(1 - y_4(prod,elem)) \quad \forall prod, \forall elem &{} \quad (11o)\\ &{} \quad s_5(prod,elem) \le M*(1 - y_5(prod,elem)) \quad \forall prod, \forall elem &{} \quad (11p)\\ &{} \quad s_6(rm,p) \le M*(1 - y_6(rm,p)) \quad \forall rm, \forall p &{} \quad (11q)\\ &{} \quad s_7(link,elem) \le M*(1 - y_7(link,elem)) \quad \forall link, \forall elem &{} \quad (11r)\\ &{} \quad s_8(prod,elem) \le M*(1 - y_8(prod,elem)) \quad \forall prod, \forall elem &{} \quad (11s)\\ &{} \quad s_i \ge 0 \quad \forall i \in \{1,2,...,8\} &{} \quad (11t)\\ &{} \quad \sum \limits _{i \in W^{k}} y_i \ge 1 \quad \forall k \in \{0,..,K-1\}\\ \end{array} \end{aligned}$$

We apply the algorithm described in Sect. 4.3 and first solve the LP model to obtain the optimal solution. Next, we identify the slack variables that are strictly greater than zero and add a cut over this set of slack variables. Generating alternate solutions for a large scale supply chain problems like these can lead to solutions that are very close to the optimal solution. Therefore, we add additional cuts only on the inequality constraints of the decision variables: \(f_1\) & \(f_2\) to ensure we get significantly different solutions for practical purposes. We add slack variables to only a subset of the inequalities and add slack variables to constraints (10i), (10j), and (10k).

We solved the model for 10 iterations to identify 10 alternate solutions for the supply chain problem. The solution obtained at the 10th iteration is given by Fig. 13. The objective value z \(=\) €266.686 million

Fig. 13
figure 13

10th Alternate solution of the supply chain problem

Fig. 14
figure 14

Objective value of all 10 iterations

The objective value at every iteration is given by Fig. 14 showing 10 alternate solutions for the supply chain problem. We also note that all 10 alternate solutions are within 0.1% of the optimal solution. This gives the user the ability to choose among these solutions considering practical considerations that are not explicitly included in the model. Hence, we have solved the problem to develop a procedure or algorithm that can provide the user with a solution pool of N best solutions of an LP instead of just reporting a single optimal solution.

We solved the model using 3 different solvers to compare the performance of the algorithm, CPLEX, Gurobi, and Glpk (Makhorin 2008) for our solutions. The total solution time and the model statistics is given by Table 8.

Table 8 Model statistics for the recursive MILP formulation

6 Conclusion

In this paper, we have addressed the problem to find alternate solutions of an LP. Our goal is to find the optimal solution as well as alternative solutions with the same objective value or with increasing objective value. To address this problem, we propose an iterative MILP algorithm that generates N alternate solutions with the same or increasing value of the objective function by identifying inactive constraints at the current solution and forces at least one to be active using binary variables.

We have demonstrated the application and effectiveness of our proposed algorithm in Sect. 5. We first illustrate the algorithm on a 2-dimensional LP. Next, we show a small scale supply chain problem and generate alternate solutions for the problem. We also demonstrate its effectiveness on a large scale supply chain problem in Sect. 5.3 provided by Aurubis AG, for which we generate 10 different alternate solutions within 0.1% of the optimal solution.

The significance of the proposed method for finding alternate solutions in an increasing order is that it can be a powerful tool to compare them to the status quo. This allows the user to choose among these solutions given the practical considerations that are not explicit in the model.