Constructing an Index Fund Using Interior Point Primal Dual Method

Size: px
Start display at page:

Download "Constructing an Index Fund Using Interior Point Primal Dual Method"

Transcription

1 MASTER THESIS IN APPLIED MATHEMATICS MMA891 Degree Project in Mathematics Constructing an Index Fund Using Interior Point Primal Dual Method by Sampid Marius Galabe & Kamta Celestin Masterarbete i matematik/tillämpad matematik DIVISION OF APPLIED MATHEMATICS MÄLARDALEN UNIVERSITY SE VÄSTERÅS, SWEDEN

2 Master Thesis in Mathematics / Applied Mathematics Date: Project name: Constructing an Index Fund Using Interior Point Primal Dual Method Author: Sampid Marius Galabe & Kamta Celestin Supervisor: Dr. Kateryna Mishchenko. Examiner: Professor Anatoliy Malyarenko Comprising: 30 ECTS credits 2

3 Abstract Optimization methods nowadays play a very important role in financial decisions such as portfolio managements, construction of index funds and pension funds. This Master Thesis is devoted to the problem of an index fund construction. The problem is represented as a linear optimization problem of re-balancing the portfolio at minimum cost and solved using the Primal-Dual interior point method. The index fund is constructed using ten companies from the Dow Jones Industrial Average Index (DJIA). The Primal-Dual interior point method was first implemented in Matlab and later on in Java. 3

4 Acknowledgement We would like to give special thanks to our supervisor Dr. Kateryna Mishchenko for all her support and encouragement during the course of writing this thesis work. She has also been a great lecturer, teaching us very useful skills in programming languages. Also, special thanks to Dr. Torgil Abrahamsson and all our lectures at Mälardalens University, especially Professor Anatoliy Malyarenko, for their great contribution to our learning process. 4

5 Table of Contents Definitions Introduction Background Method i) Large scale deterministic model ii) Non linear programming model iii) Linear programming model Delimitation Thesis overview Chapter 1 Linear Programming Model Derivation of the primal-dual method Sketch of the algorithm Chapter 2 Problem Modeling Chapter 3 Implementation Data collection The primal problem The dual problem Financial interpretation

6 Chapter 4 The Java script Conclusion References Appendix Java Code.. 48 Applet Code Matlab Code

7 Definitions 1. Bond: A bond is a debt security issued by institutions such as banks and governments for a period of more than one year in order to raise capital by borrowing. The bearer of the bond receives fixed interests at specific end dates. A pure discount bond makes just one payment of the principal amount and the interest at the end date while a coupon bearing bond makes several payments in the form of coupons over specific periods and payment of the principal amount at the end date. 2. Security: A security is an asset (financial instrument) other than an insurance policy issued by a government, a firm or any other financial organization which offers evidence of debt. 3. Stock: A stock or a share is a fraction of the ownership of a firm or business. 4. Expense ratio: This is the measure of how much it will cost an investment company to operate a mutual fund. This ratio is determined through an annual calculation, where a fund s operating expenses are divided by the average dollar value of its assets under management [1]. 5. Mutual fund: These are groups of investments such as stocks and bonds managed by a fund manager. 6. Market efficiency: This is the extent to which stock prices reflect all available information in the market. 7. Passive investments: These are investments characterized by restricted ongoing buying and selling actions in a well diversified portfolio, with the investors focusing on long term rather than short term profits [2]. 8. Rebalancing: Rebalancing is the process of bringing a portfolio of investments that has deviated from the investor s target asset allocation back to its original mix. This is done in order to control the amount of risk that the portfolio is exposed to. 9. Complementary slackness theorem: The complementary slackness theorem states that where are the optimal solutions to the primal problem and are the slacks of the dual problem. 10. Duality gap: This is the difference between the optimal objective function values of the primal and the dual problems. 11. Feasible set: A feasible set is a set of values that satisfy all constraints. 12. Convex set: Let C be a subset of C is said to be convex if for any two points a,b in C, the line segment joining a and b lies entirely in C. 7

8 13. Extreme points: Let C be a subset of If p is a boundary point of C, then p is called an extreme point if it has the following property: If any line segment lying entirely in C has p as one of its points, then p is an end point of. 14. Strictly feasible point: If is a strictly feasible point of the set then it satisfies the conditions. 15. Basic feasible solution: Basic feasible solution is any solution that arises at the extreme point of the feasible region. One of this solutions or a linear combination of this solutions will be the optimal solution. 8

9 Introduction Background An index fund is a portfolio intended to track the movement of the market as a whole or a given segment of the market. Tracking is done by trying to hold all the securities that constitute the index fund in the same proportion as the market index. Index funds are passive investments. They are also considered as a kind of mutual fund. Decisions concerning what securities are to be bought or sold are mostly carried out by computer programs with very little or no human effort. Index funds have become very popular investments because of the following reasons: 1. Expense ratio; Index funds have lower expense ratios compared to conventional mutual funds because they are passive investments and they generally give the advantage of lower fees and lower taxes in taxable accounts. 2. Empirical performance; top performing funds are not always consistent, which gives room for speculations that their performance are based on luck. However, the main idea behind an index fund is to build a portfolio of securities, such as stocks and bonds, designed to replicate as close as possible a well defined index. 3. Market efficiency; if the market is efficient, it will be impossible to obtain any superior risk adjusted return using stock picking strategies as a result of the fact that the prices reflect all the available information in the market. Also, since the market portfolio provides the best possible return per unit of risk, to the extent that it captures the efficiency of the market via diversification, one may argue that the best theoretical approach to fund management is to invest in an index fund [3]. This is because an index fund is designed to always try to replicate a specific market index. Method There exist several methods of constructing an index fund. A few examples are the large scale deterministic model, the non-linear programming model and the linear programming models. 9

10 i) Large scale deterministic model: Large scale deterministic model separates a group of assets into smaller groups of similar assets and then selects representative asset from each group to be included in the index fund. The similarity between the stocks is determined by the correlation between their returns. The problem is formulated as a linear constraint maximization problem: Subject to In (1), is the correlation between stock i and j. In (2), q is the number of stocks in the index fund, and if j is selected in the fund or 0 otherwise. (3) implies that each stock i has exactly one representative stock j in the index fund, and shows which stock j in the index fund is most similar to i. Thus, if j is the most similar stock in the index fund or otherwise. (4) implies that stock i can be represented by stock j if and only if stock j is in the fund [3]. The weights,, for each j in the fund are calculated as follows: where is the current price of stock i, and the fraction of the index fund to be invested in stock j is given by: 10

11 where is the sum of all the different weights in the index fund and. ii) Non-linear programming model An example of creating an index fund using the non-linear programming model is to create an index fund from a portfolio of mutual funds [4]. First we need to determine the amount in percentage of the portfolio to be invested in each mutual fund that will closely replicate the performance of the market index. Suppose the portfolio consist of the following mutual funds: A, B, C, D, E, and F, and let a, b, c, d, e, and f be the proportions invested in each of the mutual funds respectively. Also, let be the portfolio return for year i, and be the return of the index in year i. Finally, let be the returns of A, B, C, D, E, and F in year i respectively. Then the portfolio returns for the five years period will be: For each period, we compute the square of the deviations between the returns and the index. We square the deviations in order to avoid positive and negative deviations from cancelling out with each other thereby preventing a situation where portfolios with smaller values can behave quite differently than the target index. Thus we have the following optimization problem: subject to 11

12 The minimization problem is considered to be non-linear because of the presence of the quadratic term in the objective function. iii) Linear programming (LP) model LP model or linear optimization is one of the most common and fundamental problems developed as a mathematical model during World War II (1939) by Leonid Kantorovich. The model determines a way to achieve the best possible outcome with minimum cost. LP is the problem of optimizing a linear objective function subject to linear equality and inequality constraints [3]. Our objective is to construct an index fund that tracks a given segment of the market using the interior point method for linear programming. Delimitations The data used in this work was limited to daily data which we obtained from the Dow Jones website. We made several attempts to obtain monthly data including company details from three big indexes but our offers were turned down. Using daily data implies we have to be rebalancing our portfolio daily and this can be somehow expensive and time consuming. Also, since it was not possible to get inside information about company characteristics such as capitalization and payment of dividends, we grouped the companies together depending on the fraction of their weights in the index. 12

13 Thesis Overview Chapter one discusses the LP model and briefly explains two successful techniques of solving LP problems. This chapter also describes the Primal-Dual interior point method in detail, which is the method we used in constructing an index fund. In Chapter two, we discuss the problem modeling and interpretation; we show the technique we used in selecting the various securities to constitute the index fund and how to set up the optimization problem. In chapter three, we apply real data to the optimization problem formulated in chapter two and solve the problem using the Primal-Dual interior point method. This is followed by a conclusion which gives a short summary of the results obtained and an appendix. 13

