IT 17 034 Examensarbete 15 hp Juni 2017

Quadratic Programming Models in Strategic Sourcing Optimization

Daniel Ahlbom

Institutionen för informationsteknologi Department of Information Technology

Abstract Models in Strategic Sourcing Optimization Daniel Ahlbom

Teknisk- naturvetenskaplig fakultet UTH-enheten Strategic sourcing allows for optimizing purchases on a large scale. Depending on the requirements of the client and the offers provided for Besöksadress: them, finding an optimal or even a near-optimal solution can become Ångströmlaboratoriet Lägerhyddsvägen 1 computationally hard. Mixed (MIP), where the Hus 4, Plan 0 problem is modeled as a set of linear expressions with an objective for which an optimal solution results in a minimum objective Postadress: value, is particularly suitable for finding competitive results. Box 536 751 21 Uppsala However, given the research and improvements continually being made for quadratic programming (QP), which allows for objective functions with Telefon: quadratic expressions as well, comparing runtimes and objective values 018 – 471 30 03 for finding optimal and approximate solutions is advised: for hard

Telefax: problems, applying the correct methods may decrease runtimes by several 018 – 471 30 00 orders of magnitude. In this report, comparisons between MIP and QP models used in four different problems with three different solvers Hemsida: were made, measuring both optimization and approximation performance in http://www.teknat.uu.se/student terms of runtimes and objective values. Experiments showed that while QP holds an advantage over MIP in some cases, it is not consistently efficient enough to provide a significant improvement in comparison with, for example, using a different solver.

Handledare: Arne Andersson and Fredrik Ygge Ämnesgranskare: Di Yuan Examinator: Olle Gällmo IT 17 034 Tryckt av: Reprocentralen ITC Daniel Ahlbom, Uppsala University 2017

Acknowledgements

I would like to express my deepest gratitude to the following: Professor Arne Andersson at Trade Extensions, for being my supervisor and introducing me to a project with great depth and learning opportunities; Dr. Fredrik Ygge at Trade Extensions, for being an advisor providing the guidance, discussions and problems necessary for making the project interesting; and Professor Di Yuan at Uppsala University, for providing much needed insights and taking the time and effort to criticize this report into legibility.

Quadratic Programming Models in Strategic Sourcing Optimization Page 1 of 37 Contents Daniel Ahlbom, Uppsala University 2017

Contents

1 Introduction 4

2 Background 5 2.1 Computing Strategic Sourcing ...... 5 2.2 Solving Computationally Hard Problems ...... 5 2.3 Mixed Integer ...... 5 2.4 Quadratic Programming ...... 6 2.5 Approximation ...... 6 2.6 Modeling with AMPL ...... 6

3 Comparison of MIP and QP in Sourcing Problems 9 3.1 Seller Discounts ...... 9 3.2 Supply Restrictions ...... 11 3.3 Regional Division ...... 16 3.4 Reserved Price ...... 20

4 Summary 24 4.1 Conclusion ...... 24 4.2 Future Work ...... 24

References 25

A Prerequisite knowledge 26 A.1 NP-completeness ...... 26 A.2 Linear Algebra ...... 26 A.3 Convex Functions and Sets ...... 27

B Experiments 28 B.1 Testing platform ...... 28 B.2 Datasets ...... 28 B.3 AMPL Implementations ...... 28 B.4 Tables ...... 35

Quadratic Programming Models in Strategic Sourcing Optimization Page 2 of 37 Glossary Daniel Ahlbom, Uppsala University 2017

Glossary

AMPL A Mathematical Programming Language: A modeling language suitable for Mixed Integer Programming (MIP) and Quadratic Programming (QP) solving technologies. Official site as of June 27, 2017: http://ampl.com/.

Constraint Boundaries that a solution must satisfy in order to be valid..

Decision variable Variables for which the value has to be determined in order to find a solution.

Gurobi A solver suitable for MIP and QP optimization. It supports convex and non-convex problems with continuous and non-continuous variables in any combination for MIP, while QP requires that the problem is convex, or that any variable-by-variable multiplication to consist of a binary variable on either side. Official site as of June 27, 2017: http://www.gurobi.com/.

Knitro A solver suitable for QP optimization using local search. It supports convex and non-convex problems with continuous and non-continuous variables in any combination. Official site as of June 27, 2017: https://www.artelys.com/en/optimization-tools/knitro.

LP Linear Programming: A solver technology where models are written using linear relations. Discussed in 2.3: Mixed Integer Linear Programming.

MiniSAT A solver suitable for Boolean Satisfiability Problem (SAT) problems. Official site as of June 27, 2017: http://www.minisat.se. MiniZinc A declarative, modeling, solver-independent modeling language suitable for a wide range of solvers. Official site as of June 27, 2017: http://www.minizinc.org/. MIP Mixed Integer Programming: A solver technology where models are written using linear formula. In contrast with Linear Programming (LP), integers are allowed, which increases the difficulty of finding solutions. Discussed in 2.3: Mixed Integer Linear Programming. Model A description of a problem suitable for a solver.

Objective function The function quantifying the quality of a solution. If the optimal solution is found by minimizing the objective function, a solution where the function returns the lowest possible value is optimal. Problems where the goal is to find an optimal solution according to an objective function: this is in contrast with satisfaction problem.

QP Quadratic Programming: A solver technology where models are written using quadratic relations. Dis- cussed in 2.4: Quadratic Programming.

SAT Boolean Satisfiability Problem:A satisfaction problems where a solution determines whether a boolean expression can be evaluated as true. Satisfaction problem Problems where the goal is to find any solution: the aim of this is usually to prove feasibility, that is, whether a solution exists for a dataset. Solver A program which accepts a model and finds an (optimal) solution: while there are many solver tech- nologies, the ones used in this report are MIP and QP.

Xpress A solver suitable for MIP and QP optimization. It supports convex and non-convex problems with continuous and non-continuous variables in any combination for MIP, while QP requires that the problem is convex. Official site as of June 27, 2017: http://www.fico.com/en/products/fico-xpress-optimization-suite/.

Quadratic Programming Models in Strategic Sourcing Optimization Page 3 of 37 Introduction Daniel Ahlbom, Uppsala University 2017

1 Introduction

When a business faces the issue of large-scale purchases, an optimization problem arises according to their requirements. The requirements may involve factors such as lowering costs, reducing environmental impact and increasing production speeds. As the scale of their purchases increase, so does computation time: depending on how the problem is expressed, finding an optimal solution in a naive way may require hundreds of thousands of years, despite state-of-the-art computational power. However, as the scale increases, potential improvements according to requirements may increase as well. In this report, the use of strategic sourcing by expressing the problems for use with advanced algorithms allows for finding optimal solutions within feasible time-frames. The methods involve combinatorial optimization, by use of high-level models that are interpreted by solvers: software implementing sets of algorithms specialized in finding solutions to computationally complex problems. The solver softwares cover a spectrum of different problems and implementations, being continuously researched and improved. This motivates continuous re-evaluation of the most suitable methods of solving specific problems. While strategic sourcing problems allow for efficient use with MIP – expressing the problems in terms of linear relations with integer variables – they can be intuitively expressed in terms of QP, which allows for use of quadratic relations as well. The aim of this report is to investigate the comparitive efficiency of modern versions of MIP and QP solvers for strategic sourcing problems.

Quadratic Programming Models in Strategic Sourcing Optimization Page 4 of 37 Background Daniel Ahlbom, Uppsala University 2017

2 Background 2.1 Computing Strategic Sourcing Strategic sourcing considers the purchase of products from a number of sellers. Large companies encounter sourcing problems of different kinds and complexity. In its simplest form, the problem requires no more effort than to find the best price for each product from each seller. This allows for problem solving in linear time: each price of each product only has to be considered once. In real-life situations, this method may prove to be infeasible. While an optimal solution could allow for a small purchase from hundreds of sellers, this may be highly impractical due to increased management complexity. Sellers may provide discounts. Some products may have regional restrictions. Adding such restrictions to the problem risk making it necessary to consider combinations of sources, in order to find an optimal solution. This quickly increases computation time. For example, with s sellers and p products, there are ps arrangements – given that each product is assigned at most single seller. At 15 products and 20 sellers, looking at each possible combination requires approximately 219523 years, 1 given 4.8 · 1010 solutions per second.2 On the other hand, finding an optimal solutions may provide significantly better results, according to a customer’s requirements. A case study – using similar methods to those discussed in this report – shows how Procter & Gamble reduced costs of display manufacturing by 48% annually, translating to nearly $67 million, along with many other benefits [1]. Using an electronic reverse auction [2], sellers can bid their offers using online services; this provides data suitable for more advanced solution methods, in turn allowing for more clever problem solving methods.

2.2 Solving Computationally Hard Problems When encountering problems for which naive algorithms lead to exponentially increasing computing times, solutions may be more efficiently found by constructing a model for use with a solver. When using brute-force algorithms, NP-complete problems – see Appendix A.1 for a refresher – quickly become impossible to solve within useful timeframes in real-life instances. In order to solve such instances, much more efficient methods are required. One such method involves expressing the problem in termsofa different problem, in this context denoted a model. Any NP-complete problem can be reduced to some other NP-complete problem in polynomial time [3]. Modeling languages such as MiniZinc and A Mathematical Programming Language (AMPL) allow for expressing a problem such that it is interpreted by a solver — software specializing in solving specific problem types. There are many different solvers created for different problems by different companies. For example, SAT solvers such as MiniSAT [4] specialize in satisfiability of boolean expressions, while LP solvers, as used in this report, are particularly efficient in satisfying and finding optimal solutions for sets of linear relations. While using a solver allows for utilizing powerful algorithms with a minimal number of declarations, it is not necessarily trivial nor suitable to express a specific problem in terms of another. The solvers technologies discussed in this report use MIP and QP.

2.3 Mixed Integer Linear Programming A LP model of a linear optimization problem is expressed as follows [3, 5, 6]:

Minimize cT x (1) Subject to Ax ≤ b x ≥ 0 (2)

For a reminder of and vector multiplication, see Appendix A.2. The terms are defined as follows: • x is a vector of decision variables: the goal of the problem is achieved by finding the best possible combination of values for these. • A is a matrix of known constants. • b and c are vectors of known constants. • (1) is the objective function. • (2) are the constraints.

20 1 15 ≈ 219522.9734728223 4.8·1010·60·60·24·365.25 2For example, using a 4 Ghz 16-core processor.

Quadratic Programming Models in Strategic Sourcing Optimization Page 5 of 37 Background Daniel Ahlbom, Uppsala University 2017

When decision variables are required to be integers, it is denoted a MIP model. As efficient algorithms for LP rely on continuity of variables to find extreme points of polytopes [6], MIP tends to be significantly slower.

2.4 Quadratic Programming The general form of a quadratic program is stated as follows [5, 6]:

1 Minimize xTAx + xTc (3) 2 Subject to Ax ≤ b x ≥ 0 (4)

For a reminder of matrix and vector multiplication, see Appendix A.2. The terms are defined as follows:

• x is a vector of decision variables. • A ∈ Rn×n is a of known constants, where each side is the size of x. • b and c are vectors of known constants. • (3) is the objective function.

• (4) are the constraints. If A is not a positive – discussed in Appendix A.3 – the objective function is non-convex, resulting problem becomes much more complex [5]. For example, solving with the interior point method, used by [7], does not guarantee finding the global optimum [8, 9] in this case. Certain solvers, such as Gurobi, allow for finding the global optimum in non-convex QP problems when the problem is formulated such that a multiplication x1 · x2 restricts x1 or x2 to binary values [9].

2.5 Approximation In certain cases, optimization problems can be solved such that a near-optimal solution can be found with significantly shorter runtimes. Depending on the method, approximation can be accomplished within a proven percentage. For example, using a branch-and-bound algorithm, an accepted gap may be set according to the allowed value. Problem- specific approximation can also be applied. The discount problem discussed in 3.1: Seller Discounts, where sellers can provide a discount if a purchase surpasses a certain threshold, can be expressed approximately without having a discount at all. This allows for finding a solution in linear time, as the optimal solution would trivially be achieved by finding the lowest price of each product sold by each seller. Integer relaxation is an approximation method that can indicate optimal solutions. This is done by con- sidering all integer variables as continuous. In some cases, especially for MIP problems, this may significantly reduce runtimes. There are, however, cases where integer relaxation is not applicable. For example, constraints with binary variables are used in 3.4: Reserved Price in such that making the results of integer relaxation useful would generate a new problem of similar complexity.

2.6 Modeling with AMPL AMPL [10] is a high-level language for constructing mathematical models for use with solvers. While writing models according to the restrictions inherent in a solving technology may be difficult, un- derstanding a model is fairly intuitive. It also allows for both MIP and QP models to be interpreted. It is therefore suitable for the purposes of this report.

2.6.1 File structure AMPL’s file structure consists ofa model file, as well asa dataset. This allows for a single model to be reused with any number of compatible sets of data. It also makes the model more managable, as larger datasets may contain thousands of lines.

Quadratic Programming Models in Strategic Sourcing Optimization Page 6 of 37 Background Daniel Ahlbom, Uppsala University 2017

2.6.2 Syntax Models are written using the following syntax:

• param defines a parameter, i e a constant for which a value is usually defined in a dataset. • set defines a range of numbers, this is useful in the context of a for-all statement. • var defines a decision variable. • Parameters and variables are defined as arrays by declaring the set it spans within curly brackets. For example, a two-dimensional array sharing sizes with sets Products and Sellers is declared using {Products,Sellers}. • Valid ranges for parameters and variables, as used in this report, are defined using >,>=,<=,<,binary (strictly greater than, greater than, less than, strictly less than and binary – {0, 1} values – respectively).

