`
leonzhx
  • 浏览: 793397 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
阅读更多

1.  Linear programming:

    --  Problem-solving model for optimal allocation of scarce resources, among a number of competing activities.

    --  Fast commercial solvers available.

    --  Widely applicable problem-solving model.

    --  Key subroutine for integer programming solvers.

 

2.  brewer’s problem: choose product mix to maximize profits.


    --  formulation:

        --  Let A be the number of barrels of ale.

        --  Let B be the number of barrels of beer.

        --  maximize 13A + 23B subject to the constraints :

            -  5A + 15B ≤ 480

            -  4A + 4B ≤ 160

            -  35A + 20B ≤ 1190

            -  A , B ≥ 0

     --  feasible region:


    --  Optimal solution occurs at an extreme point.(intersection of 2 constraints in 2d)



3.  Standard form linear program:

    --  Maximize linear objective function of n nonnegative variables, subject to m linear equations. (linear means no x^2, xy, arccos(x), etc.)

    --  Input: real numbers aij, cj, bi.

    --  Output: real numbers xj.



4.  Converting the brewer’s problem to the standard form:

    --  Original formulation:

        maximize 13A + 23B subject to the constraints:

        -  5A + 15B ≤ 480

        -  4A + 4B ≤ 160

        -  35A + 20B ≤ 1190

        -  A , B ≥ 0

    --  Transformation:

        -  Add variable Z and equation corresponding to objective function.

        -  Add slack variable to convert each inequality to an equality.

        -  Now a 6-dimensional problem:



5.  Geometry of Linear Programming:

    --  Inequalities define halfspaces; feasible region is a convex polyhedron.

    --  A set is convex if for any two points a and b in the set, so is ½ (a + b).

    --  An extreme point of a set is a point in the set that can't be written as ½ (a + b), where a and b are two distinct points in the set.

    --  Extreme point optimal iff no better adjacent extreme point. ( local optima are global optima because objective function is linear and feasible region is convex)

 

6.  Simplex algorithm

    -- Generic algorithm:

        --  Start at some extreme point.

        --  Pivot from one extreme point to an adjacent one. (never decreasing objective function)

        --  Repeat until optimal.

    -- BFS:

        --  A basis is a subset of m of the n variables.

        --  Basic feasible solution (BFS):

            --  Set n – m nonbasic variables to 0, solve for remaining m variables.

            --  Solve m equations in m unknowns.

            --  If unique and feasible ⇒ BFS.

            --  BFS ⇔ extreme point.

    --  initialization:

        --  Start with slack variables { SC , SH , SM } as the basis.

        --  Set non-basic variables A and B to 0.

        --  3 equations in 3 unknowns yields SC = 480, SH = 160, SM = 1190.

    --  Pivot

        --  use the variable whose coefficient in objective function is positive to replace some one in the basis. (each unit increase in that variable from 0 increases objective value due to positive coefficient)

        --  which variable to replace: Preserves feasibility by ensuring RHS ≥ 0. Minimum ratio rule: min { 480/15, 160/4, 1190/20 }.

        --  when to stop: When no objective function coefficient is positive.

        --  pivot 1: substitute B = (1/15) (480 – 5A – SC) and add B into the basis (rewrite 2nd equation, eliminate B in 1st, 3rd, and 4th equations)

 

        --  pivot 2: substitute A = (3/8) (32 + (4/15) SC – SH ) and add A into the basis (rewrite 3rd equation, eliminate A in 1st, 2nd, and 4th equations)


     --  Why optimal: Z = 800 – SC – 2 SH, optimal objective value Z* ≤ 800 since SC , SH ≥ 0. Thus, current BFS has value 800 ⇒ optimal.

 

7.  Java Implementation of Simplex:

    --  Encode standard form LP in a single 2D array.

    --  Simplex algorithm transforms initial 2D array into solution:


    --  Implementation:

public class Simplex
{
    private double[][] a; // simplex tableaux
    private int m, n; // M constraints, N variables

    public Simplex(double[][] A, double[] b, double[] c)
    {
        m = b.length;
        n = c.length;
        a = new double[m+1][m+n+1];
        for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = A[i][j];
        for (int j = n; j < m + n; j++) a[j-n][j] = 1.0;
        for (int j = 0; j < n; j++) a[m][j] = c[j];
        for (int i = 0; i < m; i++) a[i][m+n] = b[i];
    }

    //Find entering column q using Bland's rule: index of first column whose objective function coefficient is positive.
    private int bland()
    {
        for (int q = 0; q < m + n; q++)
            if (a[M][q] > 0) return q;
                return -1;
    }

    //Find leaving row p using min ratio rule.
    private int minRatioRule(int q)
    {
        int p = -1;//leaving row
        for (int i = 0; i < m; i++)
        {
            if (a[i][q] <= 0) continue; //consider only positive entries
            else if (p == -1) p = i;
            else if (a[i][m+n] / a[i][q] < a[p][m+n] / a[p][q])
                p = i;
        }
        return p;
    }

    public void pivot(int p, int q)
    {
        for (int i = 0; i <= m; i++)
            for (int j = 0; j <= m+n; j++)
                if (i != p && j != q)
                    a[i][j] -= a[p][j] * a[i][q] / a[p][q];

        for (int i = 0; i <= m; i++)
            if (i != p) a[i][q] = 0.0;
        for (int j = 0; j <= m+n; j++)
            if (j != q) a[p][j] /= a[p][q];
        a[p][q] = 1.0;
    }

    public void solve()
    {
        while (true)
        {
            int q = bland();
            if (q == -1) break;//entering column q (optimal if -1)
            int p = minRatioRule(q);//leaving row p (unbounded if -1)
            if (p == -1) ...
            pivot(p, q);
        }
}  

    --  Performance: In typical practical applications, simplex algorithm terminates after at most 2 (m + n) pivots.

    --  Pivoting rules: Carefully balance the cost of finding an entering variable with the number of pivots needed.

        -  No pivot rule is known that is guaranteed to be polynomial.

        -  Most pivot rules are known to be exponential (or worse) in worst-case.

 

8.  Reduction to standard form:

    --  Minimization problem. Replace min 13A + 15B with max – 13A – 15B.

    --  ≥ constraints. Replace 4A + 4B ≥ 160 with 4A + 4B – SH = 160, SH ≥ 0.

    --  Unrestricted variables. Replace B with B = B0 – B1, B0 ≥ 0 , B1 ≥ 0.

 

9.  Modeling of LP:

    --  1. Identify variables.

    --  2. Define constraints (inequalities and equations).

    --  3. Define objective function.

    --  4. Convert to standard form.

 

10.  Maxflow problem reduces to LP:

    --  Variables. xvw = flow on edge v→w.

    --  Constraints. Capacity and flow conservation.

    --  Objective function. Net flow into t.



11.  bipartite matching reduces to LP:

    --  LP formulation. One variable per pair.

    --  Interpretation. xij = 1 if person i assigned to job j.



  

  • 大小: 108 KB
  • 大小: 25.9 KB
  • 大小: 26.9 KB
  • 大小: 22 KB
  • 大小: 14.6 KB
  • 大小: 28.9 KB
  • 大小: 22.7 KB
  • 大小: 26 KB
  • 大小: 24 KB
  • 大小: 31.5 KB
  • 大小: 33.6 KB
  • 大小: 50 KB
  • 大小: 52.7 KB
  • 大小: 30.9 KB
分享到:
评论

相关推荐

    Linear Programming.pdf

    线性规划(Linear Programming)是运筹学领域中一种重要的优化技术,被广泛应用于工业、商业、经济等各个领域,以解决资源分配、生产计划、投资决策等问题。由罗伯特·范德贝(Robert J. Vanderbei)编著的《线性...

    linear programming with matlab

    根据提供的文件信息,本书《Linear Programming with MATLAB》是由Michael C. Ferris、Olvi L. Mangasarian和Stephen J. Wright三位作者共同编写的。本书作为一本关于线性规划(Linear Programming, LP)与MATLAB...

    Decoding by linear programming

    ### Decoding by Linear Programming:关键技术点与理论基础 #### 摘要 本文探讨了一种自然的纠错问题,其中输入/输出为实数值。我们旨在从受污染的测量值中恢复原始输入向量。该文证明了,在合适的编码矩阵条件下...

    MIT Linear Programming Courseware- example

    **线性规划**(Linear Programming, LP)是一种用于寻找一组变量的最大值或最小值的方法,这些变量满足一系列线性的等式或不等式约束条件。它在运筹学、管理科学、经济学等多个领域有广泛的应用。 #### 二、MIT线性...

    Linear Programming Using MATLAB epub

    Linear Programming Using MATLAB 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Understanding and Using Linear Programming - Matousek, Gartner

    本书"Understanding and Using Linear Programming"由Jiˇrí Matoušek和Bernd Gärtner合著,旨在为这两个领域的学生提供一个入门级别的教程,让他们了解并掌握线性规划的基本思想和应用。 线性规划(Linear ...

    Linear Programming.Foundations and Extensions.4Ed.pdf

    Vanderbei的《Linear Programming: Foundations and Extensions Fourth Edition》(线性规划:基础与扩展第四版)是一本详细阐述线性规划理论与应用的经典教材。 在“Linear Programming: Foundations and ...

    linear programming and network flows(wiley, 1977).bazaraa

    This book: * Provides methods for modeling complex problems...* Explores linear programming (LP) and network flows, employing polynomial-time algorithms and various specializations of the simplex method.

    REMINISCENCES ABOUT THE ORIGINS OF LINEAR PROGRAMMING.pdf

    Dantzig)撰写的文章《关于线性规划起源的回忆》(REMINISCENCES ABOUT THE ORIGINS OF LINEAR PROGRAMMING),该文最初发表在1982年4月的《运筹学通讯》(OPERATIONS RESEARCH LETTERS)第一卷第二期上。...

    linear programming: a concise introduction

    线性规划:一种优化决策的方法 线性规划是一种在数学领域内被广泛应用的优化技术,主要目的是在一组线性约束条件下最大化或最小化一个线性目标函数。它在经济、工程、管理科学以及运筹学等多个领域都有重要的应用。...

    A Linear Programming Approach

    线性规划(Linear Programming, LP)是一种数学优化方法,它旨在找到一组决策变量的值,以最大化或最小化一个线性目标函数,同时满足一系列线性的不等式或等式约束。在标题提及的“线性规划方法的最新运用程序和方面...

    conic linear programming-yinyu ye.zip

    锥线性规划(Conic Linear Programming,简称CLP)是一种扩展了传统线性规划的数学优化方法,由叶荫宇教授在斯坦福大学的课程中深入讲解。在CLP中,决策变量不再局限于实数域,而是可以属于各种锥形集合,如对数凸锥...

    Linear Programming Foundations and Extensions(3rd).pdf

    ### Linear Programming: Foundations and Extensions(第三版) #### 知识点概述 《Linear Programming: Foundations and Extensions》(线性规划:基础与扩展)是线性规划领域内的一本经典著作,由作者在其第二...

    lipsolWIN32.zip_Linear programming

    标题“lipsolWIN32.zip_Linear programming”提示我们这是一个针对Windows 32位系统的线性规划求解器软件包,可能包含了用于解决线性优化问题的工具或算法。 线性规划(Linear Programming, LP)是研究如何在满足一...

    A linear programming approach to the cutting stock problem

    A linear programming approach to the cutting stock problem

    On Stochastic Linear Programming

    随机线性规划(Stochastic Linear Programming, SLP)是一种解决在不确定环境下线性优化问题的方法。它结合了传统线性规划与概率论,旨在处理那些具有随机性质的数据或参数。本文基于一篇发表于1965年的数学论文《On...

    linear programming.zip

    这个`linear programming.zip`压缩包很可能包含了MATLAB代码示例,帮助用户理解和应用线性规划。 首先,线性规划的基本形式包括一个目标函数和一组不等式或等式约束,通常表示为: 目标函数:maximize (或 ...

Global site tag (gtag.js) - Google Analytics