Meljun Cortes Algorithm Iterative Improvement

download Meljun Cortes Algorithm Iterative Improvement

of 10

Transcript of Meljun Cortes Algorithm Iterative Improvement

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    1/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 1 of 23

    The following are the topics to be discussed under

    Iterative Improvement:

    Definition of iterative improvement algorithm

    design technique

    Advantages of iterative improvement algorithm

    design technique.

    Application of simplex method.

    Application of Geometric Interpretation of linear

    programming 

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    2/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 2 of 23

    a type of algorithm design technique for solving

    optimization problems

    starts with initial state, and changes it iteratively

    for improvement to find the best or the least value

    Advantages:

    Use very little memory (usually constant amount),because it only stores the current state

    Often finds reasonable solutions in large or infinite

    (continuous) state

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    3/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 3 of 23

    identified as important in the 1950’s, and a

    general solution called the simplex method was

    developed

    actually name of a branch of applied mathematics

    that deals with solving optimization problems of a

    particular form

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    4/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 4 of 23

    The generic interpretation of Linear Programming

    It must be a maximization problem.

    All constraints (except the non-negativityconstraints) must be in the form of liner

    equations.

    All the variables must be required to be non-

    negative.

    Thus, the general linear programming problem in

    standard form with m constraints and n unknowns

    (n ≥ m) is:

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    5/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 5 of 23

    a classic method used for solving linear

    programming problems

    considered as the one of the most importantalgorithms ever developed

    developed by a U.S. mathematician named George

    B. Danzig in 1947

    generates a sequence of adjacent points of the

    problem’s feasible region with improving values of

    the objective function until no further

    improvement is possible

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    6/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 6 of 23

    Every linear programming problem can be

    represented in the following:

    The possible solution to be given problem is any

    point x, y) that satisfies all the constraints of the

    problem’s possible region is the set of all its

    feasible points.

    Maximize: 3x + 5y

    Subject to: x + y ≤ 4

    x + 3y ≤ 6

    x≥0, y≥0

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    7/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 7 of 23

    It is instructive to visualize on:

    A line divides the plane into two half-planes,

    whereas for all the points have ax + by < c and on

    the other, ax + by > c.

    Therefore, the set of points defined by inequality x

    + y ≤ 4 encompasses the points on and below the

    line x + 3y = 6.

    ax + by = c

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    8/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 8 of 23

    The points of the feasible region must satisfy all

    the constraints of the problem.

    The feasible region attained by the intersection of

    these two half-planes and the first quadrant of the

    Cartesian plane defined by non-negative

    constraints x ≥ 0, y ≥ 0.

    The feasible region for the problem is the convex

    polygon with the vertices (0,0), (4,0), (0,2) and

    (3,1).

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    9/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 9 of 23

    The last point, which is the point of intersection of

    the lines x + y = 4 and x + 3y = 6 is achieved by

    solving the system of the two linear equations.

    To find the optimal solution, a point in the feasible

    region with the largest value of the objective

    function: z = 3x = 5y.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    10/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 10 of 23

    Are there feasible solutions for which the value of

    the objective function equals, say, 20?

    The points (x,y) for which the objective function, x= 3x + 5y, is equal to 20 form the line, 3x + 5y =

    20.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    11/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 11 of 23

    There are infinitely many feasible points for which

    the objective function is equal to, say, 10.

    These are the intersection points of the line 3x +

    5y = 20 and 3x + 5y = 10 with the feasible region.

    To apply the simplex method to a linear

    programming problem, it has to be represented in

    a special form called the standard form.

    The standard form has the following requirements:

    It must have a

    maximum

    problem.

    All the constraints

    except the non-

    negativity

    constraints) must

    be in the form of

    linear equations

    .

    All the variables

    must be required

    to be non-

    negative

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    12/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 12 of 23

    The general linear programming problem in

    standard form with m, constraints and n

    unknowns (n≥m) is:

    Any linear programming problem can be

    transformed into an equivalent problem in

    standard form.

    If an objective function needs to be minimized, it

    can be replaced by the equivalent problem of

    maximizing the same objective function with all its

    coefficients cj replaced by –cj, j = 12….n.

    Maximize: c1x1 + ….+cnxn

    Subject to:

    ai1x1 + …. + ainxn = bi for i=1,2,….m

    x1≥0, ……xn≥0.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    13/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 13 of 23

    Example: Two inequalities of the given problem

    can be transformed, respectively, into the

    following equations:

    If this is not the case in an initial statement of a

    problem, an unconstrained variables x j can be

    replaced by the difference between two new

    nonnegative variables.

    Thus, the given problem in standard form is the

    following linear programming problem in fourvariables:

    x + y + u = 4 where u ≥ 0and 

    x + 3y + v = 6 where v ≥ 0

    x j = x’ j – x’’j, x’ j ≥0,x’’ j≥0.

    Maximize: 3x + 5y + 0u + 0v

    Subject to: x + y + u = 4

    x + 3y + v = 6

    x, y, u, v ≥ 0

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    14/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 14 of 23

    It is easy to see that if we find an optimal

    solution (x*, y*, u*, v*) to a given problem, it

    can be obtain by simply ignoring its last two

    coordinates.

    Specifically, we can rewrite the system of

    constraint equations of the problem:

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    15/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 15 of 23

    If all the coordinates of a basic solution are

    nonnegative, the basic solution is called a basic

    feasible solution.

    Example: If we set variables x and y to zero and

    solve the resulting system u and v, we obtain thebasic feasible solution (0, 0, 4, 6); otherwise, we

    obtain the basic solution (0, 4, 0, -6), which is not

    feasible.

    Each such point can be represented by a simplex

    tableau, a table storing the information about thebasic feasible solution corresponding to the

    extreme point.

    Example: The simplex tableau for (0,0,4,6) is:

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    16/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 16 of 23

    A simplex tableau for a linear programming

    problem in standard form with n unknown and m

    linear equality constraints ( n ≥ m) has m + 1 rows

    and n + 1 columns.

    Each of the first m rows of the table contains the

    coefficients of a corresponding constraint

    equation with the last column’s entry containing

    the equations right-hand side.

    The columns, except the last one, are labeled bythe name variables.

    The rows in the last column are labeled by the

    basic variables of this solution.

    The columns labeled by the basic variables form n-by-m identity matrix.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    17/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 17 of 23

    Th e Sim p lex M eth o d 

    c  The last row of a simplex tableau is calledobjective row , which is initialized by thecoefficients of the objective function with theirsigns reversed and the value of the objectivefunction at the initial point.

    c  The figure below is the outline of the Simplexmethod:

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    18/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 18 of 23

    the problem of finding a feasible flow in an  s-t

    network with the largest possible flow value for a

    given weight function [www.answers.com]

    a structured on a network but here the arc

    capacities, or upper bounds, are the only relevant

    parameters; the problem is to find the maximum

    flow possible from some given source node to a

    given sink node [www.me.utexas.edu]

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    19/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 19 of 23

    Example 1:

    The illustration shows that all arc costs are zero,

    but the cost on the arc leaving the sink is set to -1.

    Since the goal of the optimization is to minimizecost, the maximum flow possible is delivered to

    the sink node.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    20/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 20 of 23

    Solution:

    The figure shows that the maximum flow from

    node 1 to node 8 is 30.

    The heavy arcs on the figure are called minimal

    cut.

    The sum of the capacities of the arcs on the

    minimal cut equals the maximum flow is a famous

    theorem of network theory called the max flow min

    cut theorem.

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    21/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 21 of 23

    Example 2:

    We will assume that the transportation network

    can be represented by a connected weighted

    digraph with a scenario where an oil company has

    the following pipeline network.

    Each pipeline is labeled with its maximum flow

    rate (in thousands of gallons per hour).

    Question: What is the maximum possible flow rate

    from A to G?

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    22/23

    Iterative Improvement Algorithm Design Technique

    Design and Analysis of Algorithms

    * Property of STI 

    Page 22 of 23

    Assumptions of Maximum Flow Problem:

  • 8/21/2019 Meljun Cortes Algorithm Iterative Improvement

    23/23

    It ti I t Al ith D i T h i

    Design and Analysis of Algorithms

    * P t f STI

    Some Applications of Maximum Flow Problem:

    1. Maximize the flow through a distribution

    network.2. Maximize the flow through a company’s

    supply network from its vendors to its

    processing facilities.

    3. Maximize the flow of oil through a system of

    pipelines.

    4. Maximize the flow of water through a systemof aqueducts.

    5. Maximize the flow of vehicles through a

    transportation network.