• The objective function is written using minimize or maximize, followed by a function. • Constraints are declared following the marker subject to. A “for all i in S” statement, is set using {i in S}: hconstrainti. • Both objective function and constraints can be prefixed by a name, preceding the : symbol, or for-all statement.

• Comments follow the hashtag symbol #.

2.6.3 Example A short example demonstrates a model according to the following:

• n_products is the number of products. • n_sellers is the number of sellers. • m_sellers is the allowed number of sellers from which to order. • Price[i,j] is the price of product i from seller j. • The objective is to minimize the total cost of purchases. • The problem is constrained by requiring all products to be purchased and the number of sellers.

To solve this, two sets of variables are used: Order[i,j] corresponds to the amount product i is ordered from seller j and SellerOrder is set such that, if there is an order from seller i, SellerOrder[i] = 1. The resulting model is shown in Listing 1.

Listing 1: An example model written in AMPL 1 ### CONSTANTS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 param m_sellers; # Allowed number of sellers 5 6 # Sets allow convenient descriptions 7 set Products := 1..n_products; # Set of products 8 set Sellers := 1..n_sellers; # Set of sellers 9 10 # Price[i,j] is price of product i from seller j 11 param Price {Products,Sellers} >= 0; 12 13 14 ### VARIABLES ### 15 # Order[i,j] describes amount product i is ordered from seller j 16 var Order {Products,Sellers} >= 0, <= 1; 17 18 # SellerOrder[j] == 1 iff there is an order from seller j 19 var SellerOrder {Sellers} binary; 20 21

Quadratic Programming Models in Strategic Sourcing Optimization Page 7 of 37 Background Daniel Ahlbom, Uppsala University 2017

22 ### OBJECTIVE ### 23 # Sum of all orders subtracted by sum of all discounts 24 minimize totalCost: 25 (sum {i in Products} Order[i,j]*Price[i,j]); 26 27 28 ### CONSTRAINTS ### 29 subject to 30 31 # Sum of orders for each product must exceed 1 32 eachProductOrdered {i in Products}: 33 (sum {j in Sellers} Order[i,j]) >= 1; 34 35 # Satisfy order limit: sum of enlisted sellers must be less than limit. 36 countSellers: 37 (sum {j in Sellers} SellerOrder[j]) <= m_sellers; 38 39 # Mark sellers with orders: if Order[i,j] > 0, SellerOrder[j] must be 1 40 setSellerOrder {i in Products , j in Sellers}: 41 SellerOrder[j] >= Order[i,j];

Quadratic Programming Models in Strategic Sourcing Optimization Page 8 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

3 Comparison of MIP and QP in Sourcing Problems

A comparison of MIP and QP was done by constructing a problem in 3.1: Seller Discounts, followed by three extensions providing a wider base of testing in a sourcing context. The sourcing discount problem occurs in a context where a number of sellers offer products at a discounted price following a certain order size. This creates a problem of significantly greater complexity, than one where simply selecting the seller providing the lowest price for each product. Since the three problems following the first share many similarities, 3.1: Seller Discounts contains a more in-depth explanation. All problems were implemented in AMPL followed by practical experiments calculating both exact and approximate solutions. The solvers used were Knitro (efficient for QP solving [5]), Gurobi (QP and MIP) and FICO Xpress (MIP only, due to solver limitations). Exact solutions were found using Gurobi and Xpress with default parameters. Approximative solutions for the problems were found using the following: Max cross iterations An option in Knitro allowing for further optimization by use of the solver’s Cross Iteration algorithm. This can provide more exact results at cost of increased computation time. Increased optimality gap An option in both Gurobi and Xpress setting the relative threshold by which a solution is accepted as optimal using the branch-and-bound algorithm. For example, a 5% optimality gap accepts a solution that is at most within 5% of optimum. The default value, in this context considered the global optimum, is at 0.01% in both solvers. This can also be set to an absolute value. Since Gurobi essentially uses the binary nature of the variables to convert QP models for use with MIP algorithms, the improvements made by increasing the optimality gap is very similar for both models. Therefore, only MIP models in Gurobi were tested using this parameter. No discount condition A trivial modification of the model, removing all constraints and subtractions allow- ing for discounting of problems. Disregarding discounts can, in some instances, provide nearly optimal results while immensely simplifying the problem. Integer relaxation (applicable in discount problem only) A solver option available in all solvers, allowing non-continuous variables to be regarded as continuous. This causes most constraints to be incorrectly fulfilled, which is why results are only applicable to the discount problem. While relaxation significantly improves runtime, most discount conditions are left unfulfilled in practice, leading to a higher actual cost compared to what the solver expects. An advanced improvement for this would require an auxiliary solution to attempt increasing purchases from sellers from which the discount is nearly applied.

3.1 Seller Discounts Consider a seller discount problem as follows: a number of sellers provide products we have to purchase, where following specific thresholds a company may provide a discount. The objective is to minimize the totalcost. The problem can be defined according to the following constants: • Let set P represent all products such that P = {i ∈ N | 1 ≤ i ≤ |P |}. • Let set S represent all sellers such that S = {j ∈ N | 1 ≤ j ≤ |S|}.

|P |×|S| • A two-dimensional array C ∈ describes cost Ci,j for product i when provided by seller j, where Ci,j > 0. If seller i does not provide product i, the cost is set to Ci,j = −1.

|P |×|S| • A two-dimensional array D ∈ R describes the possible discount Di,j for product i when provided by seller j, where Di,j > 0. • A two-dimensional array D0 = C − D describes the discounted price for each product, such that each 0 − element Di,j = Ci,j Di,j.

|S| • A one-dimensional array T ∈ N contains the discount threshold Tj ∈ T for each seller j, such that if the total cost of an order from j exceeds Tj a discount is provided for all purchases from j.

3.1.1 MIP Model A linear formulation of this problem defines three variable arrays:

|P |×|S| • A two-dimensional array X ∈ R of real values 0 ≤ Xi,j ≤ 1 where Xi,j is the proportional amount of product i ordered from seller j.

|P |×|S| • A two-dimensional array Y ∈ R of real values 0 ≤ Yi,j ≤ 1 where Yi,j = Xi,j if the discount is applied for seller j and product i is purchased from them.

Quadratic Programming Models in Strategic Sourcing Optimization Page 9 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

|S| • A one-dimensional array Z ∈ N of binary values Zj ∈ {0, 1} where Zj = 1 if the discount is applied for seller j. This allows for a description of the problem as follows: ∑ ∑ ∑ ∑ Minimize Ci,j · Xi,j − Di,j · Yi,j (5) i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Xi,j ≥ 1 (6) j∈S ( ∑ ) ∀j ∈ S Ci,j · Xi,j − Zj · Tj ≥ 0 (7) i∈P ( ) ∀i ∈ P, j ∈ S X − Y ≥ 0 (8) ( i,j i,j ) ∀i ∈ P, j ∈ S Z − Y ≥ 0 (9) ( j i,j ) ∀i ∈ P, j ∈ S Ci,j · Xi,j ≥ 0 (10) Where the relations define the following: (5) is the objective, i e total cost, found by the sum of all orders subtracted by the sum of all discounts. (6) ensures each product is ordered, by ensuring that the sum of all orders of each product is at least 1. (7) is the discount condition: for each seller j, the sum of the order must be at least that of their thresholds multiplied by the binary variable Zj. (8) sets that discounts are only provided for purchased products: the condition only holds if the discounted amount is at most the ordered amount. The more intuitive statement Xi,j = Yi,j would not hold if no discount is provided. (9) assures discounts are only provided for a product iff the discount condition for the seller is met: if no discount is provided, i e Zj = 0, then Yi,j = 0 as well. (10) sets that purchases can only be made when a seller provides the product: if a product i is not provided by seller j, then Ci,j = −1. Therefore, Ci,j · Xi,j < 0 if Xi,j > 0, breaking the constraint. To satisfy the constraint in such a case, Xi,j = 0.

3.1.2 QP Model A quadratic formulation of this problem defines two variable arrays: |P |×|S| • A two-dimensional array X ∈ R of real values 0 ≤ Xi,j ≤ 1 where Xi,j is the proportional amount of product i ordered from seller j. This corresponds to the variable of the same name in the MIP formulation

|S| • A one-dimensional array Y ∈ N of binary values Yj ∈ {0, 1} where Yj = 1 if the discount is not applied for seller j. This allows us to describe the problem as follows, with many similarities to the 3.1.1: MIP Model: ∑ ∑ ∑ ∑ 0 · · · Minimize Di,j Xi,j + Di,j Xi,j Yj (11) i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Xi,j ≥ 1 (12) j∈S ( ∑ ∑ ) ∀ ∈ 0 · · − · − ≥ j S Di,j Xi,j + Di,j Xi,j Tj (1 Yj) 0 (13) i∈P ( i∈P) ∀ ∈ ∈ 0 · ≥ i P, j S Di,j Xi,j 0 (14) (11) is the objective, i e total cost: this is calculated by the sum of discounted prices and the corresponding discounts (equivalent of difference to the full cost). (12) ensures each product is ordered, corresponding to (6).

(13) is the discount condition: contrary to (7), if the total order of a seller i does not exceed the threshold, Yj must be set to 0. (14) sets that purchases can only be made when a seller provides the product, corresponding to (10).

Quadratic Programming Models in Strategic Sourcing Optimization Page 10 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Objective values for the seller discount problem

Knitro (QP) Knitro (QP), mcit1 Knitro (QP), mcit2 Gurobi (QP) Gurobi (MIP) Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap Gurobi (MIP), no discount

Setting Gurobi (MIP), relaxed Xpress (MIP) Xpress (MIP), 5% gap Xpress (MIP), 10% gap Xpress (MIP), no discount Xpress (MIP), relaxed

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Objective values ·106

p100-s140-A p100-s140-C p100-s80-B p140-s100-A p140-s100-C p140-s120-B p100-s140-B p100-s80-A p100-s80-C p140-s100-B p140-s120-A p140-s120-C

Figure 1: Sum of objective values for all tested datasets in the seller discount problem, where pA-sB-C consists of A products, B sellers in instance C. Gurobi (QP), Gurobi (MIP) and Xpress (MIP) show proven optimality. Lower values are better.

3.1.3 Implementation Models for each solution was written in AMPL and are shown in Listing 2 and Listing 3, under Appendix B.3 for the MIP solution and QP solution respectively.

3.1.4 Results Figure 1 shows the sum of objective values for each solver method, allowing for an overview of how well the approximations compare to exact solutions. Table 1 shows the relative accuracy of each solution, allowing for a similar comparison at greater detail. Figure 2 allows for comparison of runtimes from the various methods. The entirety of test results are shown in Table 5, under Appendix B.4.

3.1.5 Discussion The results in Figure 2 show that there is some benefit in finding global optima using the QP model with Gurobi. The runtime improvements do however not differ by orders of magnitude, with the exception of a single tested instance. However, the difference in different solvers can affect runtimes more than the models: specifically, in instances p100-s140-A as well as p100-s140-C, Gurobi finds an optimal solution signficantly quicker than Xpress. Approximate solutions provide a negligible benefit for QP solving with Knitro. In this problem, crossover iterations do not significantly impact results. As shown in Figure 1, accuracy is only slightly better than Xpress solutions with 10% accuracy, while the runtimes do not differ significantly. Table 1 shows a more fine-grained comparison between the two: the difference in accuracy for respective solutions vary by problem instance, suggesting that neither method is uniformly superior. When relaxing MIP variables, the model allows for mistakenly applying discounts that are invalid. This, in turn, provides highly inaccurate results. A possible solution for this would be to fine-tune the resulting solution by transferring purchases from sellers further from having their discounts applied, to those nearly reaching their discount thresholds.

3.2 Supply Restrictions Not all sellers can be expected to provide an infinite supply. This may be reflected in a problem that restricts the size of purchases of a product from a specific seller.

Quadratic Programming Models in Strategic Sourcing Optimization Page 11 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Application runtimes for the seller discount problem

Knitro, no crossover it. 104 Knitro, max 1 crossover it. Knitro, max 2 crossover it. 103 Gurobi (QP) Gurobi (MIP) 102 Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap 101 Gurobi (MIP), no discount Gurobi (MIP) relaxed 0 Runtimes (s) 10 Xpress (MIP) Xpress (MIP), 5% gap − 10 1 Xpress (MIP), 10% gap Xpress (MIP), no discount −2 10 Xpress (MIP) relaxed

p100-s80-Ap100-s80-Bp100-s80-C p100-s140-Ap100-s140-Bp100-s140-C p140-s100-Ap140-s100-Bp140-s100-Cp140-s120-Ap140-s120-Bp140-s120-C Dataset

Figure 2: Runtimes in seconds for all tested datasets, where pAsB-C has A products and B sellers for an instance C. Gurobi (QP), Gurobi (MIP), Xpress (MIP) found proven optimality and have filled markers. Lower values are better. The figure is provided in logarithmic scale as different methods provide results that differ in several orders of magnitude. Knitro runtimes are similar, resulting in overlaps in the figure. The same is true for the two different gap settings in Gurobi. Exact results are shown in Table 5.