14 Chapter 1 Linear Programming Model A Linear Programming (LP) problem has the standard form: Subject to (11) where ; and x is the unknown variable vector to be determined, which is called the solution to the LP problem. (11) is known as the Primal of the LP problem. The dual problem corresponding to problem (11) is: Subject to (12) The most successful technique for solving LP problems are the Simplex and the interior point methods. The Simplex method solves an LP problem by use of extreme points. i.e.: it moves from one adjacent extreme point to the next. Thus, the Simplex method moves from one basic feasible solution to the next until the optimum is reached and operates on LP s in standard form (see (11)). Interior point methods are very efficient methods in linear optimization and have remarkable practical performance. The main feature of these methods is that iterates are strictly feasible. i.e.: they lie in the interior of the inequality constraints [5]. 14

15 There are three main classes of interior point algorithms for linear programming and each of these algorithms are constructed by the means of the logarithmic barrier function [6]. These are the path-following methods, potential reduction methods and the affine scaling methods. The algorithms can be differentiated as either primal methods which maintains the feasibility of the primal, dual methods which maintains the feasibility of the dual or primal-dual methods which maintains the feasibility of both the primal and the dual. We used the Primal-Dual methods in solving the optimization problems which arose from the construction of the index fund because this method over the years has proven to be the most efficient for solving LP problems. 1.1 Derivation of the Primal-Dual method The primal problem can be stated in standard form as follow: The dual problem can be stated in standard form as follow: where are dual slack variables. If is an iterate of the primal interior point method, then it satisfies the condition, with and if is an iterate of the dual interior point methods, then it satisfies the condition: with. 15

16 Primal methods compute some estimates of the dual variables and dual methods also compute some estimates of the primal variables. For the case of the primal methods, convergence is achieved when the estimate for the dual is dual feasible and the duality gap within a specified tolerance is zero. Similarly, convergence can be obtained from the dual when the estimate for the primal is primal feasible and the duality gap within a specified tolerance is zero. The Primal-Dual methods solve simultaneously, both the primal and the dual problems. The equality constraints on both the primal and dual are satisfied exactly while the non negativity constraints on and are strictly satisfied. When the duality gap is sufficiently small, meaning that convergence is attained, the algorithm terminates. Suppose is a feasible point to the primal and is a feasible point to the dual, then the following condition can be written on the duality gap [6]: This condition is equivalent to the condition on complementary slackness. Let s consider the equations (P) and (D) above. A is assumed to be an matrix with full row rank while is an nxm matrix with full column rank and denotes the vector of dual slack variables. Let a feasible solution to (P) and (D) be and ( ) respectively. For these points to be optimal to (P) and (D), they must satisfy the complementary slackness conditions: where n is the number of decision variables in the primal. This is same as number of constraints in the dual problem (D). The Primal-Dual method seeks to go through a chain of strictly feasible primal and dual iterates that get more and more closer to satisfying the complementary slackness conditions above. For some parameter, each iteration seeks to find some vectors ) ) and ) Satisfying [6] 16

