Nonlinear, Quadratic, Linear Programming, Convexity, LP Optimization, and Simplex Method in Computer Algorithm course outline at University of Massachusetts. Learn about Integer Programming, Network Flow Problems, and more.
01 / 57Mathematical Programming: Nonlinear, Quadratic, Linear, and Geometric Solutions
1 / 17
Télécharger la présentation
Mathematical Programming: Nonlinear, Quadratic, Linear, and Geometric Solutions
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Mathematical Programming Nonlinear Programming Minimize f(x) subject to: g(x) = 0 h(x) ≥ 0 where x = [x1,...xn]T, and all functions f, g, h, are differentiable. {
Convexity To obtain global optimum, it is important that the constraint set {x | g(x) = 0,h(x) ≥ 0} and the function f(x) be convex. If the functionis convex over a convex constraint set, then local minimun is also a globa1 minimum
Set convexity Convex set non-convex set Function convexity Convex function non-convex function
Classical optimization deals with unconstrained optimization problems. • Solution: move the constraints to the function and solve the unconstrained optimization problem • For the minimization problem • Min f(x) subject to g(x) = 0 • Penalty function method: replace f(x) by • F(x) = f(x)+ M( g(x))2, M >> 0 • 2. Lagrangian multipliers: replace f(x) by • L(x,λ) = f(x) + Σ λi gi(x) • At the optimum point, x*, L(x*, λ) = f(x*) i
Quadratic Programming (QP) Minimize xTQx Subject to: {Ax ≥ b Where Q is an n x n symmetric matrix, A is a constraint matrix, and b is a constraint vector Matrix Q is positive definite, i.e., xTQx > 0 For every x 0. Thus f is convex.
Linear Programming (LP) Minimize cT Subject to Ax ≥ b x ≥ 0 Where cT is a coefficient vector for f, A is a constraint matrix, and b es a constraint vector. The constraint set {x | Ax ≥ b} Is a convex polyhedron, and f is linear, convex. {
Linear Programming (LP)Optimization problem:• 2 types of products are made by the factory• 3 machines are needed to make each productConstraints: Machines are available for a limited time during one production session:• time on A ≤50 hours • time on B ≤35 hours • time on C ≤ 80 hours
Profit • Product 1 can be sold for $100 per lot • • Product 2 can be sold for $80 per lot • Optimization Problem: • Design the production schedule which rnaximizes the profit of both products manufactured during one production session.
Formulation x1 = number of lots of product 1 x2 = number of lots of product 2 max f (x) = 100x1 + 80x2 10x1 + 5x2≤ 50 5x1 + 5x2≤35 5x1 + 15x2≤ 80 {
Basic Solution Given a system of equalities Ax=b where x = n - vector, b = m - vector, A = mxn matrix, select a set of m linearly independent columns such that (mxm) matrix B is nonsingular, i.e. /B / 0. Then one may uniquely solve the equation Bxb= b where Xbis an m - element subvector of x.
By putting x=(xb,0) we obtain a solution to Ax = b Such a solution (with n - m components of xnot associated with columns of B m x m ) to theresulting set of equations is said to be a basic solution with regard to the basis B. The Xbvariables, associated with columns of B, are called basic variables. Basic Feasible Solution If a feasible solution (i.e. the one which satisfies all contraints) is also basic, it is called a basic feasible solution.
Fundamental Theorem of Linear Programming Given an L.P. in standard form min cTx Ax = b x 0 where A is m x n matrix of rank m (i.e. m < n and the m rows are linear independent), s. to • If there is a feasible solution, there is a basic feasible solution • If there is an optimal feasible solution, there is an optimal basic feasible solution
This theorem shows that it is necessary only to consider basic feasible solutions when seeking an optimal solution to a linear program, as the optimal value is always achieved as such a solution Ultimate goal: find a basic feasible solution with a base B composed of original variables only, and which is optimum.
Simplex Method Proceed from one basic feasible solution (extreme point) to another, in such a way as to continually decrease the value of the f (x) until a minimum is reached. General comments It is easy to find initial basic feasible solutions with slack variables. Finding initial basic solution is part of the Simplex method (Lue 84).
Simplex Algorithm • Select the column, such that the new resulting basic feasible solution will yield a lower valueto f(x) than the previous one. • Select the pivot element in that column. By an elementary evaluation determine • Which vector ajshould enter the basis (so that f(x) is reduced), and • Which vector should leave the basis.
Step 1. Select column q with rq > 0. (xqenters the basis) q : rq = max ri Step 2. Select pivot element p in column q Which minimizes ratio: p : = min for positive yiq yi0 yp0 yi0 yiq ypq yiq i
yi q yp q • ypj , j = 0, 1,…, n Step 3. Pivot on element ypq and update the tableau (update all rows, including the top one) • In row p divide ypjby ypq, j = 0, 1,…, n • Subtract from each row i p
Pivot on y1 1 Point P0 (0,0) F(0,0,50,35,80) = 0 Update the table Point P1 (5,0) F(5,0,0,10,55) = 500
Pivot on y2 2 Point P1 (5,0) F(5,0,0,10,55) = 500 Update the table Point P1 (3,4) F(3,4,0,0,5) = 620
LP Modifications 1. Maximization max c t x = min (-c t x) 2. Unconstrained x let x = x+ - x -; x+, x - 0) min (c t x+ - c t x -) x+ x - [A, -A] = b s. to x+, x - 0
x xs min [cT , 0] x xs 3. Constraint set:Ax b Slack variables,xs : Ax + xs = b [A, I ] = b x , xs 0 Columns corresponding to xsform a basic solution
x xp min [cT , 0] x xp 4. Constraint set:Ax b Surplus variables,xp : Ax - xp = b [A, -I ] = b x , xp 0
x xp xa x xp xa Artificial variables,xa: Ax - xp + xa = b (cannot star with negative basis ofxp ) min [cT , 0 , k I ] [A, -I , I ] = b S. to x , xp ,xa 0 Columns corresponding to xaform a basic solution
Integer Programming Integer Program max cTx Ax b xiinteger Typically, xi = 0,1 (0,1 Integer Programming) s. to
2 e1 e2 1 3 e3 IP Example: matching problem Given a graph G , find maximal set of edges in G, such that no two edges are adjacent to the same vertex. • Maximum matching: matching of maximum cardinality. • Weighted matching: matching with
In matrix form: Where b = [ 1,…1]T , A = incidence matrix of G 1 2 3
max 1x1 + 1x2 + 1x3 x1 , x2 , x3 = 0, 1 One solution to this IP problem: x1= 1 , x2= 0 , x3= 0 Other possible solutions: x1= 0 , x2= 1 , x3= 0, or x1= 0 , x2= 0 , x3= 1
Question Can the solution to this IP problem be obtained by dropping the integrality constraint: xi = 0, 1 And solving the LP problem instead? In our example, solution to the IP is not obtainable from LP. Reason:matrix A does not have certain property (total unimodularity) needed to guarantee integer solutions.
Unimodularity: LP -> IP Given a constraint set in standard form where A, b are integer Partition A = [B/N ]; x = [xB, xN ] B is nonsingular m x m basis, N is non-basic
Basic solution is In particular, when B = I and B -1 = I then XB= b a solution can be obtained by inspection (as in the initial step of Simplex method).
Unimodularity A square matrix B is called unimodular if D = |det B| = 1 An integer matrix A is totally unimodular if every square, nonsingular submatrix of A is unimodular. Equivalently: A is totally unimodular if every subdeterminant of A is 0, +1, or –1.
Recall that for B nonsingular: Where B + , adjoint matrix = [ i j cofactor of element a i jin det A ]T B +and det B are integer if B –1 is integer
For B unimodular, B –1integer: If A is totally unimodular, every basis matrix B is unimodular and every basic solution ( xB , yN) = ( B –1 b, 0 ) Is integer. In particular, the optimal solution is integer
Theorem 1: If A is totally unimodular then every basic solution of Ax = b is integer. For LP’s with equality constraints total unimodularity is sufficient but not necessary. For LP with inequality constraints, Ax b, total unimodularity of A is both necessary and sufficient for all extreme points of s = {x : Ax b , x 0 } to be integer for every integer vector b.
Conclusion: Any IP with totally unimodular constraint matrix can be solved as an LP. Totally unimodular matrix : a i j = 0 , +1, -1 Also, every determinant of A must be 0, +1 or -1
Special Linear Programs with Integer Solutions Network flow problems: • max flow • min – cost flow • assignment problem • shortest path • transportation problem are LP with the property that they possess optimal solutions in integers.
Some Totally Unimodular Linear Programs Assignment problem (special case of min – cost capacitated flow problems) [ m jobs x m men ] c i j =cost of assigning man i to job j