Solver Settings Dataset p100-s140-A p100-s140-B p100-s140-C p100-s80-A p100-s80-B p100-s80-C p140-s100-A p140-s100-B p140-s100-C p140-s120-A p140-s120-B p140-s120-C None 7.24% 8.89% 9.16% 6.71% 7.40% 7.66% 6.16% 3.25% 8.14% 4.47% 6.78% 4.39% Knitro Max 1 cross it. 7.24% 8.89% 9.16% 6.71% 7.40% 7.66% 6.16% 3.25% 8.14% 4.47% 6.78% 4.39% Max 2 cross it. 5.33% 8.89% 9.16% 6.71% 7.40% 7.66% 6.16% 3.25% 8.14% 4.47% 7.05% 4.39% QP 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% MIP, int. 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% MIP, 5% gap 1.70% 0.80% 2.61% 0.19% 2.97% 2.52% 0.91% 1.50% 1.19% 2.47% 0.42% 0.78% Gurobi MIP, 10% gap 1.70% 0.80% 2.61% 0.19% 2.97% 2.52% 0.91% 6.49% 1.19% 2.47% 0.42% 0.78% MIP, no disc. 26.97% 26.98% 27.35% 26.37% 26.87% 26.42% 26.24% 26.73% 27.10% 25.91% 26.05% 26.12% MIP, rel. 45.83% 46.20% 46.17% 45.35% 45.56% 45.31% 45.30% 45.81% 46.04% 44.77% 45.32% 45.16% None 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 5% gap 2.93% 2.87% 2.39% 0.70% 1.39% 0.16% 1.95% 1.92% 3.89% 1.76% 3.21% 2.20% Xpress 10% gap 9.98% 9.21% 7.58% 7.60% 7.89% 8.93% 8.61% 1.92% 9.44% 8.11% 7.12% 8.73% No disc. 26.97% 26.98% 27.35% 26.37% 26.87% 26.42% 26.24% 26.73% 27.10% 25.91% 26.05% 26.12% Rel. 45.83% 46.20% 46.17% 45.35% 45.56% 45.31% 45.30% 45.81% 46.04% 44.77% 45.32% 45.16%

Optimal 71734.19 69054.30 69955.39 71238.80 72483.11 72426.68 100189.75 100633.70 101961.60 100100.39 102388.86 100192.48

Table 1: Accuracy of the objective values of the seller discount problem. Each cell shows how much larger the objective value of a solution is compared to the proven optimality of each dataset. An optimum solution shows exactly 0%, while larger values suggest less accuracy.

Quadratic Programming Models in Strategic Sourcing Optimization Page 12 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Additionally, a seller may restrict their dependency on a specific company: another requirement restricting the total order from each seller is therefore added. In addition to the constants defined in 3.1: Seller Discounts, we add the following, including the modified array C:

• A two-dimensional array A describes the possible amount Ai,j of a product i sold by a seller j, where Ai,j = 1 suggests the full required amount can be purchased, while Ai,j = 0 means that the seller does not provide the product at all.

• A one-dimensional array B describes the total price Bj a seller j will accept.

3.2.1 MIP Model We use the same decision variables as the 3.1.1: MIP Model for 3.1: Seller Discounts. This allows us to describe the problem as follows:

∑ ∑ ∑ ∑ Minimize Ci,j · Xi,j − Di,j · Yi,j (15) i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Xi,j ≥ 1 (16) j∈S ( ∑ ) ∀j ∈ S Ci,j · Xi,j − Zj · Tj ≥ 0 (17) i∈P ( ) ∀i ∈ P, j ∈ S X − Y ≥ 0 (18) ( i,j i,j ) ∀i ∈ P, j ∈ S Z − Y ≥ 0 (19) ( j i,j ) ∀i ∈ P, j ∈ S Ai,j − Xi,j ≥ 0 (20) ( ∑ ) ∀j ∈ S Bj − Ci,j · Xi,j ≥ 0 (21) i∈P Where the relations define the following: (15) is the objective, i e total cost. (16) ensures each product is ordered. (17) is the discount condition. (18) sets that discounts are only provided for purchased products. (19) assures discounts are only provided for a product iff the discount condition for the seller is met. (20) limits purchases according to supply: this replaces the condition whether an item is sold at all. (21) limits purchases according to permitted level.

3.2.2 QP Model We use the same decision variables as 3.1.2: QP Model for 3.1: Seller Discounts., which describes the problem using the following statements.

∑ ∑ ∑ ∑ 0 · · · Minimize Di,j Xi,j + Di,j Xi,j Yj (22) i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Xi,j ≥ 1 (23) j∈S ( ∑ ∑ ) ∀ ∈ 0 · · − · − ≥ j S Di,j Xi,j + Di,j Xi,j Tj (1 Yj) 0 (24) i∈P ( i∈P ) ∀i ∈ P, j ∈ S Ai,j − Xi,j ≥ 0 (25) ( ∑ ∑ ) ∀ ∈ − 0 · − · · j S Bj Di,j Xi,j Di,j Xi,j Yj >= 0 (26) i∈P i∈P Where each statement considers the following:

Quadratic Programming Models in Strategic Sourcing Optimization Page 13 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Objective values for the supply problem

Knitro (QP) Knitro (QP), mcit1 Knitro (QP), mcit2 Gurobi (QP) Gurobi (MIP) Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap

Setting Gurobi (MIP), no discount Xpress (MIP) Xpress (MIP), 5% gap Xpress (MIP), 10% gap Xpress (MIP), no discount

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Objective values ·106

p60-s100-A p60-s100-C p80-s60-B p100-s60-A p100-s60-C p100-s80-B p60-s100-B p80-s60-A p80-s60-C p100-s60-B p100-s80-A p100-s80-C

Figure 3: Sum of objective values for all tested datasets in the supply problem, where pA-sB-C consists of A products, B sellers in instance C. Gurobi (QP), Gurobi (MIP) and Xpress (MIP) show proven optimality. Lower values are better.

(22) is the objective, i e minimizing total cost. (23) ensures each product is ordered.

(24) is the discount condition. (25) limits purchases according to supply: this replaces the condition whether an item is sold at all. (26) limits purchases according to permitted level.

3.2.3 Implementation Models for each solution was written in AMPL. Models are shown in Listing 4 and Listing 5 for the MIP solution and QP solution respectively. The approximative models differ only by setting the binary variable to continuous.

3.2.4 Results Figure 3 shows the sum of objective values for each solver method, allowing for an overview of how well the approximations compare to exact solutions. Table 2 shows the relative accuracy of each solution, allowing for a similar comparison at greater detail. Figure 4 allows for comparison of runtimes from the various methods. The entirety of test results are shown in Table 6, under Appendix B.4.

3.2.5 Discussion Similar to in 3.1: Seller Discounts, results for this problem show that solving without discounts requires siginificantly less time than finding optimal solutions, while other approximations are placed somewherein between. Figure 3 shows that approximate solutions found with Knitro roughly correspond to objective values between the 5% and 10% gap tolerances tested with MIP solvers. Runtimes using Knitro are consistently slower than for corresponding MIP approximations in datasets with 60 products and 100 sellers, while the opposite is true for datasets with 100 products and 80 sellers. No discernable pattern is apparent for the remaining datasets. QP models in Gurobi appear to be the consistently quickest way to find optimal results, with small margins in most cases. It appears that neither QP nor MIP can provide a significant advantage in the seller supply problem.

Quadratic Programming Models in Strategic Sourcing Optimization Page 14 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Application runtimes for the supply problem

104 Knitro, no crossover it. Knitro, max 1 crossover it. 103 Knitro, max 2 crossover it. Gurobi (QP) 102 Gurobi (MIP) Gurobi (MIP), 5% gap 101 Gurobi (MIP), 10% gap Gurobi (MIP), no discount 100 Runtimes (s) Xpress (MIP) − Xpress (MIP), 5% gap 10 1 Xpress (MIP), 10% gap 10−2 Xpress (MIP), no discount

p80-s60-Ap80-s60-Bp80-s60-C p60-s100-Ap60-s100-Bp60-s100-C p100-s60-Ap100-s60-Bp100-s60-Cp100-s80-Ap100-s80-Bp100-s80-C Dataset

Figure 4: Runtimes in seconds for all tested datasets, where pAsB-C has A products and B sellers for an instance C. Gurobi (QP), Gurobi (MIP), Xpress (MIP) found proven optimality and have filled markers. Lower values are better. The figure is provided in logarithmic scale as different methods provide results that differ in several orders of magnitude.

Solver Settings Dataset p60-s100-A p60-s100-B p60-s100-C p80-s60-A p80-s60-B p80-s60-C p100-s60-A p100-s60-B p100-s60-C p100-s80-A p100-s80-B p100-s80-C None 1.82% 2.58% 4.17% 3.84% 3.40% 5.03% 1.96% 0.74% 3.99% 0.14% 2.56% 1.83% Knitro Max 1 cross it. 1.82% 2.58% 4.17% 3.84% 3.40% 5.03% 1.96% 0.74% 3.99% 0.14% 2.56% 1.83% Max 2 cross it. 1.82% 2.58% 4.17% 3.84% 3.40% 5.03% 1.96% 0.74% 3.99% 0.14% 2.56% 1.83% QP 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% MIP, int. 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% Gurobi MIP, 5% gap 2.55% 0.70% 1.89% 2.65% 0.12% 2.00% 2.78% 1.84% 0.60% 2.48% 3.33% 0.91% MIP, 10% gap 2.55% 0.70% 9.27% 2.65% 4.75% 9.35% 2.78% 1.84% 0.60% 3.77% 4.87% 9.26% MIP, no disc. 24.42% 23.53% 24.41% 22.69% 22.64% 23.76% 22.89% 22.67% 22.76% 22.30% 22.66% 22.96% None 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 5% gap 2.55% 0.70% 1.76% 2.65% 0.84% 2.73% 2.78% 2.93% 0.60% 2.78% 3.65% 2.55% Xpress 10% gap 2.55% 0.70% 9.27% 2.65% 8.17% 9.35% 2.78% 2.93% 0.60% 7.61% 3.65% 2.55% No disc. 24.42% 23.53% 24.41% 22.69% 22.64% 23.76% 22.89% 22.67% 22.76% 22.30% 22.66% 22.96%

Optimal 44441.56 45250.31 45840.41 57937.72 58823.45 58739.54 75484.18 74694.82 74074.37 75272.57 71827.11 74792.74

Table 2: Accuracy of the objective values of the seller supply problem. Each cell shows how much larger the objective value of a solution is compared to the proven optimality of each dataset. An optimum solution shows exactly 0%, while larger values suggest less accuracy.

Quadratic Programming Models in Strategic Sourcing Optimization Page 15 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

3.3 Regional Division Ordering products from a seller brings some overhead: an optimized minimum cost may result in an impractical number of sellers to manage. This problem is of particular interest when a company requires purchases to be made for a larger amount of regions: for example, a small number of national sellers can be more managable than a large number of local sellers. This is, however, not always a possibility: for example, there may be a policy that requires a certain class of wares to be locally produced. Another interpretation may be in a multinational context: global corporations may deliver products to certain countries, but not all. The problem can be defined according to the following constants: • Let set P represent all products such that P = {i ∈ N | 1 ≤ i ≤ |P |}.

• Let set S represent all sellers such that S = {j ∈ N | 1 ≤ j ≤ |S|}. • Let set R represent all regions such that R = {k ∈ N | 1 ≤ k ≤ |R|}.

|P |×|S|×|R| • A three-dimensional array C ∈ R describes cost Ci,j,k for product i when provided by seller j, where Ci,j,k > 0. If seller i does not provide product i, the cost is set to Ci,j,k = −1.

|P |×|S|×|R| • A three-dimensional array D ∈ R describes the possible discount Di,j,k for product i when provided by seller j, where Di,j,k > 0. • A three-dimensional array D0 = C − D describes the discounted price for each product, such that each 0 − element Di,j,k = Ci,j,k Di,j,k.

• A two-dimensional array Q of size |P | × |R| describes the number of units Qi,k required of a product i in region k. If Qi,j = 0, the product is not required in this region.

• A one-dimensional array L of size |R| describes the limit Lk of total sellers serving a single region k. • A constant l describes the total amount of sellers allowed across all regions.

3.3.1 MIP Model We use decision variables similar to the 3.1.1: MIP Model for 3.1: Seller Discounts.

|P |×|S|×|R| • A three-dimensional array X ∈ R of real values 0 ≤ Xi,j where Xi,j,k is the ordered amount of product i from seller j in region k.

|P |×|S|×|R| • A three-dimensional array Y ∈ R of real values 0 ≤ Yi,j where Yi,j,k = Xi,j,k if the discount is applied for seller j and product i is purchased from them in region k.

|S| • A one-dimensional array Z ∈ N of binary values Zj ∈ {0, 1} where Zj = 1 if the discount is applied for seller j.

|S|×|R| • A two-dimensional array U ∈ N of binary values Uj,k ∈ {0, 1} where Uj,k = 1 if seller j has an order in region k.

|S| • A one-dimensional array V ∈ N of binary values Vj ∈ {0, 1} where Vj = 1 if seller j has any order.

This allows us to describe the problem as follows:

Quadratic Programming Models in Strategic Sourcing Optimization Page 16 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