17 This process is repeated continuously with a reduction in the value of until convergence is attained within a specified tolerance. The strict feasibility of the iterates and s, i.e.: and s is guaranteed by the condition where. The duality gap is also constrained by these conditions. i.e.: This implies that the sequence of primal-dual solutions produced by this algorithm will have decreasing duality gaps. The size of the duality gap determines the closeness to the solution. The points would be optimal if the duality gap were zero. The complementary slackness condition can be written as where X=diag( ) is a diagonal matrix with diagonal term, S= diag( is a diagonal matrix with diagonal term, be the vector whose entries are all equal to one and with length. equally be represented as follows: can The following derivations can be used to obtain an iterative scheme for estimates of the solution to (PD) [6]. If we assume that we have the following estimates: Such that and that must not necessarily be equals to ; then the new estimates closest enough to satisfy these conditions are: 17

18 The primal and dual feasibility conditions would be: and These are systems of linear equations in with complementary slackness: An approximate solution is obtained by ignoring the product because are very small and hence is their product. Therefore, we have as the resulting system of equations: We have so far approximated a system of nonlinear equations by a system of linear equations by using the Newton s method. The search direction for solving (PD) by performing one iteration of the Newton s method at each iteration of the Primal-Dual method is known as the Newton direction. Let obtained by solving the system of linear equations: are 18

19 From (30), Multiply (31) by Now, we define the diagonal matrix D as: and let then solution to (28), (29) and (30) above becomes: and 1.2 Sketch of the Numerical Algorithm With the rapid decrease in the solution might no longer be strictly feasible as required ( would no longer be satisfied). Thus we need to update current estimates as follows [6]: 19

20 with The largest step length is selected such that and are strictly positive and satisfying the following conditions [6]: where and 20

21 Chapter 2 Problem modeling We have n companies from which we want to select companies that would constitute an index fund. Each company represents an asset, therefore the number of assets equals n. We also have m characteristics that we would like the index fund to track. We have chosen four important characteristics; i.e.: m = A, B, C and D, where: If there are p, q, r, and s companies that belong to A, B, C, and D respectively; then the fraction of assets that belong to companies with small, medium and large capitalizations, and companies that pay dividends are respectively [7]: The optimal weights are: This means that: Similarly: 21

22 If company 1 possesses characteristic A, then And thus: Let: The main idea of the derivation of the LP model for index fund construction is based on rebalancing of the portfolio at minimum cost. i.e.: maintain the portfolio s risk closer to the investor s level of risk tolerance. Some investments that do well in a portfolio usually take up more of the portfolio while those that do not do well usually take up less of the portfolio. This will make the portfolio become too risky or too conservative. A very risky portfolio will earn more returns for the investor on a long term basis while on a short term basis, it might cause the investor great loses. If the portfolio is too conservative, the short term risk is reduced but the long term return is also lower. Therefore it is always desirable to keep the portfolio at the investor s preferred level of risk exposure. Therefore the problem formulation is as follows: 22

23 Subject to: where (49) and (50) are defined as in (47) and (45) respectively. (51) and (52) corresponds to constraints on the fractions bought and sold. Writing (51) and (52) in standard form gives: where In order to easily formulate the dual of the above problem, we first of all transform the optimization problem above to blocks of matrices. Therefore the primal blocks can be written as follows: 23

24 Table 1 Table represents constraints of primal problem. From the above blocks, Table 1, the dual to the optimization problem with slack variables added can easily be constructed as follows: Subject to: 24

25 Where: 25

26 The constraints of the dual take the form: where is a matrix of coefficients of w, s is a column matrix of coefficients of the slack variables, and c is a column matrix of coefficients of the primal objective function variables. 26

27 Chapter 3 Implementation 3.1 Data Collection To implement the Primal-Dual method explained above, we used real data from the Dow Jones Industrial Average Index. For simplicity, we selected ten stocks to construct an index fund and all the ten stocks selected constitute the index fund. The selected stocks and their respective weights for the 15 th of April are seen in the table below: Table 4 Table 1 Table showing Stocks and respective weights for the 15 th of April. Now, we choose four characteristics that we want the index fund to track. We choose these characteristics based on their initial weights. i.e.: stocks with initial weights from 0.1% to 2% posses characteristics A, stocks with initial weights from 2.1% to 4% posses characteristics B, stocks with initial weights from 4.1% to 6% posses characteristics C, and stocks with initial weights from 6.1% to 8% posses characteristics D as seen in Table 5: 27

28 Table 5 Grouping of stocks based on their initial weights. The fractions of stocks with various characteristics are: Let the optimal weights of the stocks be: 3.2 The Primal Problem Minimization problem (48) evaluated by data introduced in Chapter 3.1, has the form: Subject to: 28

29 This formulation can be rewritten as: Subject to 29

30 The above constraints are the system of linear equations which should be solved to obtain an initial set of strictly feasible points with assumption that the fraction bought and fraction sold are given. One solution of this system is shown in the Table 6 below: Table 6 Table showing Initial set of strictly feasible points 30

31 The above constraints of the primal problem can also be represented in a matrix form so as to easily formulate the dual as follows: Table 7 31

32 Table showing Block of matrices of the primal problem. 3.3 The Dual Problem Now, taking the dual of (57), we have: Subject to: 32

33 The initial set of feasible solution was obtained by solving the above system of linear equations. One of possible solutions is shown in Table 8 below: 33

34 Table 8 Table showing Initial set of strictly feasible points The entries of table 6 are entries of a 32 x 1 matrix, where the first entries are those of followed by The entries of table 8 constitute two matrices; 25 x 1 and 32 x 1. That is, w and s respectively. These are the initial set of strictly feasible points: 34

35 From starting from 10, we calculated the first iteration of the Primal Dual method as follows: We then computed: For subsequent iterations, we reduced by dividing the preceding by 10 until the duality gap reached a certain tolerance (defined by the user). We then varied the tolerance to see its 35

36 effect on the weights and observed that the weights changes with changes in tolerance as seen in Table 9 below. Table 9 36

37 37

38 Table showing Tolerance, Optimal weights, Duality gaps, Primal objective function value, Number of iterations and 3.4 Financial interpretation of results It is observed that decrease in yields a decrease in objective function value and vice versa. measures how close the duality gap is to zero since the objective is to make the duality gap as close to zero as possible. is the risk and the smaller the more risk averse an investor is and vice versa. 38

39 The objective function value is the return and the more risk an investor is willing to take the greater the expected return and the more risk averse an investor is the smaller the expected return. Note, however, that the problem is formulated as a minimization problem (minimizing fraction bought and sold), therefore with decreasing implies more risk aversion and hence a smaller objective function value. Notice that same optimal weights are observed from a tolerance of to with same value of ( and also from a tolerance of to with same value of i.e.: the same risk for different tolerance yield the same expected return. Varying y and z in (57) Now, with variations in amounts bought and sold, the following results are obtained: Table 10 Table showing variations in amounts bought and sold. 39

40 Table 11 Table showing Tolerance, Optimal weights, Duality gaps, Primal objective function value, Number of iterations and 40

41 The Java Script Chapter 4 The java package consists of a class called matrixoperation and a main class called InteriorPm. In the class, we defined nine methods: 1. matrixdiagonal that computes a diagonal matrix from a vector. 2. matrixmultiplication that computes the product of two matrices. 3. matrixsubtraction that computes the difference of two matrices. 4. matrixaddition that computes the sum of two matrices. 5. matrixtranspose that computes the transpose of a matrix. 6. matrixinverse that computes the inverse of a matrix. 7. matrixscalamulti that computes the product of a matrix and a scalar. 8. printmatrix that displays a matrix. 9. ratio_test that computes NB. The code for matrixinverse was taken from the internet and uses Gaussian elimination for computing the inverse of a matrix [8]. The main class consists of matrix A, e, s, initial set of feasible solutions, x and w, from the primal problem and the dual problem respectively. e, s, x, w are all defined as matrices. We then designed an applet with tolerance as an input parameter and outputs parameters: objective function value, number of iterations, Mu and optimal weights as seen in Fig 1 below: 41

42 Fig 1 The applet is constructed in such a way that you can only enter a positive tolerance. If a wrong value is input i.e.: a negative number or any other character, then an error message will pop up reminding the user to input the proper value. Also, the user is not allowed to edit in any other text field other than that for the tolerance. See Fig 2, 3, 4, 6, and 7 below: 42

43 Fig2 Right input for tolerance 43

44 Fig 2 Non positive tolerance entered Fig 3 Error message 44

45 Fig 4 Characters other than a positive number entered for tolerance Fig 5 Error message 45

46 Conclusion In this paper, we have constructed an index fund using sample companies and daily data from the Dow Jones Industrial Average Index. The problem was modeled as a portfolio rebalancing problem. The primal problem was formulated from which the dual was obtained. Initial feasible solutions for both the primal and the dual were calculated manually and the problem was solved using the Primal-Dual interior point method. The optimal weights that are obtained indicate the fraction of an investor s wealth that can be invested in the corresponding companies in the index fund. This investment will yield a return that will be close to the market return indicated by the Dow Jones Industrial Average Index for that day. These optimal weights are the new weights in the investor s rebalanced portfolio and since these weights were obtained by solving a minimization problem, it implies that we have obtained a rebalanced portfolio at minimum cost. In both the Matlab and Java scripts, the initial feasible solutions were calculated manually and the number of companies used was limited to ten which yielded many constraint equations for both primal and dual problems. With more companies more constraints equations are obtained, which are difficult to handle manually. However, with the use of more sophisticated software, it is possible to easily calculate initial feasible solutions and also include more than ten companies in the index fund. 46

47 References [1] Investopedia Expense Ratio. January < [2] Elton, Edwin J. et al. Modern Portfolio Theory and Investment Analysis. John Wiley & Sons [3] Cornuejols, Gerard & Tutuncu, Reha, Optimization Methods in Finance. Cambridge University Press UK [4] Anderson, R David. et al. An Introduction to Management Science: Quantitative Approaches to Decision Making, 12e. Thomson Corporation USA [5] Igor Griva. et al. Linear and Nonlinear Optimization. Second Edition SIAM 2009 [6] Jorge Nocedal, Stephen J. Wright, Numerical Optimization.Second Edition Springer Science & Business Media, LLC [7] Nigel, Meade and Salkin, Gerald R, Index Funds Construction and Performance Measurement. The Management School, Imperial College, London. Journal of the Operational Research Society Vol. 40, No. 10, [8] Java code for matrix inverse. < [9] Brandimarte, P. Numerical Methods in Finance: A Matlab Based Introduction. A Wiley-Interscience Publication

48 Appendix Java Code // Class matrixoperation: /* * To change this template, choose Tools Templates * and open the template in the editor. */ /** * marius */ public class matrixoperation { double s[][]; static int i=0,j=0; double invs,diagx; public static double[][] matrixdiagonal(double a[]){ int n = a.length; double diag[][]=new double [n][n];// initialising array for( i=0;i<n;i++) { for (j = 0; j < n; j++) { 48

49 diag[i][j] = 0; if(i==j){ diag[i][j]=a[i]; System.out.print(diag[i][j]); return diag; public static void printmatrix(double a[][]) { int n=a.length; int m =a[0].length; for (int ii=0; ii<n; ++ii) for ( int h = 0; h<m; h++) { System.out.print(a[ii][h] + " "); public static double[][] matrixscalarmulti(double a[][], double b) 49

50 { int n=a.length; int m=a[0].length; double A_sc[][]= new double[n][m];// initialising the array. //double c=1; for(int i=0;i<n;i++) for( int j=0;j<m;j++) A_sc[i][j] =b*a[i][j]; return A_sc; public static double[][] matrixaddition(double a[][],double b[][]) { int k1,k2= 0; k1 = a.length; k2= b[0].length; double sum[][]=new double[k1][k2]; for( int i=0;i<k1;i++) { for (int j = 0; j < k2; j++) { sum[i][j] = a[i][j] + b[i][j]; System.out.print(sum[i][j]); 50

51 return sum; public static double[][] matrixsubtraction(double a[][],double b[][]) { int k1,k2= 0; k1 = a.length; k2= a[0].length; double diff[][]=new double[k1][k2]; for( int i=0;i<k1;i++) { for (int j = 0; j < k2; j++) { diff[i][j] = a[i][j] - b[i][j]; System.out.print(diff[i][j]+" "); return diff; public static double[][] matrixtranspose(double a[][]) { int k1,k2=0; k1= a.length; 51

52 k2= a[0].length; double A_tr[][]= new double [k2][k1];// initialising array for( i=0;i<k2;i++) { for (j = 0; j < k1; j++) { A_tr[i][j] = a[j][i]; System.out.print(A_tr[i][j] + " "); return A_tr; public static double ratio_test(double x[], double delta[]) { int n=delta.length; double alpha; double ratio[]= new double[n]; for(i=0;i<n;i++) { ratio[i] = ; if ( delta[i] < 0.0) { 52

53 ratio[i] = -x[i]/delta[i]; j++; Constructing an Index Fund Using Interior Point Primal Dual Method alpha = ratio[0]; for(i=1;i<n;i++) { if (ratio[i]<=alpha) alpha=ratio[i]; return alpha; public static double[][] matrixmultiplication(double a[][], double b[][]) { int nn, mm, nk; nn = a.length;//number of rows in matrix a mm = b[0].length;//number of columns in matrix b nk = a[0].length; // number of columns in a double product[][] = new double[nn][mm]; int k; for (i=0; i<nn;i++) { for (j = 0; j < mm; j++) 53

54 { for (k = 0; k < nk; k++){ product[i][j]=product[i][j]+a[i][k]*b[k][j]; System.out.print(product[i][j]+" "); return product; // [8] reference to matrix inverse public static double[][] matrixinverse(double a[][]){ int n=a.length; double x[][] = new double[n][n]; double b[][] = new double[n][n]; int index[] = new int[n]; for (int i=0; i<n; ++i) b[i][i] = 1; // Transform the matrix into an upper triangle gaussian(a, index); // Update the matrix b[i][j] with the ratios stored for (int i=0; i<n-1; ++i) 54

55 for (int j=i+1; j<n; ++j) for (int k=0; k<n; ++k) b[index[j]][k] -= a[index[j]][i]*b[index[i]][k]; // Perform backward substitutions for (int i=0; i<n; ++i) { x[n-1][i] = b[index[n-1]][i]/a[index[n-1]][n-1]; for (int j=n-2; j>=0; --j) { x[j][i] = b[index[j]][i]; for (int k=j+1; k<n; ++k) { x[j][i] -= a[index[j]][k]*x[k][i]; x[j][i] /= a[index[j]][j]; return x; public static void gaussian(double a[][],int index[]) { int n = index.length; double c[] = new double[n]; // Initialize the index for (int i=0; i<n; ++i) index[i] = i; // Find the rescaling factors, one from each row 55

56 for (int i=0; i<n; ++i) { double c1 = 0; for (int j=0; j<n; ++j) { double c0 = Math.abs(a[i][j]); if (c0 > c1) c1 = c0; c[i] = c1; // Search the pivoting element from each column int k = 0; for (int j=0; j<n-1; ++j) { double pi1 = 0; for (int i=j; i<n; ++i) { double pi0 = Math.abs(a[index[i]][j]); pi0 /= c[index[i]]; if (pi0 > pi1) { pi1 = pi0; k = i; // Interchange rows according to the pivoting order int itmp = index[j]; index[j] = index[k]; 56

57 index[k] = itmp; for (int i=j+1; i<n; ++i) { double pj = a[index[i]][j]/a[index[j]][j]; // Record pivoting ratios below the diagonal a[index[i]][j] = pj; // Modify other elements accordingly for (int l=j+1; l<n; ++l) a[index[i]][l] -= pj*a[index[j]][l]; // Main Class InteriorPm: /* * To change this template, choose Tools Templates * and open the template in the editor. */ /** * marius */ 57

58 public class InteriorPm { Constructing an Index Fund Using Interior Point Primal Dual Method /** args the command line arguments */ public static void main(string[] args) { // double Duality_gap=100; // for(int i=0;i<15;i++){ // // // if(duality_gap>math.pow(10, -7)){ // u=math.pow(10, -i); // double A[][]={{0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58

59 {1, 0, 0, 0,0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, {-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, {0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, {0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 59

60 {0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, {0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, {0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, {0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, {0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, {0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1; double s[][]= {{1, {3, {4, {3, {3, {3, {3, {1, {3, {3, {1, {1, {1, {1, {1, {1, {1, {1, {1, {0.5, {1, {1, {1, {1, {1, {1, {1, {1, {1, {0.5, {0.5, {0.5; // double x[][] = {{ , { 0.025, {0.1, {0.0875, {0.1375, { , // { , { , {0.15, {0.125, {0.2, {0.5, { , {0.214, {0.2717, // {0.2687, {0.2555, { , { , { , {0.3392, {0.2839, { , // {0.464, {0.3717, {0.3937, {0.2805, { , { , { , {0.3392, {0.3339; // double x[][] = {{0.0125, {0.05, {0.1, {0.15, {0.025, {0.2625, {0.005, 60

61 {0.195, {0.175, {0.025, {0.1, {0.4, {0.0555, {0.0139, {0.1717, {0.2312, {0.043, {0.3176, {0.0379, {0.228, {0.2642, {0.0839, {0.3305, {0.24, {0.2717, {0.3662, {0.293, {0.0926, { , {0.138, {0.2142, {0.3339; double w[][] = {{-1, {-2, {1, {1, {-2, {0, {0, {0, {0, {0, {0, {0, {0, {0, {-0.5, {0, {0, {0, {0, {0, {0, {0, {0, {0, {-0.5; double e[][]= {{1,{1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1, {1; double x_tr[][],duality_gap[][], residual[][]; int counter; double tol = 0.01;// input tolerance duality_gap = new double[1][1]; residual= new double[1][1]; double u =10; residual[0][0] = 100; double X[][],S[][]; double a_x[],a_s[]; int n= x.length; // int m= s.length; //System.out.println(n); prints out the length of x. a_x = new double[n]; a_s = new double[m]; X = new double[n][n]; 61

62 S = new double[m][m]; //ue=new double[l][ln]; double D[][],invS[][]; D=new double [m][n]; invs=new double[m][m]; double XS[][], ue[][],v_u[][]; XS = new double[n][m]; duality_gap = residual; double res = duality_gap[0][0]; // a scalar copy of matrix duality_gap double Delta_w[][], Delta_x[][], AD[][],A_tr[][], ADA_tr[][], invada_tr[][]; double invad_a_tr_invs_vu[][], invada_tr_a[][],invada_tr_a_invs[][]; double Delta_s[][], A_tr_Delta_w[][],X_new[][],D_new[][],S_new[][]; double invs_v_u[][], D_Delta_s[][],invADA_tr_A_invS_v_u[][]; double alpha_p, alpha_d,alpha_max, Ratio, XSe[][]; counter=0; int l = e.length; int ln=e[0].length; ue=new double[l][ln]; int ll = ue.length; int lnn=ue[0].length; v_u=new double[ll][lnn]; int m1=a.length; int m2=a[0].length; 62

63 AD= new double [m2][n]; ADA_tr=new double[m1][m1]; A_tr= new double[m2][m1]; invada_tr= new double[m1][m1]; invada_tr_a= new double[m1][m1]; invada_tr_a_invs=new double [m1][m]; invada_tr_a_invs_v_u= new double [m1][lnn]; int lll = invada_tr_a_invs_v_u.length; int lnnn=invada_tr_a_invs_v_u[0].length; Delta_w=new double[lll][lnnn]; A_tr_Delta_w=new double [m2][lnnn]; int llll = A_tr_Delta_w.length; int lnnnn=a_tr_delta_w[0].length; Delta_s=new double[llll][lnnnn]; invs_v_u = new double[m][lnn]; D_Delta_s = new double[m][lnnnn]; Delta_x = new double[m][lnnnn]; double a_delta_x[];//,a_s[]; int n1= Delta_x.length; a_delta_x = new double[n1]; double a_delta_s[];//,a_s[]; int n2= Delta_s.length; a_delta_s = new double[n2]; 63

64 double Alpha_max_Delta_x[][], x_new[][]; int lllll = Delta_x.length; int lnnnnn=delta_x[0].length; Alpha_max_Delta_x=new double[lllll][lnnnnn]; x_new=new double [lllll][lnnnnn]; double Alpha_max_Delta_w[][], w_new[][]; int llllll = Delta_w.length; int lnnnnnn=delta_w[0].length; Alpha_max_Delta_w=new double[llllll][lnnnnnn]; w_new= new double[llllll][lnnnnnn]; double Alpha_max_Delta_s[][], s_new[][]; int lllllll,lnnnnnnn=0; lllllll = Delta_s.length; lnnnnnnn=delta_s[0].length; Alpha_max_Delta_s=new double[lllllll][lnnnnnnn]; s_new= new double [m][m]; x_tr=new double[n][m]; while (Math.abs(duality_gap[0][0])> tol) { counter++; System.out.println("Number of Iteration = " + counter +". u = "+ u + "."); 64

65 System.out.println("This is a_x "); for(int k=0;k<n;k++) { a_x[k] = x[k][0]; System.out.println(a_x[k]); System.out.println("This is a_s "); for(int k=0;k<m;k++) { a_s[k] = s[k][0]; System.out.println(a_s[k]); System.out.println("This is X "); X=matrixOperation.matrixDiagonal(a_x);//input for matrix diagonal is x System.out.println("This is S "); S=matrixOperation.matrixDiagonal(a_s);//input for matrix diagonal is s System.out.println("This is ue "); ue =matrixoperation.matrixscalarmulti(e,u);// input matrices for //multiplication are u and e 65

66 for(int i=0;i<l;i++) for(int j= 0;j<ln;j++){ System.out.println(ue[i][j]); System.out.println("This is XS "); XS=matrixOperation.matrixmultiplication(X, S);//input matrices for //multiplication are X and S System.out.println("This is XSe "); XSe=matrixOperation.matrixmultiplication(XS, e);//input matrices for //multiplication are XS and S System.out.println("This is v_u "); v_u= matrixoperation.matrixsubtraction(ue, XSe); System.out.println(" This is invs "); invs=matrixoperation.matrixinverse(s);//input for matrix inverse is S System.out.println(" This is D "); D=matrixOperation.matrixmultiplication(invS, X);// input matrices for //multiplication are invs and X 66

67 System.out.println(" This is AD "); AD= matrixoperation.matrixmultiplication(a, D);//input matrices for //multiplication are A and D System.out.println(" This is A_tr "); A_tr=matrixOperation.matrixtranspose(A);//input matrix for transpose A System.out.println(" This is ADA_tr "); ADA_tr= matrixoperation.matrixmultiplication(ad, A_tr);//input matrices for //multiplication are AD and AD_tr System.out.println(" This is invada_tr "); invada_tr=matrixoperation.matrixinverse(ada_tr);//input matrices for //inverse is ADA_tr System.out.println(" This is invada_tr_a "); invada_tr_a=matrixoperation.matrixmultiplication(invada_tr, A);//input //matrices //for multiplicatiion are invada_tr and A System.out.println(" This is invada_tr_a_invs "); 67

68 invada_tr_a_invs=matrixoperation.matrixmultiplication(invada_tr_a, invs);//input //matrices for multiplicatiion //are invada_tr_a and invs System.out.println(" This is invada_tr_a_invs_v_u "); invada_tr_a_invs_v_u=matrixoperation.matrixmultiplication(invada_tr_a_invs, v_u); //input matrices for multiplicatiion are invada_tr_a_invs and v_u System.out.println(" This is Delta_w"); Delta_w=matrixOperation.matrixScalarMulti(invADA_tr_A_invS_v_u, -1);//input //for matrix multiplicatiion //is the scalar -1 and invada_tr_a_invs_v_u for(int i=0;i<lll;i++) for(int j= 0;j<lnnn;j++){ System.out.println(Delta_w[i][j]+" "); //calculation of Delta_s System.out.println(" This is A_tr_Delta_w"); A_tr_Delta_w=matrixOperation.matrixmultiplication(A_tr, Delta_w);//input // matrices for multiplication are A_tr and Delta_W System.out.println(" This is Delta_s"); 68

69 Delta_s=matrixOperation.matrixScalarMulti(A_tr_Delta_w, -1);//input //matrices for multiplication are Delta_W and -1. for(int i=0;i<llll;i++) for(int j= 0;j<lnnnn;j++){ System.out.println(Delta_s[i][j]+" "); //Calculation of Delta_x System.out.println(" This is invs_v_u"); invs_v_u=matrixoperation.matrixmultiplication(invs, v_u);//input matrices //for multiplication are invs and V_u. System.out.println(" This is D_Delta_s"); D_Delta_s=matrixOperation.matrixmultiplication(D, Delta_s);//input matrices //for multiplication are D and Delta_s. System.out.println(" This is Delta_x"); Delta_x=matrixOperation.matrixsubtraction(invS_v_u, D_Delta_s);//input //matrices for multiplication // are invs,,v_u,d,and Delta_s respectively. // find indices of negative elements and calculating ratios of Delta_x 69

70 System.out.print("This is alpha_p : "); // calculates alpha_p and alpha_d for(int i=0;i<n1;i++) { a_delta_x[i] = Delta_x[i][0]; alpha_p=matrixoperation.ratio_test(a_x,a_delta_x); System.out.println(alpha_p); // calculates minimum element using ratio_p as input //alpha_d=matrixoperation.ratio_test();// calculates minimum element //using ratio_d as input System.out.print("This is alpha_d : "); for(int i=0;i<n2;i++) { a_delta_s[i] = Delta_s[i][0]; // System.out.println(a_x[k]); alpha_d=matrixoperation.ratio_test(a_s,a_delta_s); System.out.println(alpha_d); System.out.print("This is Alpha_max : "); Alpha_max =0.9999*Math.min(alpha_p,alpha_d); System.out.println(Alpha_max); 70

71 //calculating x_new System.out.println(" This is Alpha_max_Delta_x "); Alpha_max_Delta_x=matrixOperation.matrixScalarMulti(Delta_x, Alpha_max); // inputs for //matrix multiplications are //the scalar Alpha_max and the matrix Delta_x for(int i=0;i<lllll;i++) for(int j= 0;j<lnnnnn;j++){ System.out.println(Alpha_max_Delta_x[i][j]+" "); System.out.println("This is x_new"); x=matrixoperation.matrixaddition(x, Alpha_max_Delta_x); System.out.println(" This is Alpha_max_Delta_w "); Alpha_max_Delta_w=matrixOperation.matrixScalarMulti(Delta_w, Alpha_max); // inputs for matrix multiplications are //the scalar Alpha_max and the matrix Delta_w for(int i=0;i<llllll;i++) for(int j= 0;j<lnnnnnn;j++){ System.out.println(Alpha_max_Delta_w[i][j]+ " "); 71

72 System.out.println("This is w_new"); w=matrixoperation.matrixaddition(w, Alpha_max_Delta_w);// inputs for //matrix addition are the w(vector) and Alpha_max*Delta_w System.out.println(" This is Alpha_max_Delta_s "); Alpha_max_Delta_s=matrixOperation.matrixScalarMulti(Delta_s, Alpha_max); // inputs for matri multiplications are the scalar Alpha_max //and the matrix Delta_s for(int i=0;i<llllll;i++) for(int j= 0;j<lnnnnnn;j++){ System.out.println(Alpha_max_Delta_s[i][j]+ " "); System.out.println("This is s_new"); s=matrixoperation.matrixaddition(s, Alpha_max_Delta_s); System.out.println("This is x_tr"); x_tr=matrixoperation.matrixtranspose(x);// input for matrix transpose is x System.out.println(" This is Duality_gap "); duality_gap=matrixoperation.matrixmultiplication(x_tr, s); // inputs for 72

73 //matrix multiplication are x transpose and s System.out.println(" This is Residual "); residual[0][0] = duality_gap[0][0] - n*u; res = duality_gap[0][0]; matrixoperation.printmatrix(residual); // UPDATES // Update for X System.out.println("This is update for X"); X=matrixOperation.matrixDiagonal(a_x);// input is x(vector) //update for S System.out.println("This is update for S"); S = matrixoperation.matrixdiagonal(a_s);// input is s(vector) //update for D System.out.println("This is update for D"); D=matrixOperation.matrixmultiplication(invS, X);// input for matrix //multiplica invs and X // Updates for u u/=10; 73

74 System.out.println("These are Optimal Weights"); double OptimalWeights[]= new double[n]; int ii; for(ii=0;ii<10;ii++){ OptimalWeights[ii]= x[ii][0]; System.out.println(OptimalWeights[ii]); System.out.println("These are Fractions Bought and Sold"); double FractionBought_and_Sold[]= new double[n]; for(ii=12;ii<n;ii++){ FractionBought_and_Sold[ii]= x[ii][0]; System.out.println(FractionBought_and_Sold[ii]); double ObjectiveFunctionValue =0; for(ii=12;ii<n;ii++){ ObjectiveFunctionValue+= x[ii][0]; System.out.println("Objective function value = " + ObjectiveFunctionValue); 74

75 Applet Code: /* * To change this template, choose Tools Templates * and open the template in the editor. */ /* * AppletApplet.java * * Created on 2011-jun-09, 15:17:24 */ /** * marius */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; import java.util.*; public class AppletApplet extends javax.swing.japplet { 75

76 /** Initializes the applet AppletApplet */ public void init() { try { java.awt.eventqueue.invokeandwait(new Runnable() { public void run() { initcomponents(); ); catch (Exception ex) { ex.printstacktrace(); /** This method is called from within the init() method to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. // <editor-fold defaultstate="collapsed" desc="generated Code"> private void initcomponents() { 76

77 jlabel1 = new javax.swing.jlabel(); jtextfield1 = new javax.swing.jtextfield(); jtextfield2 = new javax.swing.jtextfield(); jtextfield3 = new javax.swing.jtextfield(); jtextfield4 = new javax.swing.jtextfield(); jtextfield5 = new javax.swing.jtextfield(); jtextfield6 = new javax.swing.jtextfield(); jtextfield7 = new javax.swing.jtextfield(); jtextfield8 = new javax.swing.jtextfield(); jtextfield9 = new javax.swing.jtextfield(); jtextfield10 = new javax.swing.jtextfield(); jtextfield11 = new javax.swing.jtextfield(); jtextfield12 = new javax.swing.jtextfield(); jtextfield13 = new javax.swing.jtextfield(); jtextfield14 = new javax.swing.jtextfield(); jlabel2 = new javax.swing.jlabel(); jlabel3 = new javax.swing.jlabel(); jlabel4 = new javax.swing.jlabel(); jlabel5 = new javax.swing.jlabel(); jbutton1 = new javax.swing.jbutton(); jbutton2 = new javax.swing.jbutton(); jlabel1.settext("enter Tolerance"); 77

78 jtextfield1.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jtextfield1actionperformed(evt); ); jlabel2.settext("objective Function Value"); jlabel3.settext("number of Iterations"); jlabel4.settext("mu"); jlabel5.settext("optimal Weights"); jbutton1.settext("run"); jbutton1.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jbutton1actionperformed(evt); ); jbutton2.settext("clear"); 78

79 jbutton2.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jbutton2actionperformed(evt); ); javax.swing.grouplayout layout = new javax.swing.grouplayout(getcontentpane()); getcontentpane().setlayout(layout); layout.sethorizontalgroup( layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addgroup(layout.createsequentialgroup().addgap(258, 258, 258).addComponent(jButton2).addContainerGap(638, Short.MAX_VALUE)).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGap(113, 113, 113).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel3).addComponent(jLabel4) 79

80 .addcomponent(jlabel1).addcomponent(jlabel2)).addgap(12, 12, 12).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTextField1, javax.swing.grouplayout.preferred_size, 199, javax.swing.grouplayout.preferred_size).addgroup(layout.createsequentialgroup().addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.trailing, false).addcomponent(jtextfield3, javax.swing.grouplayout.alignment.leading).addcomponent(jtextfield2, javax.swing.grouplayout.alignment.leading, javax.swing.grouplayout.default_size, 207, Short.MAX_VALUE).addComponent(jTextField4, javax.swing.grouplayout.alignment.leading)).addpreferredgap(javax.swing.layoutstyle.componentplacement.related)))).addgroup(layout.createsequentialgroup().addgap(201, 201, 201).addComponent(jButton1))).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 80

MATH3016: OPTIMIZATION

MATH3016: OPTIMIZATION MATH3016: OPTIMIZATION Lecturer: Dr Huifu Xu School of Mathematics University of Southampton Highfield SO17 1BJ Southampton Email: h.xu@soton.ac.uk 1 Introduction What is optimization? Optimization is

More information

Simulation. Lecture O1 Optimization: Linear Programming. Saeed Bastani April 2016

Simulation. Lecture O1 Optimization: Linear Programming. Saeed Bastani April 2016 Simulation Lecture O Optimization: Linear Programming Saeed Bastani April 06 Outline of the course Linear Programming ( lecture) Integer Programming ( lecture) Heuristics and Metaheursitics (3 lectures)

More information

* To change this license header, choose License Headers in Project Properties.

* To change this license header, choose License Headers in Project Properties. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. package tugasumbyjava; /**

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information

Chapter II. Linear Programming

Chapter II. Linear Programming 1 Chapter II Linear Programming 1. Introduction 2. Simplex Method 3. Duality Theory 4. Optimality Conditions 5. Applications (QP & SLP) 6. Sensitivity Analysis 7. Interior Point Methods 1 INTRODUCTION

More information

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 Mathematical programming (optimization) problem: min f (x) s.t. x X R n set of feasible solutions with linear objective function

More information

Some Advanced Topics in Linear Programming

Some Advanced Topics in Linear Programming Some Advanced Topics in Linear Programming Matthew J. Saltzman July 2, 995 Connections with Algebra and Geometry In this section, we will explore how some of the ideas in linear programming, duality theory,

More information

Answer on question #61311, Programming & Computer Science / Java

Answer on question #61311, Programming & Computer Science / Java Answer on question #61311, Programming & Computer Science / Java JSP JSF for completion Once the user starts the thread by clicking a button, the program must choose a random image out of an image array,

More information

PRIMAL-DUAL INTERIOR POINT METHOD FOR LINEAR PROGRAMMING. 1. Introduction

PRIMAL-DUAL INTERIOR POINT METHOD FOR LINEAR PROGRAMMING. 1. Introduction PRIMAL-DUAL INTERIOR POINT METHOD FOR LINEAR PROGRAMMING KELLER VANDEBOGERT AND CHARLES LANNING 1. Introduction Interior point methods are, put simply, a technique of optimization where, given a problem

More information

Programming, numerics and optimization

Programming, numerics and optimization Programming, numerics and optimization Lecture C-4: Constrained optimization Łukasz Jankowski ljank@ippt.pan.pl Institute of Fundamental Technological Research Room 4.32, Phone +22.8261281 ext. 428 June

More information

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017 Section Notes 5 Review of Linear Programming Applied Math / Engineering Sciences 121 Week of October 15, 2017 The following list of topics is an overview of the material that was covered in the lectures

More information

Java Programming Summer 2008 LAB. Thursday 8/21/2008

Java Programming Summer 2008 LAB. Thursday 8/21/2008 LAB Thursday 8/21/2008 Design and implement the program that contains a timer. When the program starts, the timer shows 00:00:00. When we click the Start button, the timer starts. When we click the Stop

More information

BCN Decision and Risk Analysis. Syed M. Ahmed, Ph.D.

BCN Decision and Risk Analysis. Syed M. Ahmed, Ph.D. Linear Programming Module Outline Introduction The Linear Programming Model Examples of Linear Programming Problems Developing Linear Programming Models Graphical Solution to LP Problems The Simplex Method

More information

16.410/413 Principles of Autonomy and Decision Making

16.410/413 Principles of Autonomy and Decision Making 16.410/413 Principles of Autonomy and Decision Making Lecture 17: The Simplex Method Emilio Frazzoli Aeronautics and Astronautics Massachusetts Institute of Technology November 10, 2010 Frazzoli (MIT)

More information

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited. page v Preface xiii I Basics 1 1 Optimization Models 3 1.1 Introduction... 3 1.2 Optimization: An Informal Introduction... 4 1.3 Linear Equations... 7 1.4 Linear Optimization... 10 Exercises... 12 1.5

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture - 35 Quadratic Programming In this lecture, we continue our discussion on

More information

* To change this license header, choose License Headers in Project Properties.

* To change this license header, choose License Headers in Project Properties. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. */ package calci; /** * *

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

David G. Luenberger Yinyu Ye. Linear and Nonlinear. Programming. Fourth Edition. ö Springer

David G. Luenberger Yinyu Ye. Linear and Nonlinear. Programming. Fourth Edition. ö Springer David G. Luenberger Yinyu Ye Linear and Nonlinear Programming Fourth Edition ö Springer Contents 1 Introduction 1 1.1 Optimization 1 1.2 Types of Problems 2 1.3 Size of Problems 5 1.4 Iterative Algorithms

More information

Linear Programming Problems

Linear Programming Problems Linear Programming Problems Two common formulations of linear programming (LP) problems are: min Subject to: 1,,, 1,2,,;, max Subject to: 1,,, 1,2,,;, Linear Programming Problems The standard LP problem

More information

Part 4. Decomposition Algorithms Dantzig-Wolf Decomposition Algorithm

Part 4. Decomposition Algorithms Dantzig-Wolf Decomposition Algorithm In the name of God Part 4. 4.1. Dantzig-Wolf Decomposition Algorithm Spring 2010 Instructor: Dr. Masoud Yaghini Introduction Introduction Real world linear programs having thousands of rows and columns.

More information

INTRODUCTION TO LINEAR AND NONLINEAR PROGRAMMING

INTRODUCTION TO LINEAR AND NONLINEAR PROGRAMMING INTRODUCTION TO LINEAR AND NONLINEAR PROGRAMMING DAVID G. LUENBERGER Stanford University TT ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California London Don Mills, Ontario CONTENTS

More information

Advanced Operations Research Techniques IE316. Quiz 2 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 2 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 2 Review Dr. Ted Ralphs IE316 Quiz 2 Review 1 Reading for The Quiz Material covered in detail in lecture Bertsimas 4.1-4.5, 4.8, 5.1-5.5, 6.1-6.3 Material

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Lecture notes on Transportation and Assignment Problem (BBE (H) QTM paper of Delhi University)

Lecture notes on Transportation and Assignment Problem (BBE (H) QTM paper of Delhi University) Transportation and Assignment Problems The transportation model is a special class of linear programs. It received this name because many of its applications involve determining how to optimally transport

More information

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS GRADO EN A.D.E. GRADO EN ECONOMÍA GRADO EN F.Y.C. ACADEMIC YEAR 2011-12 INDEX UNIT 1.- AN INTRODUCCTION TO OPTIMIZATION 2 UNIT 2.- NONLINEAR PROGRAMMING

More information

Linear Programming: Introduction

Linear Programming: Introduction CSC 373 - Algorithm Design, Analysis, and Complexity Summer 2016 Lalla Mouatadid Linear Programming: Introduction A bit of a historical background about linear programming, that I stole from Jeff Erickson

More information

Introduction. Linear because it requires linear functions. Programming as synonymous of planning.

Introduction. Linear because it requires linear functions. Programming as synonymous of planning. LINEAR PROGRAMMING Introduction Development of linear programming was among the most important scientific advances of mid-20th cent. Most common type of applications: allocate limited resources to competing

More information

Lecture 5: Duality Theory

Lecture 5: Duality Theory Lecture 5: Duality Theory Rajat Mittal IIT Kanpur The objective of this lecture note will be to learn duality theory of linear programming. We are planning to answer following questions. What are hyperplane

More information

Linear Programming. Linear programming provides methods for allocating limited resources among competing activities in an optimal way.

Linear Programming. Linear programming provides methods for allocating limited resources among competing activities in an optimal way. University of Southern California Viterbi School of Engineering Daniel J. Epstein Department of Industrial and Systems Engineering ISE 330: Introduction to Operations Research - Deterministic Models Fall

More information

/** Creates new form NewJFrame */ public NewJFrame() { initcomponents(); initblogsearch(); //initializes Index List box }

/** Creates new form NewJFrame */ public NewJFrame() { initcomponents(); initblogsearch(); //initializes Index List box } /* * To change this template, choose Tools Templates * and open the template in the editor. */ /* * NewJFrame.java * * Created on Apr 17, 2011, 1:13:13 PM */ /** * * @author Kelli */ import java.io.*;

More information

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization? Linear and Integer Programming 15-853:Algorithms in the Real World Linear and Integer Programming I Introduction Geometric Interpretation Simplex Method Linear or Integer programming maximize z = c T x

More information

Linear programming II João Carlos Lourenço

Linear programming II João Carlos Lourenço Decision Support Models Linear programming II João Carlos Lourenço joao.lourenco@ist.utl.pt Academic year 2012/2013 Readings: Hillier, F.S., Lieberman, G.J., 2010. Introduction to Operations Research,

More information

Generalized Network Flow Programming

Generalized Network Flow Programming Appendix C Page Generalized Network Flow Programming This chapter adapts the bounded variable primal simplex method to the generalized minimum cost flow problem. Generalized networks are far more useful

More information

Programs. Introduction

Programs. Introduction 16 Interior Point I: Linear Programs Lab Objective: For decades after its invention, the Simplex algorithm was the only competitive method for linear programming. The past 30 years, however, have seen

More information

Linear Programming. Course review MS-E2140. v. 1.1

Linear Programming. Course review MS-E2140. v. 1.1 Linear Programming MS-E2140 Course review v. 1.1 Course structure Modeling techniques Linear programming theory and the Simplex method Duality theory Dual Simplex algorithm and sensitivity analysis Integer

More information

Lesson 11: Duality in linear programming

Lesson 11: Duality in linear programming Unit 1 Lesson 11: Duality in linear programming Learning objectives: Introduction to dual programming. Formulation of Dual Problem. Introduction For every LP formulation there exists another unique linear

More information

TMA946/MAN280 APPLIED OPTIMIZATION. Exam instructions

TMA946/MAN280 APPLIED OPTIMIZATION. Exam instructions Chalmers/GU Mathematics EXAM TMA946/MAN280 APPLIED OPTIMIZATION Date: 03 05 28 Time: House V, morning Aids: Text memory-less calculator Number of questions: 7; passed on one question requires 2 points

More information

Math 5593 Linear Programming Lecture Notes

Math 5593 Linear Programming Lecture Notes Math 5593 Linear Programming Lecture Notes Unit II: Theory & Foundations (Convex Analysis) University of Colorado Denver, Fall 2013 Topics 1 Convex Sets 1 1.1 Basic Properties (Luenberger-Ye Appendix B.1).........................

More information

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm LECTURE 6: INTERIOR POINT METHOD 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm Motivation Simplex method works well in general, but suffers from exponential-time

More information

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini DM545 Linear and Integer Programming Lecture 2 The Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Outline 1. 2. 3. 4. Standard Form Basic Feasible Solutions

More information

VARIANTS OF THE SIMPLEX METHOD

VARIANTS OF THE SIMPLEX METHOD C H A P T E R 6 VARIANTS OF THE SIMPLEX METHOD By a variant of the Simplex Method (in this chapter) we mean an algorithm consisting of a sequence of pivot steps in the primal system using alternative rules

More information

A Real Life Application of Linear Programming

A Real Life Application of Linear Programming Dagon University Research Journal 2012, Vol. 4 A Real Life Application of Linear Programming Win Win Myo * Abstract Linear programming is heavily used in microeconomics and company management, such as

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 16 Cutting Plane Algorithm We shall continue the discussion on integer programming,

More information

A Comparative study on Algorithms for Shortest-Route Problem and Some Extensions

A Comparative study on Algorithms for Shortest-Route Problem and Some Extensions International Journal of Basic & Applied Sciences IJBAS-IJENS Vol: No: 0 A Comparative study on Algorithms for Shortest-Route Problem and Some Extensions Sohana Jahan, Md. Sazib Hasan Abstract-- The shortest-route

More information

Ahigh school curriculum in Algebra 2 contains both solving systems of linear equations,

Ahigh school curriculum in Algebra 2 contains both solving systems of linear equations, The Simplex Method for Systems of Linear Inequalities Todd O. Moyer, Towson University Abstract: This article details the application of the Simplex Method for an Algebra 2 class. Students typically learn

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Combinatorial Optimization G. Guérard Department of Nouvelles Energies Ecole Supérieur d Ingénieurs Léonard de Vinci Lecture 1 GG A.I. 1/34 Outline 1 Motivation 2 Geometric resolution

More information

Notes for Lecture 20

Notes for Lecture 20 U.C. Berkeley CS170: Intro to CS Theory Handout N20 Professor Luca Trevisan November 13, 2001 Notes for Lecture 20 1 Duality As it turns out, the max-flow min-cut theorem is a special case of a more general

More information

CHAPTER 8 INFERENCE. The concept of Inference would be explained in the following chapter, as the CTBN

CHAPTER 8 INFERENCE. The concept of Inference would be explained in the following chapter, as the CTBN CHAPTER 8 INFERENCE The concept of Inference would be explained in the following chapter, as the CTBN framework has already been detailed on. The chapter begins by answering the most asked queries and

More information

Interior Point I. Lab 21. Introduction

Interior Point I. Lab 21. Introduction Lab 21 Interior Point I Lab Objective: For decades after its invention, the Simplex algorithm was the only competitive method for linear programming. The past 30 years, however, have seen the discovery

More information

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. Iterative Improvement Algorithm design technique for solving optimization problems Start with a feasible solution Repeat the following step until no improvement can be found: change the current feasible

More information

I.1 Introduction Matisse GUI designer I.2 GroupLayout Basics Sequential and Parallel Arrangements sequential horizontal orientation

I.1 Introduction Matisse GUI designer I.2 GroupLayout Basics Sequential and Parallel Arrangements sequential horizontal orientation I GroupLayout I.1 Introduction Java SE 6 includes a powerful layout manager called GroupLayout, which is the default layout manager in the NetBeans IDE (www.netbeans.org). In this appendix, we overview

More information

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014 5/2/24 Outline CS38 Introduction to Algorithms Lecture 5 May 2, 24 Linear programming simplex algorithm LP duality ellipsoid algorithm * slides from Kevin Wayne May 2, 24 CS38 Lecture 5 May 2, 24 CS38

More information

George B. Dantzig Mukund N. Thapa. Linear Programming. 1: Introduction. With 87 Illustrations. Springer

George B. Dantzig Mukund N. Thapa. Linear Programming. 1: Introduction. With 87 Illustrations. Springer George B. Dantzig Mukund N. Thapa Linear Programming 1: Introduction With 87 Illustrations Springer Contents FOREWORD PREFACE DEFINITION OF SYMBOLS xxi xxxiii xxxvii 1 THE LINEAR PROGRAMMING PROBLEM 1

More information

4 Integer Linear Programming (ILP)

4 Integer Linear Programming (ILP) TDA6/DIT37 DISCRETE OPTIMIZATION 17 PERIOD 3 WEEK III 4 Integer Linear Programg (ILP) 14 An integer linear program, ILP for short, has the same form as a linear program (LP). The only difference is that

More information

Design and Analysis of Algorithms (V)

Design and Analysis of Algorithms (V) Design and Analysis of Algorithms (V) An Introduction to Linear Programming Guoqiang Li School of Software, Shanghai Jiao Tong University Homework Assignment 2 is announced! (deadline Apr. 10) Linear Programming

More information

Research Interests Optimization:

Research Interests Optimization: Mitchell: Research interests 1 Research Interests Optimization: looking for the best solution from among a number of candidates. Prototypical optimization problem: min f(x) subject to g(x) 0 x X IR n Here,

More information

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage).

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage). Linear Programming Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory: Feasible Set, Vertices, Existence of Solutions. Equivalent formulations. Outline

More information

Graphical Methods in Linear Programming

Graphical Methods in Linear Programming Appendix 2 Graphical Methods in Linear Programming We can use graphical methods to solve linear optimization problems involving two variables. When there are two variables in the problem, we can refer

More information

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued. Linear Programming Widget Factory Example Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory:, Vertices, Existence of Solutions. Equivalent formulations.

More information

4.1 The original problem and the optimal tableau

4.1 The original problem and the optimal tableau Chapter 4 Sensitivity analysis The sensitivity analysis is performed after a given linear problem has been solved, with the aim of studying how changes to the problem affect the optimal solution In particular,

More information

Lecture 2 Optimization with equality constraints

Lecture 2 Optimization with equality constraints Lecture 2 Optimization with equality constraints Constrained optimization The idea of constrained optimisation is that the choice of one variable often affects the amount of another variable that can be

More information

Linear Optimization and Extensions: Theory and Algorithms

Linear Optimization and Extensions: Theory and Algorithms AT&T Linear Optimization and Extensions: Theory and Algorithms Shu-Cherng Fang North Carolina State University Sarai Puthenpura AT&T Bell Labs Prentice Hall, Englewood Cliffs, New Jersey 07632 Contents

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A 4 credit unit course Part of Theoretical Computer Science courses at the Laboratory of Mathematics There will be 4 hours

More information

MLR Institute of Technology

MLR Institute of Technology Course Name : Engineering Optimization Course Code : 56021 Class : III Year Branch : Aeronautical Engineering Year : 2014-15 Course Faculty : Mr Vamsi Krishna Chowduru, Assistant Professor Course Objective

More information

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation Optimization Methods: Introduction and Basic concepts 1 Module 1 Lecture Notes 2 Optimization Problem and Model Formulation Introduction In the previous lecture we studied the evolution of optimization

More information

Linear Programming. Meaning of Linear Programming. Basic Terminology

Linear Programming. Meaning of Linear Programming. Basic Terminology Linear Programming Linear Programming (LP) is a versatile technique for assigning a fixed amount of resources among competing factors, in such a way that some objective is optimized and other defined conditions

More information

JAVA CODE JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS PAGE 1

JAVA CODE JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS PAGE 1 CODE JAVA CODE BINOMIAL TREES OPTION PRICING JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS /** * * @author Ioannis Svigkos 2008 */ // This class corresponds to binomial tree option pricing.

More information

ACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms

ACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms 1. Computability, Complexity and Algorithms Given a simple directed graph G = (V, E), a cycle cover is a set of vertex-disjoint directed cycles that cover all vertices of the graph. 1. Show that there

More information

5. DUAL LP, SOLUTION INTERPRETATION, AND POST-OPTIMALITY

5. DUAL LP, SOLUTION INTERPRETATION, AND POST-OPTIMALITY 5. DUAL LP, SOLUTION INTERPRETATION, AND POST-OPTIMALITY 5.1 DUALITY Associated with every linear programming problem (the primal) is another linear programming problem called its dual. If the primal involves

More information

Unconstrained Optimization Principles of Unconstrained Optimization Search Methods

Unconstrained Optimization Principles of Unconstrained Optimization Search Methods 1 Nonlinear Programming Types of Nonlinear Programs (NLP) Convexity and Convex Programs NLP Solutions Unconstrained Optimization Principles of Unconstrained Optimization Search Methods Constrained Optimization

More information

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality 6.854 Advanced Algorithms Scribes: Jay Kumar Sundararajan Lecturer: David Karger Duality This lecture covers weak and strong duality, and also explains the rules for finding the dual of a linear program,

More information

LECTURES 3 and 4: Flows and Matchings

LECTURES 3 and 4: Flows and Matchings LECTURES 3 and 4: Flows and Matchings 1 Max Flow MAX FLOW (SP). Instance: Directed graph N = (V,A), two nodes s,t V, and capacities on the arcs c : A R +. A flow is a set of numbers on the arcs such that

More information

Lecture 15: Log Barrier Method

Lecture 15: Log Barrier Method 10-725/36-725: Convex Optimization Spring 2015 Lecturer: Ryan Tibshirani Lecture 15: Log Barrier Method Scribes: Pradeep Dasigi, Mohammad Gowayyed Note: LaTeX template courtesy of UC Berkeley EECS dept.

More information

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007 College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007 CS G399: Algorithmic Power Tools I Scribe: Eric Robinson Lecture Outline: Linear Programming: Vertex Definitions

More information

OPERATIONS RESEARCH. Linear Programming Problem

OPERATIONS RESEARCH. Linear Programming Problem OPERATIONS RESEARCH Chapter 1 Linear Programming Problem Prof. Bibhas C. Giri Department of Mathematics Jadavpur University Kolkata, India Email: bcgiri.jumath@gmail.com 1.0 Introduction Linear programming

More information

Principles of Optimization Techniques to Combinatorial Optimization Problems and Decomposition [1]

Principles of Optimization Techniques to Combinatorial Optimization Problems and Decomposition [1] International Journal of scientific research and management (IJSRM) Volume 3 Issue 4 Pages 2582-2588 2015 \ Website: www.ijsrm.in ISSN (e): 2321-3418 Principles of Optimization Techniques to Combinatorial

More information

UNIT 2 LINEAR PROGRAMMING PROBLEMS

UNIT 2 LINEAR PROGRAMMING PROBLEMS UNIT 2 LINEAR PROGRAMMING PROBLEMS Structure 2.1 Introduction Objectives 2.2 Linear Programming Problem (LPP) 2.3 Mathematical Formulation of LPP 2.4 Graphical Solution of Linear Programming Problems 2.5

More information

Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class)

Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class) CPS 590.1 - Linear and integer programming Homework 2: Multi-unit combinatorial auctions (due Nov. 7 before class) Please read the rules for assignments on the course web page. Contact Vince (conitzer@cs.duke.edu)

More information

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs Introduction to Mathematical Programming IE496 Final Review Dr. Ted Ralphs IE496 Final Review 1 Course Wrap-up: Chapter 2 In the introduction, we discussed the general framework of mathematical modeling

More information

You ve already read basics of simulation now I will be taking up method of simulation, that is Random Number Generation

You ve already read basics of simulation now I will be taking up method of simulation, that is Random Number Generation Unit 5 SIMULATION THEORY Lesson 39 Learning objective: To learn random number generation. Methods of simulation. Monte Carlo method of simulation You ve already read basics of simulation now I will be

More information

A PRIMAL-DUAL EXTERIOR POINT ALGORITHM FOR LINEAR PROGRAMMING PROBLEMS

A PRIMAL-DUAL EXTERIOR POINT ALGORITHM FOR LINEAR PROGRAMMING PROBLEMS Yugoslav Journal of Operations Research Vol 19 (2009), Number 1, 123-132 DOI:10.2298/YUJOR0901123S A PRIMAL-DUAL EXTERIOR POINT ALGORITHM FOR LINEAR PROGRAMMING PROBLEMS Nikolaos SAMARAS Angelo SIFELARAS

More information

H. W. Kuhn. Bryn Mawr College

H. W. Kuhn. Bryn Mawr College VARIANTS OF THE HUNGARIAN METHOD FOR ASSIGNMENT PROBLEMS' H. W. Kuhn Bryn Mawr College The author presents a geometrical modelwhich illuminates variants of the Hungarian method for the solution of the

More information

Math Introduction to Operations Research

Math Introduction to Operations Research Math 300 Introduction to Operations Research Examination (50 points total) Solutions. (6 pt total) Consider the following linear programming problem: Maximize subject to and x, x, x 3 0. 3x + x + 5x 3

More information

ON SOME METHODS OF CONSTRUCTION OF BLOCK DESIGNS

ON SOME METHODS OF CONSTRUCTION OF BLOCK DESIGNS ON SOME METHODS OF CONSTRUCTION OF BLOCK DESIGNS NURNABI MEHERUL ALAM M.Sc. (Agricultural Statistics), Roll No. I.A.S.R.I, Library Avenue, New Delhi- Chairperson: Dr. P.K. Batra Abstract: Block designs

More information

3 Interior Point Method

3 Interior Point Method 3 Interior Point Method Linear programming (LP) is one of the most useful mathematical techniques. Recent advances in computer technology and algorithms have improved computational speed by several orders

More information

FOUNDATIONS OF OPERATIONS RESEARCH

FOUNDATIONS OF OPERATIONS RESEARCH Master of Science in Computer Engineering FOUNDATIONS OF OPERATIONS RESEARCH Edoardo Amaldi DEI - Politecnico di Milano amaldi@elet.polimi.it Course website: http://home.dei.polimi.it/amaldi/for-10-11.html

More information

Key Stage 3 Curriculum

Key Stage 3 Curriculum Key Stage 3 Curriculum Learning Area: Maths Learning Area Coordinator: Ms S J Pankhurst What will I study? SUBJECT YEAR 7 Autumn 1 Autumn 2 Spring 1 Spring 2 Summer 1 Summer 2 Focus Counting and comparing

More information

II. Linear Programming

II. Linear Programming II. Linear Programming A Quick Example Suppose we own and manage a small manufacturing facility that produced television sets. - What would be our organization s immediate goal? - On what would our relative

More information

Math 414 Lecture 30. The greedy algorithm provides the initial transportation matrix.

Math 414 Lecture 30. The greedy algorithm provides the initial transportation matrix. Math Lecture The greedy algorithm provides the initial transportation matrix. matrix P P Demand W ª «2 ª2 «W ª «W ª «ª «ª «Supply The circled x ij s are the initial basic variables. Erase all other values

More information

AM 121: Intro to Optimization Models and Methods Fall 2017

AM 121: Intro to Optimization Models and Methods Fall 2017 AM 121: Intro to Optimization Models and Methods Fall 2017 Lecture 10: Dual Simplex Yiling Chen SEAS Lesson Plan Interpret primal simplex in terms of pivots on the corresponding dual tableau Dictionaries

More information

LINEAR PROGRAMMING INTRODUCTION 12.1 LINEAR PROGRAMMING. Three Classical Linear Programming Problems (L.P.P.)

LINEAR PROGRAMMING INTRODUCTION 12.1 LINEAR PROGRAMMING. Three Classical Linear Programming Problems (L.P.P.) LINEAR PROGRAMMING 12 INTRODUCTION ou are familiar with linear equations and linear inequations in one and two variables. They can be solved algebraically or graphically (by drawing a line diagram in case

More information

Graphs that have the feasible bases of a given linear

Graphs that have the feasible bases of a given linear Algorithmic Operations Research Vol.1 (2006) 46 51 Simplex Adjacency Graphs in Linear Optimization Gerard Sierksma and Gert A. Tijssen University of Groningen, Faculty of Economics, P.O. Box 800, 9700

More information

Lecture 5: Matrices. Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur

Lecture 5: Matrices. Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur Lecture 5: Matrices Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur 29 th July, 2008 Types of Matrices Matrix Addition and Multiplication

More information

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Lecture 9: Linear Programming

Lecture 9: Linear Programming Lecture 9: Linear Programming A common optimization problem involves finding the maximum of a linear function of N variables N Z = a i x i i= 1 (the objective function ) where the x i are all non-negative

More information

Lecture 7: Bipartite Matching

Lecture 7: Bipartite Matching Lecture 7: Bipartite Matching Bipartite matching Non-bipartite matching What is a Bipartite Matching? Let G=(N,A) be an unrestricted bipartite graph. A subset X of A is said to be a matching if no two

More information

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP 1 Primal Dual Schema Approach to the Labeling Problem with Applications to TSP Colin Brown, Simon Fraser University Instructor: Ramesh Krishnamurti The Metric Labeling Problem has many applications, especially

More information

Optimization of Design. Lecturer:Dung-An Wang Lecture 8

Optimization of Design. Lecturer:Dung-An Wang Lecture 8 Optimization of Design Lecturer:Dung-An Wang Lecture 8 Lecture outline Reading: Ch8 of text Today s lecture 2 8.1 LINEAR FUNCTIONS Cost Function Constraints 3 8.2 The standard LP problem Only equality

More information

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748 COT 6936: Topics in Algorithms! Giri Narasimhan ECS 254A / EC 2443; Phone: x3748 giri@cs.fiu.edu http://www.cs.fiu.edu/~giri/teach/cot6936_s12.html https://moodle.cis.fiu.edu/v2.1/course/view.php?id=174

More information