∑ ∑ ∑ ∑ ∑ ∑ Minimize Ci,j,k · Xi,j,k − Di,j,k · Yi,j,k (27) i∈P j∈S k∈R i∈P j∈S k∈R ( ∑ ) Subject to ∀i ∈ P, ∀k ∈ R Xi,j,k − Qi,k ≥ 0 (28) j∈S ( ∑ ∑ ) ∀j ∈ S Ci,j,k · Xi,j,k − Zj · Tj ≥ 0 (29) i∈P k∈R ( ) ∀i ∈ P, j ∈ S, k ∈ R X − Y ≥ 0 (30) ( i,j,k i,j,k ) ∀i ∈ P, j ∈ S Q · Z − Y ≥ 0 (31) i,k ( i,j i,j,k ) ∀i ∈ P, j ∈ S, k ∈ R C · X ≥ 0 (32) ( i,j,k i,j,k ) ∀i ∈ P, j ∈ S, k ∈ R Uj,k · Qi,k − Xi,j,k ≥ 0 (33) ( ∑ ) ∀k ∈ R Uj,k − Lk ≤ 0 (34) ∈ j S ( ) ∀j ∈ S, k ∈ R V − U ≥ 0 (35) ( j ) j,k ∀j ∈ S Vj − l ≤ 0 (36)

Where the relations define the following: (27) is the objective, i e total cost. (28) ensures each product is ordered. (29) is the discount condition.

(30) sets that discounts are only provided for purchased products. (31) assures discounts are only provided for a product iff the discount condition for the seller is met. (32) sets that purchases can only be made when a seller provides the product.

(33) sets whether a seller has an order in a region. (34) limits sellers in a region. (35) sets whether a seller has any order. (36) limits total number of sellers.

3.3.2 QP Model We use decision variables similar to the 3.1.2: QP Model for 3.1: Seller Discounts.

|P |×|S|×|R| • A three-dimensional array X ∈ R of real values 0 ≤ Xi,j where Xi,j,k is the ordered amount of product i from seller j in region k.

|S| • A one-dimensional array Y ∈ N of binary values Yj ∈ {0, 1} where Yj = 1 if the discount is not applied for seller j.

|S|×|R| • A two-dimensional array U ∈ N of binary values Uj,k ∈ {0, 1} where Uj,k = 1 if seller j has an order in region k.

|S| • A one-dimensional array V ∈ N of binary values Vj ∈ {0, 1} where Vj = 1 if seller j has any order.

Quadratic Programming Models in Strategic Sourcing Optimization Page 17 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

∑ ∑ ∑ ∑ ∑ ∑ 0 · · · Minimize Di,j Xi,j,k + Di,j,k Xi,j,k Yj (37) i∈P j∈S k∈R i∈P j∈S k∈R ( ∑ ) Subject to ∀i ∈ P, ∀k ∈ R Xi,j,k − Qi,k ≥ 0 (38) j∈S ( ∑ ∑ ) ∀ ∈ 0 · − · − ≥ j S (Di,j,k + Di,j,k) Xi,j,k Tj (1 Yj) 0 (39) i∈P k∈R ( ) ∀i ∈ P, j ∈ S, k ∈ R D0 · X ≥ 0 (40) ( i,j,k i,j,k ) ∀i ∈ P, j ∈ S, k ∈ R Uj,k · Qi,k − Xi,j,k ≥ 0 (41) ( ∑ ) ∀k ∈ R Uj,k − Lk ≤ 0 (42) ∈ j S ( ) ∀j ∈ S, k ∈ R V − U ≥ 0 (43) ( j ) j,k ∀j ∈ S Vj − l ≤ 0 (44)

(37) is the objective, i e total cost. (38) ensures each product is ordered.

(39) is the discount condition. (40) sets that purchases can only be made when a seller provides the product. (41) sets whether a seller has an order in a region. (42) limits sellers in a region.

(43) sets whether a seller has any order. (44) limits total number of sellers.

3.3.3 Implementation Models for each solution were written in AMPL. The models are shown in Listing 6 and Listing 7 for the MIP solution and QP solution respectively. The approximative models differ only by setting the binary variable to continuous.

3.3.4 Results Figure 5 show the sum of objective values for each solver method, allowing for an overview of how well the approximations compare to exact solutions. Figure 6 allows for comparison of runtimes from the various methods. The entirety of test results are shown in Table 7, under Appendix B.4.

3.3.5 Discussion In this subproblem, the QP model performs unevenly with Gurobi, in comparison with the other tested methods for finding optimal solutions, while the QP model performs significantly slower with Knitro than all other configurations, including all three set-ups finding proven optimality. In contrast with experiments in both 3.1: Seller Discounts and 3.2: Supply Restrictions, Knitro does find solutions very close to optimality, even when compared to MIP configurations with 5% and 10% gap tolerances. Since QP algorithms have a tendency to become inefficient for a large number of variables [5], it is possible that the three-dimensional arrays constructed for this problem cause the longer runtimes. Meanwhile, Gurobi and Xpress are likely able to use conventional MIP algorithms, handling larger variable arrays with less issues. Further, they are likely to exploit the restricted amounts of sellers, which further cuts down the search space. The QP model used with Gurobi still shows comparable, but not superior, runtimes for optimal solutions. For this subproblem, there is no compelling argument to be made in favor of QP, based on the experiments.

Quadratic Programming Models in Strategic Sourcing Optimization Page 18 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Objective values for the regions problem

Knitro (QP) Knitro (QP), mcit1 Knitro (QP), mcit2 Gurobi (QP) Gurobi (MIP) Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap

Setting Gurobi (MIP), no discount Xpress (MIP) Xpress (MIP), 5% gap Xpress (MIP), 10% gap Xpress (MIP), no discount

0 1 2 3 4 5 6 7 Objective values ·106

p10-s10-r30-A p10-s10-r30-C p10-s40-r5-B p20-s20-r15-A p20-s20-r15-C p40-s20-r10-B p10-s10-r30-B p10-s40-r5-A p10-s40-r5-C p20-s20-r15-B p40-s20-r10-A p40-s20-r10-C

Figure 5: Sum of objective values for all tested datasets in the regions problem, where pA-sB-C consists of A products, B sellers in instance C. Gurobi (QP), Gurobi (MIP) and Xpress (MIP) show proven optimality. Lower values are better.

Application runtimes for the regions problem

104 Knitro, no crossover it. 103 Knitro, max 1 crossover it. Knitro, max 2 crossover it. Gurobi (QP) 102 Gurobi (MIP) Gurobi (MIP), 5% gap 101 Gurobi (MIP), 10% gap Gurobi (MIP), no discount 0 Runtimes (s) 10 Xpress (MIP) Xpress (MIP), 5% gap −1 10 Xpress (MIP), 10% gap Xpress (MIP), no discount 10−2

p10-s40-r5-Ap10-s40-r5-Bp10-s40-r5-C p10-s10-r30-Ap10-s10-r30-Bp10-s10-r30-C p20-s20-r15-Ap20-s20-r15-Bp20-s20-r15-Cp40-s20-r10-Ap40-s20-r10-Bp40-s20-r10-C Dataset

Figure 6: Runtimes in seconds for all tested datasets, where pAsB-C has A products and B sellers for an instance C. Gurobi (QP), Gurobi (MIP), Xpress (MIP) found proven optimality and have filled markers. Lower values are better. The figure is provided in logarithmic scale as different methods provide results that differ in several orders of magnitude.

Quadratic Programming Models in Strategic Sourcing Optimization Page 19 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Solver Settings Dataset p10-s10-r30-A p10-s10-r30-B p10-s10-r30-C p10-s40-r5-A p10-s40-r5-B p10-s40-r5-C p20-s20-r15-A p20-s20-r15-B p20-s20-r15-C p40-s20-r10-A p40-s20-r10-B p40-s20-r10-C None 0.00% 0.01% 0.00% 0.71% 0.73% 0.66% 0.00% 0.06% 0.00% 0.07% 0.01% 0.05% Knitro Max 1 cross it. 0.00% 0.01% 0.00% 0.71% 0.73% 0.66% 0.00% 0.06% 0.00% 0.07% 0.01% 0.05% Max 2 cross it. 0.01% 0.02% 0.00% 1.18% 0.84% 0.37% 0.00% 0.06% 0.00% 0.07% 0.01% 0.05% QP 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% MIP, int. 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% Gurobi MIP, 5% gap 3.71% 3.57% 2.71% 0.00% 2.07% 0.21% 2.89% 2.57% 3.33% 1.31% 2.77% 1.84% MIP, 10% gap 3.71% 3.57% 2.71% 0.00% 2.07% 0.21% 2.89% 2.57% 3.33% 1.31% 2.77% 1.84% MIP, no disc. 10.19% 11.50% 11.25% 21.70% 20.71% 20.21% 17.92% 17.43% 18.43% 17.00% 17.48% 16.16% None 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 5% gap 0.93% 0.90% 1.66% 0.00% 2.33% 2.13% 1.11% 1.31% 1.19% 1.11% 1.68% 1.22% Xpress 10% gap 0.93% 0.90% 1.66% 0.00% 2.33% 2.13% 1.11% 1.31% 1.19% 1.11% 1.68% 1.22% No disc. 10.18% 11.50% 11.25% 21.70% 20.71% 20.21% 17.92% 17.43% 18.42% 17.00% 17.43% 16.20%

Optimal 633951.12 615860.60 610585.91 67197.00 89291.00 90525.51 553186.84 600235.42 571204.63 817514.62 797792.97 842267.85

Table 3: Accuracy of the objective values of the regions problem. Each cell shows how much larger the objective value of a solution is compared to the proven optimality of each dataset. An optimum solution shows exactly 0%, while larger values suggest less accuracy.

3.4 Reserved Price A special case appears where the number of sellers a customer will order from is highly limited. Consider a situation where a customer will purchase a number of products from one of two sellers. The first provides highly competitive prices for all products but one, which may be unavailable or sold at a very high cost. The other seller provides all products, but all are at a significantly higher price. In this case, a customer may want to consider ordering the competitively priced products from the first seller, while ordering the very last product by some other means. To implement this problem, a reserved price is introduced. For each product such that, if the total cost will be lowered by purchasing a product of this price, it is applied without increasing the number of sellers from which an order is made. In addition to the constants defined in 3.1: Seller Discounts, the following constants are defined. • A seller limit l that sets the highest total number of sellers.

• A one-dimensional array H of size P , where each entry Hi is the penalty, or reserved price, for not ordering a product from any of the defined sellers.

3.4.1 MIP Model We use the same decision variables as the 3.1.1: MIP Model for 3.1: Seller Discounts, with the following two additions.

|S| • A one-dimensional array V ∈ N of binary values Vj ∈ {0, 1} where Vj = 1 if seller j has any order.

|P | • A one-dimensional array W ∈ R of real values 0 ≤ Wi ≤ 1 where Wj ≥ 0 if a product is ordered from a different source.

This allows for a description of the problem as follows:

Quadratic Programming Models in Strategic Sourcing Optimization Page 20 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

∑ ∑ ∑ ∑ ∑ Minimize Wi · Hi + Ci,j · Xi,j − Di,j · Yi,j (45) i∈P i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Wi + Xi,j ≥ 1 (46) j∈S ( ∑ ) ∀j ∈ S Ci,j · Xi,j − Tj · Zj ≥ 0 (47) i∈P ( ) ∀i ∈ P, j ∈ S X − Y ≥ 0 (48) ( i,j i,j ) ∀i ∈ P, j ∈ S Z − Y ≥ 0 (49) ( j i,j ) ∀i ∈ P, j ∈ S C · X ≥ 0 (50) ( i,j i,j ) ∀i ∈ P, ∀j ∈ S V − X ≥ 0 (51) ∑ j i,j Vj − l ≤ 0 (52) j∈S Where the relations define the following: (45) is the objective, i e total cost. (46) ensures each product is ordered. (47) is the discount condition. (48) sets that discounts are only provided for purchased products. (49) assures discounts are only provided for a product iff the discount condition for the seller is met. (50) sets that purchases can only be made when a seller provides the product. (51) sets whether a seller has any order. (52) limits total number of sellers.

3.4.2 QP Model We use the same decision variables as the 3.1.2: QP Model for 3.1: Seller Discounts, with the following two additions. |S| • A one-dimensional array V ∈ N of binary values Vj ∈ {0, 1} where Vj = 1 if seller j has any order. |P | • A one-dimensional array W ∈ R of real values 0 ≤ Wi ≤ 1 where Wj ≥ 0 if a product is ordered from a different source.

∑ ∑ ∑ ∑ ∑ · 0 · · · Minimize Hi Wi + Di,j Xi,j + Di,j Xi,j Yj (53) i∈P i∈P j∈S i∈P j∈S ( ∑ ) Subject to ∀i ∈ P Wi Xi,j ≥ 1 (54) j∈S ( ∑ ∑ ) ∀ ∈ 0 · · − · − ≥ j S Di,j Xi,j + Di,j Xi,j Tj (1 Yj) 0 (55) i∈P ( i∈P) ∀i ∈ P, j ∈ S D0 · X ≥ 0 (56) ( i,j i,j ) ∀i ∈ P, j ∈ S V − X ≥ 0 (57) ∑ j i,j Vj − l ≤ 0 (58) j∈S (53) is the objective, i e total cost. (54) ensures each product is ordered. (55) is the discount condition. (56) sets that purchases can only be made when a seller provides the product. (57) sets whether a seller has any order. (58) limits total number of sellers.

Quadratic Programming Models in Strategic Sourcing Optimization Page 21 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Objective values for the reserved price problem

Knitro (QP) Knitro (QP), mcit1 Knitro (QP), mcit2 Gurobi (QP) Gurobi (MIP) Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap

Setting Gurobi (MIP), no discount Xpress (MIP) Xpress (MIP), 5% gap Xpress (MIP), 10% gap Xpress (MIP), no discount

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Objective values ·106

p150s100-A p150s100-C p100s150-B p50s100-A p50s100-C p100s50-B p150s100-B p100s150-A p100s150-C p50s100-B p100s50-A p100s50-C

Figure 7: Sum of objective values for all tested datasets in the reserved price problem, where pA-sB-C consists of A products, B sellers in instance C. Gurobi (QP), Gurobi (MIP) and Xpress (MIP) show proven optimality. Lower values are better.

3.4.3 Implementation Models for each solution were written in AMPL. The models are shown in Listing 8 and Listing 9 for the MIP solution and QP solution respectively.

3.4.4 Results Figure 7 shows the sum of objective values for each solver method, allowing for an overview of how well the approximations compare to exact solutions. Table 4 shows the relative accuracy of each solution, allowing for a similar comparison at greater detail. Figure 8 allows for comparison of runtimes from the various methods. Full results are shown in Table 8.

3.4.5 Discussion Similarly to observations in 3.3.5: Discussion, results for Gurobi and Xpress are favorable to those of Knitro. While QP with Knitro configurations consistently provides results near optimality, runtimes exceed those of Gurobi and Xpress by orders of magnitude in all tested datasets. Notably, allowing for 2 crossover iterations provides worse objective values – this may be explained by a floating point error. Further, approximations used with MIP configurations provide similarly promising results at even more improved runtimes. QP and MIP configurations in Gurobi provide generally similar runtimes, where the advantage varies by each dataset. Overall, this problem suggests that QP and MIP configurations are similarly powerful using Gurobi, while Knitro provides no proven optimality at worse runtimes.

Quadratic Programming Models in Strategic Sourcing Optimization Page 22 of 37 Comparison of MIP and QP in Sourcing Problems Daniel Ahlbom, Uppsala University 2017

Application runtimes for the reserved price problem

104 Knitro, no crossover it. Knitro, max 1 crossover it. 3 10 Knitro, max 2 crossover it. Gurobi (QP) 102 Gurobi (MIP) Gurobi (MIP), 5% gap Gurobi (MIP), 10% gap 101 Gurobi (MIP), no discount

Runtimes (s) Xpress (MIP) 100 Xpress (MIP), 5% gap Xpress (MIP), 10% gap 10−1 Xpress (MIP), no discount

p50s100-Ap50s100-Bp50s100-Cp100s50-Ap100s50-Bp100s50-C p150s100-Ap150s100-Bp150s100-Cp100s150-Ap100s150-Bp100s150-C Dataset

Figure 8: Runtimes in seconds for all tested datasets, where pAsB-C has A products and B sellers for an instance C. Gurobi (QP), Gurobi (MIP), Xpress (MIP) found proven optimality and have filled markers. Lower values are better. The figure is provided in logarithmic scale as different methods provide results that differ in several orders of magnitude.

Solver Settings Dataset p150s100-A p150s100-B p150s100-C p100s150-A p100s150-B p100s150-C p50s100-A p50s100-B p50s100-C p100s50-A p100s50-B p100s50-C None 0.00% 0.00% 0.92% 0.54% 0.00% 0.05% 0.00% 0.00% 0.00% 0.94% 0.00% 0.00% Knitro Max 1 cross it. 0.00% 0.00% 0.92% 0.54% 0.00% 0.05% 0.00% 0.00% 0.00% 0.94% 0.00% 0.00% Max 2 cross it. 1.13% 0.00% 1.24% 0.00% 0.00% 0.05% 0.99% 0.00% 0.00% 0.94% 0.00% 0.00% QP 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% MIP, int. 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% Gurobi MIP, 5% gap 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.03% 0.00% 0.00% MIP, 10% gap 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 8.86% 2.63% 0.00% MIP, no disc. 3.89% 2.37% 0.26% 1.90% 0.75% 1.29% 1.23% 6.41% 0.18% 4.40% 4.00% 0.66% None 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 5% gap 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% Xpress 10% gap 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% No disc. 3.89% 2.37% 0.26% 1.90% 0.75% 1.29% 1.23% 6.41% 0.18% 3.49% 4.00% 0.66%

Optimal 162661.05 216974.92 203646.79 122473.65 126080.31 129088.76 54149.66 52328.36 51603.81 71238.31 134949.40 127011.46

Table 4: Accuracy of the objective values of the reserved price problem. Each cell shows how much larger the objective value of a solution is compared to the proven optimality of each dataset. An optimum solution shows exactly 0%, while larger values suggest less accuracy.

Quadratic Programming Models in Strategic Sourcing Optimization Page 23 of 37 Summary Daniel Ahlbom, Uppsala University 2017

4 Summary 4.1 Conclusion Test results show that QP provides no significant benifit over MIP in solving the presented problems, with the used parameters. Solvers exploiting the binary nature of variables, allowing for finding optimal solutions in non-convex prob- lems, have lead to slightly increased efficiency in the experiments outlined in 3.1: Seller Discounts as well as 3.2: Supply Restrictions. In the following two experiments, results have been less consistent. Approximate solutions provide several considerations. Gurobi and Xpress allow for relaxing integer variables in MIP models, while relaxed integer variables in QP models were only allowed in Knitro for the tested problems. Further, the non-convex nature of the discussed problems do not allow for globally optimal solutions in QP models in Knitro, such that the solutions become locally optimal – essentially becoming approximations. These solutions have generally been comparable to applying an optimality gap between 5% and 10% in Gurobi and Xpress. The significant caveat in this case, however, is that no such gap can be guaranteed for general, non- convex QP problems. Considering runtimes, QP models in Knitro appear to perform similarly to comparable MIP approximations at best, while being consistently and significantly slower at worst. The latter is certainly the case in experiments discussed in 3.3: Regional Division and 3.4: Reserved Price. There are, however, many nuances to consider. For example, a model written in terms of QP may be more intuitively formulated and understood. If, for example, multiplication of binary variables is performed, a QP model appears to be likely to perform similarly to MIP model in finding a solution that is optimal, as shown in all four discussed problems, or within an increased global optimality gap. It may however be cumbersome to consider the limitations of what a solver allows for: at the time of writing, Xpress only accepts convex QP unless all variables are restricted to binary values [9]. To summarize, it appears that for the discussed problems and solvers, it is possible to write efficient MIP models that allow for finding solutions that are, at worst, nearly as good in terms of runtimes and optimality as QP.

4.2 Future Work Since there are a large amount of untested solvers, testing them all would be far beyond the scope of this report. Research in QP algorithms is being done continuously, which may quickly provide an advantage to solvers implementing the latest discoveries, while the same is true for MIP solvers. As such, the results found in this report may drastically differ in future versions of the same software. Generally, alltested solvers are considered state-of-the-art, suggesting that they incorporate what may be considered leading edge research. Since the software is proprietary, the details of their implementations are difficult to assess. Further, entirely different technologies such as constraint programming and local search allow for finding approximations and optimal solutions as well: since these are being continuously researched in a similar manner, considering the quality of these solvers could provide interesting results as well. Further experimentation with models and parameters could also provide significant benefits. It is difficult to prove whether a specific implementation of a problem is most efficient, in any aspect, as unknown approaches may exist. The impact of setting different parametres may also provide interesting results: the tested solvers allow for a multitude of settings that can be used in a large number of combinations. The problems discussed in this report do not cover the entirety of strategic sourcing. Any combination of the applied considerations may be used to create new sets of constraints. Further, entirely different constraints may be applied for penalizing factors such as environmental impact. In conclusion, while this report shows that QP does not appear to provide any significant benefit for the discussed problems, it is by no means to be considered exhaustive.

Quadratic Programming Models in Strategic Sourcing Optimization Page 24 of 37 References Daniel Ahlbom, Uppsala University 2017

References

[1] Sandholm T, Levine D, Concordia M, Martyn P, Hughes R, Jacobs J, et al. Changing the Game in Strategic Sourcing at Procter & Gamble: Expressive Competition Enabled by Optimization. Interfaces. 2006;36(1):55–68. Available from: http://www.jstor.org/stable/20141360. [2] Beall S, Carter C, Carter PL, Germer T, Hendrick T, Jap S, et al. The role of reverse auctions in strategic sourcing. CAPS research. 2003;.

[3] Cormen TH, Leiserson CE, Rivest RL, Stein C. Introduction to Algorithms. 3rd ed. Cambridge, MA: MIT Press; 2009. [4] Eén N, Sörensson N. An extensible SAT-solver. In: International conference on theory and applications of satisfiability testing. Springer; 2003. p. 502–518.

[5] Nocedal J, Wright SJ. Numerical optimization. 2nd ed. New York: Springer; 2006. [6] Luenberger DG, Ye Y. Linear and . 4th ed. Cham: Springer International Pub- lishing; 2016. [7] Byrd R, Nocedal J, Waltz R. Knitro: An Integrated Package for Nonlinear Optimization. Large-scale nonlinear optimization. 2006;p. 35–59.

[8] Wächter A, Biegler LT. Failure of global convergence for a class of interior point methods for nonlinear programming. Mathematical Programming. 2000;88(3):565–574. [9] Bussieck MR, Vigerske S. MINLP solver software. Wiley encyclopedia of operations research and man- agement science. 2010;.

[10] Fourer R, Gay DM, Kernighan BW. A modeling language for mathematical programming. Management Science. 1990;36(5):519–554.

Quadratic Programming Models in Strategic Sourcing Optimization Page 25 of 37 Prerequisite knowledge Daniel Ahlbom, Uppsala University 2017

A Prerequisite knowledge A.1 NP-completeness Problems with search spaces that grow exponentially (or worse) – in current solutions – can sometimes be classified as NP-complete. NP stands for non-deterministic polynomial time: this is a class of problems that may be verified in polyno- mial time, i e O(nc) for some constant c. If a problem can be solved in polynomial time, it is considered to be a part of the problem class P. Since problem solutions in P can be verified in polynomial time, P ⊆ NP. Another class, NP-hard, consists of problems that are at least as hard as the hardest problems in NP. If a problem is both in NP and NP-hard, it is considered NP-complete.[3] It is currently unknown whether P = NP: that is, whether NP-problems can be solved in polynomial time [3]. Until then, large instances of NP-complete problems can take lifetimes to solve using brute-force algorithms, even with high-end hardware. Considering the problem discussed in 3.1: Seller Discounts, the smallest datasets consist of 100 products and 80 sellers, generating arrays with 8000 variables: assuming only binary assignments and that a generous instance would allow for 90% of the variables be pre-set,3 the resulting search space of a naive algorithm would still consider 2800 ≈ 6.67 · 10240 combinations4 to exhaust all possible solutions. To put this in a real-life perspective, a case study of display sourcing for Procter and Gamble consisted of some 500 components and 40 sellers [1]. Using the methods discussed in the report, these problems can be modelled such that advanced programs can interpret the problem in ways that allow for it to be solved in near-polynomial time, in turn reducing runtimes by many orders of magnitude at large instances.

A.2 Linear Algebra Consider the following: • Constant matrix A ∈ Ri×j (size i by j with real numbers) • Constant vector c ∈ Rj (contains i real numbers) • Variable vector x ∈ Rj (contains i real numbers) • Variable vector y ∈ Ri (contains j real numbers) Let them contain the following values:         a1,1 ··· ai,1 c1 x1 y1  . . .   .   .   .  A =  . .. .  , c =  .  , x =  .  , y =  .  a1,j ··· ai,j ci xi yj This allows us to express inequalities of the form ax ≤ y with the following: Ax ≤ y       a1,1 ··· ai,1 x1 y1       . . . . ≤ .  . .. .   .   .  a ··· a x y  1,j i,j i   j  a1,1 · x1 + a2,1 · x2 + ... + ai,1 · xi y1     . ≤ .  .   .  a · x + a · x + ... + a · x y 1,j 1 2,j 2 i,j i  j   a1,1 · x1 + a2,1 · x2 + . . . ai,1 · xi ≤ y1 Ax ≤ y ⇔ .  .  a1,j · x1 + a2,j · x2 + ... + ai,j · xi ≤ yj A transposed matrix or vector essentially mirrors it diagonally:   x1   . ⇔ T x =  .  x = (x1, x2, . . . , xi) xi

3For example, if the sellers do not provide a product, the variable setting an order can be set to 0. 4For comparison, albeit one that is difficult to reference: at the time of writing, the observable universe is commonly estimated to contain approximately 1080 protons.

Quadratic Programming Models in Strategic Sourcing Optimization Page 26 of 37 Prerequisite knowledge Daniel Ahlbom, Uppsala University 2017

To find the dot product of two vectors, one can simply transpose the first vector:   x1   · T . · · · c x = c x = (c1, c2, . . . , ci)  .  = c1 x1 + c2 x2 + ... + ci xi xi

1 T In QP, as shown in 2.4: Quadratic Programming, we encounter multiplications of the form 2 x Ax. In order for such a multiplication to hold, both sides of A must be equal to the number of elements in x: for this case, let i = j = k.

    a ··· a x ( ) 1,1 k,1 1 T  . . .   .  x Ax = x1, x2, . . . , xk  . .. .   .  a ··· a x  1,k k,k k  a · x + a · x + ... + a · x ( ) 1,1 1 2,1 2 k,1 k  .  = x1, x2, . . . , xk  .  a1,k · x1 + a2,k · x2 + ... + ak,k · xk

= x1(a1,1 · x1 + a2,1 · x2 + ... + ak,1 · xk)

+ x2(a1,2 · x1 + a2,2 · x2 + ... + ak,2 · xk) + ...

+ xk(a1,k · x1 + a2,k · x2 + ... + ak,k · xk) · 2 · · · · = a1,1 x1 + a2,1 x1 x2 + ... + ak,1 x1 xk · · · 2 · · + a1,2 x1 x2 + a2,2 x2 + ... + ak,2 x2 xk + ... · · · · · 2 + a1,k x1 xk + a2,k x2 xk + ... + ak,k xk 2 · · · = x1 a1,1 + x1 x2(a1,2 + a2,1) + ... + x1 xk(a1,k + ak,1) 2 · · · + x2 a2,2 + x2 x3(a2,3 + a3,2) + ... + x2 xk(a2,k + ak,2) + ... 2 · + xk ak,k

If A is symmetric – mirrored across the upper-left to lower-right diagonal, such that ap,q = aq,p – then the result is as follows:

T 2 · · · · · · · x Ax = x1 a1,1 + 2 x1 x2 a1,2 + ... + 2 x1 xk a1,k 2 · · · · · · · + x2 a2,2 + 2 x2 x3 a2,3 + ... + 2 x2 xk a2,k + ... 2 · + xk ak,k

This relation also shows that a quadratic function can be expressed in the form xT Ax.

A.3 Convex Functions and Sets A convex set contains its entire line segment between any two points. For example, if a set is defined by the (filled) shape of a circle, the line between any two points on that circle is entirely within that sameset,ie inside that circle. If a quarter were to be removed from that set – into a Pac-Man shape – any point on a line between the two corners of its rim would be outside of the set: therefore it would not be convex. A convex function requires that, given values x1 < x2 < x3 and a function f, f(x2) is less than or equal to any point on the line between coordinates (x1, f(x1)) and (x3, f(x3)). This is the case if the second derivative of f is always non-negative. On a graph, this essentially becomes the shape of a cone, pointing downwards. If f(x2) is strictly less than any point formed by the line, the function is strictly convex. For quadratic functions expressed in the form xT Ax, the function is strictly convex if and only if A is positive definite. A consequence of a function being convex is that any local optimum must also be a global optimum.

Quadratic Programming Models in Strategic Sourcing Optimization Page 27 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

B Experiments B.1 Testing platform Experiments where run on an Intel Core i5 6600K CPU 3.50 Ghz with 16 GB DDR4 RAM 3200 Mhz. The following software versions were used: OS x86 64-bit Funtoo Linux using kernel version 4.9.10 AMPL Version 20170412 for Linux x86/64 Knitro Version 10.2.0 for AMPL/Linux

Gurobi Version 7.0.2 for AMPL/Linux FICO Xpress Version 8.0.4 (Xpress-Optimizer 29.01.10) for AMPL/Linux

B.2 Datasets Datasets were generated randomly using parametres allowing for making reasonably competitive sellers. For example, a seller whose products have a higher price would provide a higher discount, while sellers whose base prices are low provide a less significant discount. Further, each product in a dataset was set to a standard price a seller would not diverge from by a significant degree, in order to avoid obvious solutions.

B.3 AMPL Implementations The AMPL implementations are listed as follows:

• Listing 2 is the AMPL model for the MIP implementation of the discount problem. • Listing 3 is the AMPL model for the QP implementation of the discount problem. • Listing 4 is the AMPL model for the MIP implementation of the supply problem. • Listing 5 is the AMPL model for the QP implementation of the supply problem.

• Listing 6 is the AMPL model for the MIP implementation of the regions problem. • Listing 7 is the AMPL model for the QP implementation of the regions problem. • Listing 8 is the AMPL model for the MIP implementation of the reserved price problem. • Listing 9 is the AMPL model for the QP implementation of the reserved price problem.

Listing 2: An AMPL model for the MIP implementation of the seller discount problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 5 set Products := 1..n_products; # Set of products 6 set Sellers := 1..n_sellers; # Set of sellers 7 8 param Prices {Products,Sellers} >= -1; 9 param Discounts {Products,Sellers} >= 0; 10 param DiscountThreshold {Sellers} >= 0; 11 12 13 ### VARIABLES ### 14 # Order[i,j] > 0 iff product i ordered from seller j 15 var Order {Products,Sellers} >= 0, <= 1; 16 # OrderDiscount[i,j] > 0 iff product i ordered from seller j with discount 17 var OrderDiscount {Products,Sellers} >= 0, <= 1; 18 # SellerDiscount[j] == 1 iff seller j gives discount 19 var SellerDiscount {Sellers} binary; 20 21 22 ### OBJECTIVE ###

Quadratic Programming Models in Strategic Sourcing Optimization Page 28 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

23 # Sum of all orders subtracted by sum of all discounts 24 minimize totalCost: 25 (sum {i in Products , j in Sellers} Prices[i,j]*Order[i,j]) - 26 (sum {i in Products , j in Sellers} Discounts[i,j]*OrderDiscount[i,j]); 27 28 29 ### CONSTRAINTS ### 30 subject to 31 # Each product must be ordered such that total ratio for all sellers is at least 1 32 eachProductOrdered {i in Products}: 33 (sum {j in Sellers} Order[i,j]) >= 1; 34 # Discount variable true iff order exceeds threshold 35 discountCondition {j in Sellers}: 36 (sum {i in Products} Prices[i,j]*Order[i,j]) - 37 DiscountThreshold[j]*SellerDiscount[j] >= 0; 38 # Product discount ratio cannot exceed that of product order ratio 39 discountPurchased {i in Products , j in Sellers}: 40 Order[i,j] - OrderDiscount[i,j] >= 0; 41 # Product discount requires applied discount 42 discountEnable {i in Products , j in Sellers}: 43 SellerDiscount[j] - OrderDiscount[i,j] >= 0; 44 # Order only existing products , Assumes all prices are positive integers 45 validProductOrder {i in Products ,j in Sellers}: 46 Prices[i,j] * Order[i,j] >= 0;

Listing 3: An AMPL model for the QP implementation of the seller discount problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 5 set Products := 1..n_products; # Set of products 6 set Sellers := 1..n_sellers; # Set of sellers 7 8 param DiscountPrices {Products,Sellers} >= -1; 9 param Discounts {Products,Sellers} >= 0; 10 param DiscountThreshold {Sellers} >= 0; 11 12 13 ### VARIABLES ### 14 # Order[i,j] > 0 iff product i ordered from seller j 15 var Order {Products,Sellers} >= 0, <= 1; 16 # NoDiscount[j] == 1 iff seller j gives discount 17 var NoDiscount {Sellers} binary; 18 19 20 ### OBJECTIVE ### 21 # Sum of all orders subtracted by sum of all discounts 22 minimize totalCost: 23 (sum {i in Products , j in Sellers} Order[i,j]*DiscountPrices[i,j]) + 24 (sum {i in Products , j in Sellers} Order[i,j]*Discounts[i,j]*NoDiscount[j]); 25 26 27 ### CONSTRAINTS ### 28 subject to 29 # Each product must be ordered such that total ratio for all sellers is at least 1 30 eachProductOrdered {i in Products}: 31 (sum {j in Sellers} Order[i,j]) >= 1; 32 # Discount variable true iff order exceeds threshold 33 discountCondition {j in Sellers}: 34 (sum {i in Products} DiscountPrices[i,j]*Order[i,j]) + 35 (sum {i in Products} Discounts[i,j]*Order[i,j]) - 36 DiscountThreshold[j]*(1 - NoDiscount[j]) >= 0; 37 # Order only existing products , Assumes all Discountprices are positive integers 38 validProductOrder {i in Products ,j in Sellers}: 39 DiscountPrices[i,j]*Order[i,j] >= 0;

Quadratic Programming Models in Strategic Sourcing Optimization Page 29 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

Listing 4: An AMPL model for the MIP implementation of the supply problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 5 set Products := 1..n_products; # Set of products 6 set Sellers := 1..n_sellers; # Set of sellers 7 8 param Prices {Products,Sellers} >= -1; 9 param Discounts {Products,Sellers} >= 0; 10 param DiscountThreshold {Sellers} >= 0; 11 param Supplies {Products,Sellers} >= 0; 12 param Allowance {Sellers} >= 0; 13 14 15 ### VARIABLES ### 16 # Order[i,j] > 0 iff product i ordered from seller j 17 var Order {Products,Sellers} >= 0, <= 1; 18 # OrderDiscount[i,j] > 0 iff product i ordered from seller j with discount 19 var OrderDiscount {Products,Sellers} >= 0, <= 1; 20 # SellerDiscount[j] == 1 iff seller j gives discount 21 var SellerDiscount {Sellers} binary; 22 23 24 ### OBJECTIVE ### 25 # Sum of all orders subtracted by sum of all discounts 26 minimize totalCost: 27 (sum {i in Products , j in Sellers} Prices[i,j]*Order[i,j]) - 28 (sum {i in Products , j in Sellers} Discounts[i,j]*OrderDiscount[i,j]); 29 30 31 ### CONSTRAINTS ### 32 subject to 33 # Each product must be ordered such that total ratio for all sellers is at least 1 34 eachProductOrdered {i in Products}: 35 (sum {j in Sellers} Order[i,j]) >= 1; 36 # Discount variable true iff order exceeds threshold 37 discountCondition {j in Sellers}: 38 (sum {i in Products} Prices[i,j]*Order[i,j]) - 39 DiscountThreshold[j]*SellerDiscount[j] >= 0; 40 # Product discount ratio cannot exceed that of product order ratio 41 discountPurchased {i in Products , j in Sellers}: 42 Order[i,j] - OrderDiscount[i,j] >= 0; 43 # Product discount requires applied discount 44 discountEnable {i in Products , j in Sellers}: 45 SellerDiscount[j] - OrderDiscount[i,j] >= 0; 46 # Order at most the available amount 47 supplyLimit {i in Products , j in Sellers}: 48 Supplies[i,j] - Order[i,j] >= 0; 49 # Order at most the allowed amount from a seller 50 sellerLimit {j in Sellers}: 51 Allowance[j] - (sum {i in Products} Prices[i,j]*Order[i,j]) >= 0;

Listing 5: An AMPL model for the QP implementation of the supply problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 set Products := 1..n_products; # Set of products 5 set Sellers := 1..n_sellers; # Set of sellers 6 param DiscountPrices {Products,Sellers} >= 0; 7 param Discounts {Products,Sellers} >= 0; 8 param DiscountThreshold {Sellers} >= 0; 9 param Supplies {Products,Sellers} >= 0; 10 param Allowance {Sellers} >= 0; 11

Quadratic Programming Models in Strategic Sourcing Optimization Page 30 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

12 ### VARIABLES ### 13 # Order[i,j] > 0 iff product i ordered from seller j 14 var Order {Products,Sellers} >= 0, <= 1; 15 # NoDiscount[j] == 1 iff seller j gives discount 16 var NoDiscount {Sellers} binary; 17 18 ### OBJECTIVE ### 19 # Sum of orders with discounted prices and discounts where it is not applied. 20 # (discount is the difference between full price and discounted price) 21 minimize totalCost: 22 (sum {i in Products , j in Sellers} Order[i,j] * DiscountPrices[i,j]) + 23 (sum {i in Products , j in Sellers} Order[i,j] * Discounts[i,j] * NoDiscount[j]); 24 25 ### CONSTRAINTS ### 26 subject to 27 # Each product must be ordered such that total ratio for all sellers is at least 1 28 eachProductOrdered {i in Products}: 29 (sum {j in Sellers} Order[i,j]) >= 1; 30 # Discount variable true iff order exceeds threshold 31 discountCondition {j in Sellers}: 32 (sum {i in Products} DiscountPrices[i,j] * Order[i,j]) + 33 (sum {i in Products} Discounts[i,j] * Order[i,j]) - 34 DiscountThreshold[j] * (1 - NoDiscount[j]) >= 0; 35 # Order at most the available amount 36 supplyLimit {i in Products , j in Sellers}: 37 Supplies[i,j] - Order[i,j] >= 0; 38 # Order at most the allowed amount from a seller 39 sellerLimit {j in Sellers}: 40 Allowance[j] - 41 (sum {i in Products} DiscountPrices[i,j] * Order[i,j]) - 42 (sum {i in Products} Discounts[i,j] * Order[i,j]) >= 0;

Listing 6: An AMPL model for the MIP implementation of the regions problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 param n_regions; # Number of regions 5 param globalSellerLimit; # Maximum global number of sellers 6 7 set Products := 1..n_products; # Set of products 8 set Sellers := 1..n_sellers; # Set of sellers 9 set Regions := 1..n_regions; # Set of regions 10 11 param Prices {Products,Sellers,Regions} >= -1; 12 param Discounts {Products,Sellers,Regions} >= 0; 13 param DiscountThreshold {Sellers} >= 0; 14 param ProductDemand {Products, Regions} >= 0; 15 param RegionSellerLimit {Regions} >= 0; 16 17 18 ### VARIABLES ### 19 # Order[i,j,k] > 0 iff product i ordered from seller j 20 var Order {Products,Sellers,Regions} >= 0; 21 # OrderDiscount[i,j,k] > 0 iff product i ordered from seller j with discount 22 var OrderDiscount {Products,Sellers,Regions} >= 0; 23 # SellerDiscount[j] == 1 iff seller j gives discount 24 var SellerDiscount {Sellers} binary; 25 # RegionSellerOrder[j,k] == 1 iff seller j has order in region k 26 var RegionSellerOrder {Sellers,Regions} binary; 27 # GlobalSellerOrder[j] == 1 iff seller j has an order in any region 28 var GlobalSellerOrder {Sellers} binary; 29 30 31 ### OBJECTIVE ### 32 # Sum of all orders subtracted by sum of all discounts 33 minimize totalCost:

Quadratic Programming Models in Strategic Sourcing Optimization Page 31 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

34 (sum {i in Products , j in Sellers , k in Regions} Prices[i,j,k]*Order[i,j,k]) - 35 (sum {i in Products , j in Sellers , k in Regions} Discounts[i,j,k]*OrderDiscount[i,j,k]); 36 37 38 ### CONSTRAINTS ### 39 subject to 40 # Number of units ordered must satisfy demand in corresponding region 41 eachProductOrdered {i in Products , k in Regions}: 42 (sum {j in Sellers} Order[i,j,k]) - ProductDemand[i,k] >= 0; 43 # Discount variable true iff order exceeds threshold 44 discountCondition {j in Sellers}: 45 (sum {i in Products ,k in Regions} Prices[i,j,k] * Order[i,j,k]) - 46 DiscountThreshold[j] * SellerDiscount[j] >= 0; 47 # Product discount ratio cannot exceed that of product order ratio 48 discountPurchased {i in Products , j in Sellers , k in Regions}: 49 Order[i,j,k] - OrderDiscount[i,j,k] >= 0; 50 # Product discount requires applied discount 51 discountEnable {i in Products , j in Sellers , k in Regions}: 52 ProductDemand[i,k] * SellerDiscount[j] - OrderDiscount[i,j,k] >= 0; 53 # Order only existing products , Assumes all prices are positive integers 54 validProductOrder {i in Products ,j in Sellers ,k in Regions}: 55 Prices[i,j,k] * Order[i,j,k] >= 0; 56 # Set seller regional orders. 57 # NOTE: Currently limits size of order to that of demand. 58 setRegionSellerOrders {i in Products , j in Sellers , k in Regions}: 59 RegionSellerOrder[j,k]*ProductDemand[i,k] - Order[i,j,k] >= 0; 60 # Limiting number of regional sellers: 61 limitRegionSellers {k in Regions}: 62 (sum {j in Sellers} RegionSellerOrder[j,k]) - RegionSellerLimit[k] <= 0; 63 # Set global seller orders 64 setGlobalSellerOrders {j in Sellers , k in Regions}: 65 GlobalSellerOrder[j] - RegionSellerOrder[j,k] >= 0; 66 # Limiting total number of sellers: 67 limitGlobalSellers: 68 (sum {j in Sellers} GlobalSellerOrder[j]) - globalSellerLimit <= 0;

Listing 7: An AMPL model for the QP implementation of the regions problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 param n_regions; # Number of regions 5 param globalSellerLimit; # Maximum global number of sellers 6 7 set Products := 1..n_products; # Set of products 8 set Sellers := 1..n_sellers; # Set of sellers 9 set Regions := 1..n_regions; # Set of regions 10 11 param DiscountPrices {Products,Sellers,Regions} >= -1; 12 param Discounts {Products,Sellers,Regions} >= 0; 13 param DiscountThreshold {Sellers} >= 0; 14 param ProductDemand {Products, Regions} >= 0; 15 param RegionSellerLimit {Regions} >= 0; 16 17 18 ### VARIABLES ### 19 # Order[i,j,k] > 0 iff product i ordered from seller j 20 var Order {Products,Sellers,Regions} >= -1; 21 # DiscountInActive[j] == 1 iff seller j does not give discount 22 var DiscountInActive {Sellers} binary; 23 # RegionSellerOrder[j,k] == 1 iff seller j has order in region k 24 var RegionSellerOrder {Sellers,Regions} binary; 25 # GlobalSellerOrder[j] == 1 iff seller j has an order in any region 26 var GlobalSellerOrder {Sellers} binary; 27 28 29 ### OBJECTIVE ###

Quadratic Programming Models in Strategic Sourcing Optimization Page 32 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

30 # Sum of all orders subtracted by sum of all discounts 31 minimize totalCost: 32 (sum {i in Products , j in Sellers , k in Regions} 33 Order[i,j,k] * DiscountPrices[i,j,k]) + 34 (sum {i in Products , j in Sellers , k in Regions} 35 Order[i,j,k] * Discounts[i,j,k] * DiscountInActive[j]); 36 37 38 ### CONSTRAINTS ### 39 subject to 40 # Each product must be ordered such that total ratio for all sellers is at least 1 41 eachProductOrdered {i in Products , k in Regions}: 42 (sum {j in Sellers} Order[i,j,k]) - ProductDemand[i,k] >= 0; 43 # Discount variable true iff order exceeds threshold 44 discountCondition {j in Sellers}: 45 (sum {i in Products , k in Regions} DiscountPrices[i,j,k] * Order[i,j,k]) + 46 (sum {i in Products , k in Regions} Discounts[i,j,k] * Order[i,j,k]) - 47 DiscountThreshold[j] * (1 - DiscountInActive[j]) >= 0; 48 # Order only existing products , assumes all prices are positive integers 49 validProductOrder {i in Products ,j in Sellers , k in Regions}: 50 DiscountPrices[i,j,k]*Order[i,j,k] >= 0; 51 # Regional limits 52 setRegionSellers {i in Products , j in Sellers , k in Regions}: 53 RegionSellerOrder[j,k]*ProductDemand[i,k] - Order[i,j,k] >= 0; 54 limitRegionSellers {k in Regions}: 55 (sum {j in Sellers} RegionSellerOrder[j,k]) - RegionSellerLimit[k] <= 0; 56 # Set global seller orders 57 setGlobalSellerOrders {j in Sellers , k in Regions}: 58 GlobalSellerOrder[j] - RegionSellerOrder[j,k] >= 0; 59 # Limiting total number of sellers: 60 limitGlobalSellers: 61 (sum {j in Sellers} GlobalSellerOrder[j]) - globalSellerLimit <= 0;

Listing 8: An AMPL model for the MIP implementation of the reserved price problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 param sellerLimit; # Highest allowed number of sellers 5 6 set Products := 1..n_products; # Set of products 7 set Sellers := 1..n_sellers; # Set of sellers 8 9 param Prices {Products,Sellers} >= -1; 10 param Discounts {Products,Sellers} >= 0; 11 param DiscountThreshold {Sellers} >= 0; 12 param Penalty {Products} >= 0; 13 14 15 ### VARIABLES ### 16 # Order[i,j] > 0 iff product i ordered from seller j 17 var Order {Products,Sellers} >= 0, <= 1; 18 # OrderDiscount[i,j] > 0 iff product i ordered from seller j with discount 19 var OrderDiscount {Products,Sellers} >= 0, <= 1; 20 # SellerDiscount[j] == 1 iff seller j gives discount 21 var SellerDiscount {Sellers} binary; 22 # SellerOrder[j] == 1 iff there is an order from seller j 23 var SellerOrder {Sellers} binary; 24 # ExternalOrder[i] > 0 if product order i is done externally 25 var ExternalOrder {Products} >= 0; 26 27 28 ### OBJECTIVE ### 29 # Sum of all orders subtracted by sum of all discounts 30 minimize totalCost: 31 (sum {i in Products} ExternalOrder[i]*Penalty[i]) + 32 (sum {i in Products , j in Sellers} Prices[i,j]*Order[i,j]) -

Quadratic Programming Models in Strategic Sourcing Optimization Page 33 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

33 (sum {i in Products , j in Sellers} Discounts[i,j]*OrderDiscount[i,j]); 34 35 36 ### CONSTRAINTS ### 37 subject to 38 # Each product must be ordered such that total ratio for all sellers is at least 1 39 eachProductOrdered {i in Products}: 40 ExternalOrder[i] + 41 (sum {j in Sellers} Order[i,j]) >= 1; 42 # Discount variable true iff order exceeds threshold 43 discountCondition {j in Sellers}: 44 (sum {i in Products} Prices[i,j] * Order[i,j]) - 45 DiscountThreshold[j] * SellerDiscount[j] >= 0; 46 # Product discount ratio cannot exceed that of product order ratio 47 discountPurchased {i in Products , j in Sellers}: 48 Order[i,j] - OrderDiscount[i,j] >= 0; 49 # Product discount requires applied discount 50 discountEnable {i in Products , j in Sellers}: 51 SellerDiscount[j] - OrderDiscount[i,j] >= 0; 52 # Order only existing products , Assumes all prices are positive integers 53 validProductOrder {i in Products ,j in Sellers}: 54 Prices[i,j] * Order[i,j] >= 0; 55 # Mark sellers with orders 56 setSellerOrder {i in Products , j in Sellers}: 57 SellerOrder[j] - Order[i,j] >= 0; 58 # Satisfy order limit 59 countSellers: 60 (sum {j in Sellers} SellerOrder[j]) - sellerLimit <= 0;

Listing 9: An AMPL model for the QP implementation of the reserved price problem 1 ### PARAMETERS ### 2 param n_products; # Number of products 3 param n_sellers; # Number of sellers 4 param sellerLimit; # Highest allowed number of sellers 5 6 set Products := 1..n_products; # Set of products 7 set Sellers := 1..n_sellers; # Set of sellers 8 9 param DiscountPrices {Products,Sellers} >= -1; 10 param Discounts {Products,Sellers} >= 0; 11 param DiscountThreshold {Sellers} >= 0; 12 param Penalty {Products} >= 0; 13 14 15 ### VARIABLES ### 16 # Order[i,j] > 0 iff product i ordered from seller j 17 var Order {Products,Sellers} >= 0, <= 1; 18 # NoDiscount[j] == 1 iff seller j gives discount 19 var NoDiscount {Sellers} binary; 20 # SellerOrder[j] == 1 iff there is an order from seller j 21 var SellerOrder {Sellers} binary; 22 # ExternalOrder[i] > 0 if product order i is done externally 23 var ExternalOrder {Products} >= 0; 24 25 26 ### OBJECTIVE ### 27 # Sum of all orders subtracted by sum of all discounts 28 minimize totalCost: 29 (sum {i in Products} ExternalOrder[i]*Penalty[i]) + 30 (sum {i in Products , j in Sellers} Order[i,j]*DiscountPrices[i,j]) + 31 (sum {i in Products , j in Sellers} Order[i,j]*Discounts[i,j]*NoDiscount[j]); 32 33 34 ### CONSTRAINTS ### 35 subject to 36 # Each product must be ordered such that total ratio for all sellers is at least 1

Quadratic Programming Models in Strategic Sourcing Optimization Page 34 of 37 Experiments Daniel Ahlbom, Uppsala University 2017

37 eachProductOrdered {i in Products}: 38 ExternalOrder[i] + 39 (sum {j in Sellers} Order[i,j]) >= 1; 40 # Discount variable true iff order exceeds threshold 41 discountCondition {j in Sellers}: 42 (sum {i in Products} DiscountPrices[i,j] * Order[i,j]) + 43 (sum {i in Products} Discounts[i,j] * Order[i,j]) - 44 DiscountThreshold[j] * (1 - NoDiscount[j]) >= 0; 45 # Order only existing products , Assumes all Discountprices are positive integers 46 validProductOrder {i in Products ,j in Sellers}: 47 DiscountPrices[i,j]*Order[i,j] >= 0; 48 # Mark sellers with orders 49 setSellerOrder {i in Products , j in Sellers}: 50 SellerOrder[j] - Order[i,j] >= 0; 51 # Satisfy order limit 52 countSellers: 53 (sum {j in Sellers} SellerOrder[j]) <= sellerLimit;

B.4 Tables The tables are listed as follows: • Table 5 contains the full results for the discount problem. • Table 6 contains the full results for the supply problem.

• Table 7 contains the full results for the regions problem. • Table 8 contains the full results for the reserved price problem.

Quadratic Programming Models in Strategic Sourcing Optimization Page 35 of 37 Experiments Daniel Ahlbom, Uppsala University 2017 0.040 3.270 0.040 68.406 68.512 25.304 25.510 26.538 25.094 21.356 275.658 2.254 2.352 0.024 6.660 6.786 0.032 2.342 73.874 12.464 0.040 3.296 0.040 76.740 76.880 20.904 21.146 33.216 17.880 17.968 284.800 2.148 2.194 0.020 7.134 7.188 0.032 2.200 87.848 10.602 0.040 3.248 0.042 72.810 72.618 17.484 17.586 17.758 18.516 17.930 275.294 3.232 3.252 0.022 8.208 6.548 0.030 3.320 68.392 14.324 0.030 2.644 0.040 55.304 55.338 10.948 11.050 10.822 11.756 11.098 313.438 5919.890 3108.536 3480.516 820.388 13299.036141.728 5077.232 8052.290 2.014 2.034 1.726 1.674 0.020 1.454 1.454 0.026 2.050 0.030 2.732 0.034 80.308 58.772 11.002 11.124 12.074 12.020 120.574 2.932 2.980 9.324 9.290 0.020 5.846 5.808 0.026 120.364 2.978 0.032 2.862 0.034 1.718 1.726 1.844 0.018 1.592 1.398 0.028 47.934 48.006 1.832 13.010 13.110 13.560 13.836 15.086 1.740 181.186 1.950 1.956 1.402 0.012 3.924 1.212 0.020 7.960 8.028 8.344 0.020 1.824 6.006 0.020 3.848 2.064 15.870 15.904 17.408 1.100 1.138 4.742 0.012 3.678 2.792 0.020 1.188 5.530 5.570 5.596 0.018 1.754 4.454 0.020 3.076 16.114 16.114 38.540 1.1381.156 29.6800.010 25.552 1.068 1.190 0.020 0.020 1.598 0.020 3.590 4.214 3.762 3.802 3.856 16.356 16.354 42.324 Full results for the supply problem. Full results for the seller discount problem. 6.0966.286 16.800 17.106 5.684 1.374 0.018 3.828 1.448 0.020 11.134 17.222 0.030 3.882 8.708 0.034 9.052 Table 6: 12.006 12.102 12.142 42.146 42.222 237.388561.796 149.566 295.234 160.350 226.330 176.630 530.154 1790.872 2195.232 1525.958 1554.896167.678 1503.592 8218.024 4547.276 4552.334 Table 5: 5.584 5.706 5.766 1.594 1.460 0.012 1.270 1.296 0.022 0.030 4.042 0.036 9.064 10.524 10.648 11.150 54.006 53.950 15.542 778.806 577.124 738.694162.958 1489.774 403.484 235.646 303.614 2491.538 2668.186 4.192 4.304 4.374 1.484 1.378 0.014 1.494 1.372 0.020 109.154122.166 650.378 722.472 177.112 411.428 184.110 811.664 568.398 1352.694 142.376138.116 144.720 743.994 929.466 1006.484 1141.122 403.642 1631.782 1273.156 721.530 2631.062 3212.156 1420.224 6580.298 1098.740 178.424 1326.262 1557.404 1293.932 2023.734 2377.168 3149.414 6457.256 2291.594 2179.794 45248.700 46416.11745248.700 47751.247 46416.117 60164.37545248.700 60821.861 47751.247 61695.905 46416.117 60164.37544441.563 60821.861 76960.462 47750.993 61695.905 45250.315 60164.375 75249.51244441.563 60821.862 76960.462 45840.406 77029.388 61695.963 45250.315 57937.724 75249.512 75380.67645575.919 58823.451 76960.462 45840.406 77029.388 58739.537 73664.605 45565.633 57937.724 75249.512 75380.67645575.919 58823.451 75484.178 76160.051 46707.501 77029.388 58739.537 73664.605 45565.633 59475.839 74694.820 75380.67655291.977 58892.935 75484.178 76160.051 50091.491 74074.367 59911.414 73664.605 55895.477 59475.839 74694.820 75272.57444441.563 61619.724 77582.669 76160.136 57028.492 74074.367 64229.947 71827.109 45250.315 71082.454 76065.563 75272.57445575.918 72143.858 77582.669 74792.745 45840.406 74519.616 72698.006 71827.109 45565.633 57937.724 76065.563 77142.27745575.918 58823.451 92760.913 74792.745 46644.980 74519.616 58739.537 74217.920 45565.633 59475.839 91627.587 78113.48655291.977 59319.850 75484.178 75470.770 50091.491 90935.520 60345.175 75326.840 55895.477 59475.839 74694.820 92057.983 63630.433 77582.669 81717.748 57028.492 74074.367 64229.947 88102.174 71082.454 76883.635 75272.574 72143.859 77582.669 91968.550 74519.616 72698.006 71827.109 76883.635 77364.050 92760.913 74792.745 74519.616 74448.869 91627.586 80998.600 76702.020 90935.520 74448.869 92057.983 76702.020 88102.173 91968.550 0.030 3.636 0.032 9.500 p60-s100-A p60-s100-B p60-s100-C p80-s60-A p80-s60-B p80-s60-C p100-s60-A p100-s60-B p100-s60-C p100-s80-A p100-s80-B p100-s80-C 11.244 11.338 13.124 51.688 51.654 28.678 720.618 594.460 181.752 3126.660 76930.360 75191.69376930.360 76366.301 75191.69375557.922 76020.352 76366.301 75191.69971734.186 77844.551 76020.352 77976.949 76366.305 69054.29971734.186 77844.551 106357.445 76020.352 77976.949 69955.390 69054.299 103903.68772953.685 77844.557 106357.445 71238.800 110264.021 77976.949 69955.390 69608.128 103903.68772953.685 72483.105 104577.367 106357.445 71238.800 110264.021 72426.678 71781.992 109329.104 69608.128 103903.83591084.000 72483.105 104577.367 100189.753 71375.512 104591.039 110264.021 72426.678 71781.992 109329.104 87682.000 100633.700 74639.258 104577.367 100189.753 71375.512 104591.039 101961.597 74254.805 89090.000 109612.055 100633.70071734.186 74639.258 100100.391 101099.643 90024.000 104591.039 101961.597 74254.805 102388.857 69054.299 102139.16673833.893 91960.000 100100.391 101099.643 100192.475 103175.889 91564.000 69955.390 102388.857 71032.860 107168.47478894.824 102569.187 126482.000 71238.800 100192.475 103175.889 71629.488 102818.174 75411.857 127534.00091084.000 72483.105 102569.187 71735.180 100973.461 129594.000 72426.678 75254.677 102818.174 87682.000 73490.121 126037.000 100189.753 76656.361 100973.461 72541.243 89090.000 129061.000 100633.700 78203.949 102138.474 90024.000 126364.000 101961.597 78895.880 102565.982 91960.000 100100.391 108814.551 105927.754 91564.000 102388.857 102565.982 101860.980 126482.000 100192.475 111590.058 105677.363 127534.000 108217.196 102400.382 129594.000 109683.350 126037.000 108937.324 129061.000 126364.000 104612.580 100959.380 102256.735 103545.055 105507.574 105244.734 145573.580 146733.636 148902.632 144912.678104612.580 148792.352 100959.380 145439.274 102256.735 103545.055 105507.574 105244.734 145573.580 146733.636 148902.632 144912.678 148792.352 145439.274 p100-s140-A p100-s140-B p100-s140-C p100-s80-A p100-s80-B p100-s80-C p140-s100-A p140-s100-B p140-s100-C p140-s120-A p140-s120-B p140-s120-C Data Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Data Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. None Max 1 cross it. Max 2 cross it. QP MIP, int. MIP, 5% gap MIP, 10% gap MIP, no disc. None 5% gap 10% gap No disc. None Max 1 cross it. Max 2 cross it. QP MIP, int. MIP, 5% gap MIP, 10% gap MIP, no disc. MIP, rel. None 5% gap 10% gap No disc. Rel. Solver Settings Knitro Gurobi Xpress Solver Settings Knitro Gurobi Xpress

Quadratic Programming Models in Strategic Sourcing Optimization Page 36 of 37 Experiments Daniel Ahlbom, Uppsala University 2017 1.020 1.014 1.252 1.234 1.420 1.230 1.150 0.394 0.432 4.202 4.802 4.702 1.400

86.970 32.924 43.308 p40-s20-r10-C 1.932 1.010 0.914 0.656 0.502 4.642 4.364 4.542 1.204 1.048 1.038 1.222 1.382

79.292 80.844 84.424 114.876 99.16086.168 194.628 219.466 52.572 p40-s20-r10-B

1.724 1.036 0.798 0.194 0.144 4.632 4.568 4.414 0.100 0.958 0.954 1.406 1.442 p40-s20-r10-A 1.548 2.156 2.032 0.754 0.546 3.990 4.222 4.184 1.160 0.596 0.598 1.004 0.990

39.62818.236 118.012 134.266 40.152 122.782 77.690 203.962 365.944 389.502 p20-s20-r15-C 2.350 2.984 2.832 2.518 0.458 3.262 3.344 3.398 1.314 0.644 0.642 0.914 0.892

66.182 43.434 31.520 p20-s20-r15-B 1.568 1.144 2.948 0.828 0.414 4.402 4.258 4.900 1.228 0.660 0.664 0.824 0.880

39.678 29.008 16.600 85.830 216.268 p20-s20-r15-A 9.336 6.542 6.518 6.110 1.930 9.928 5.592 10.898 11.104

0.194 0.242 0.104 0.114 0.034 0.098 0.104 0.040 114.276 162.318 256.462 428.710 164.088 369.084 0.760 p10-s40-r5-C 8.058 6.168 5.404 4.606 3.422 9.222 6.806 11.246 11.584 0.298 0.152 0.104 0.102 0.042 0.110 0.104 0.040 0.256

91.06297.060 675.098 1240.588 712.116 1678.586 1333.026 1788.464 488.678 521.272 614.232 661.288 663.748 1682.206 730.356 1747.728 p10-s40-r5-B 6.440 5.992 5.248 3.040 8.722 6.806 10.356 10.700 11.242 0.058 0.058 0.058 0.060 0.036 0.072 0.080 0.036 0.080

Full results for the regions problem. p10-s40-r5-A Full results for the reserved price problem. 8.320 4.982 4.642 3.408 2.406 8.032 8.644 8.862 5.004 4.824 5.216 0.356 0.352 2.966 0.394 0.410 7.634 11.570

Table 7: p10-s10-r30-C Table 8: 9.156 8.330 7.802 6.444 3.232 6.694 9.880 6.716 0.314 0.294 4.194 0.434 0.450 6.146

11.994 11.532 11.482

54.076 222.274 100.744 11.196 p10-s10-r30-B 9.708 6.978 5.676 3.352 3.588 9.060 5.606 5.118 4.332 0.276 0.284 3.776 8.698 0.400 0.394 8.850 13.652 12.416

179.328 3761.518183.122 1423.822 3894.304453.044 1154.458 1399.496 4888.154 1848.844 1165.712 2218.400 1407.630 1874.126 1279.462 1440.620 1781.652 47.692 2549.266 48.968 41.308 64.988 42.712 22.968 41.042 23.572 26.912 44.114 29.290 23.296

397.096 475.950324.720 101.454 164.890 315.712 104.108 420.274 133.286 136.866 471.124 3216.482 3672.146 1080.008 1655.948 1766.410 4227.980 p10-s10-r30-A 162661.049 216974.912 205529.142162661.049 123139.921 216974.912 126080.310 205529.142164501.535 129158.667 123139.921 216974.909 54149.659 126080.310 206166.800162661.050 52328.358 129158.667 122473.653 216974.917 51603.810 54149.659 126080.310 203646.786162661.050 71911.435 52328.358 129158.667 122473.653 216974.917 134949.396 51603.810 54686.103 126080.310 127011.458 203646.786162661.050 71911.435 52328.359 129088.756 122473.653 216974.917 134949.396 51603.812 54149.659 126080.310 127011.458 203646.786162661.050 71911.435 52328.359 129088.756 122473.653 216974.917 134949.396 51603.812 54149.659 126080.310 127011.458 203646.786168985.834 71238.308 52328.359 129088.756 122473.653 222117.622 134949.396 51603.812 54149.659 126080.310 127011.458 204181.083162661.050 71238.308 52328.359 129088.756 124800.400 216974.917 134949.396 51603.812 54149.659 127024.481 127011.458 203646.786162661.050 71259.564 52328.359 130750.911 122473.653 216974.917 134949.396 51603.812 54815.182 126080.310 127011.458 203646.786162661.050 77552.516 55680.968 129088.756 122473.653 216974.917 138496.021 51698.194 54149.659 126080.310 127011.458 203646.786168985.834 74369.479 52328.359 129088.756 122473.653 222117.622 140348.772 51603.812 54149.659 126080.310 127843.794 204181.083 71238.308 52328.359 129088.756 124800.400 134949.396 51603.812 54149.659 127024.481 127011.458 71238.308 52328.359 130750.911 134949.396 51603.812 54815.182 127011.458 71238.308 55680.968 134949.396 51698.194 127011.458 73725.940 140348.772 127843.794 633951.118 615908.601 610591.583633951.118 67672.040 615908.601 610591.583 89943.156634000.236 67672.040 615956.702 91127.240 610591.583 553186.841 89943.156633951.118 600617.424 67988.687 615860.595 91127.240 571204.628 610585.908 553186.841 90043.579 818055.462633951.118 600617.424 67197.000 797863.311 615860.595 90862.495 571204.628 842711.008 610585.908 553186.841 89291.003 818055.462657443.301 600617.424 67197.000 797863.311 637827.480 90525.511 571204.634 842711.008 627126.243 553186.841 89291.003 818055.462657443.301 600235.415 67197.000 797863.311 637827.480 90525.511 571204.634 842711.008 627126.243 553186.841 91141.190 817514.615698562.737 600235.415 67197.000 797792.975 686714.187 90719.719 571204.634 842267.851 679264.438 569178.472 91141.190 817514.615633951.118 615638.428 81777.093 797792.975 615860.595 90719.719 107787.331 590233.567 842267.851 610585.908 569178.472 108821.185 828215.737639870.371 615638.428 67197.000 652291.112 819909.559 621373.511 590233.567 704846.703 857783.097 620697.113 89291.003 828215.737639870.371 676462.643 67197.000 819909.559 621373.511 90528.996 956507.248 857783.097 620697.113 553186.841 91374.177 937245.724698484.899 600235.415 67197.000 978420.065 686714.187 92451.474 571204.634 679264.438 559335.761 91374.177 817514.615 608076.829 81777.093 797792.975 92451.474 107787.331 577986.149 842267.851 559335.761 108821.185 826568.688 608076.829 652291.112 811229.436 577986.149 704846.703 852544.897 826568.688 676439.217 811229.436 956511.505 852544.897 936821.424 978684.861 p150s100-A p150s100-B p150s100-C p100s150-A p100s150-B p100s150-C p50s100-A p50s100-B p50s100-C p100s50-A p100s50-B p100s50-C Data Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Data Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Runtime Obj. Max 1 cross it. Max 2 cross it. QP MIP, int. MIP, 5% gap MIP, 10% gap MIP, no disc. None 5% gap 10% gap No disc. None None Max 1 cross it. Max 2 cross it. QP MIP, int. MIP, 5% gap MIP, 10% gap MIP, no disc. None 5% gap 10% gap No disc. Solver Settings Gurobi Xpress Knitro Solver Settings Knitro Gurobi Xpress

Quadratic Programming Models in Strategic Sourcing Optimization Page 37 of 37