Previous Page Next Page Contents

linopt::Transparent::dual_prices -- get the dual solution belonging to the given tableau

Introduction

linopt::Transparent::dual_prices(tableau) returns the dual solution of the linear optimization problem given by tableau.

Call(s)

linopt::Transparent::dual_prices(tableau)

Parameters

tableau - a simplex tableau of domain type linopt::Transparent

Returns

a set of lists, each containing 2 elements.

Related Functions

linopt::Transparent, linopt::Transparent::result

Details

Example 1

Here it is demonstrated that the dual solution of the final tableau is similar to the second element of the result of linopt::minimize using the option DualPrices:

First we compute the final tableau of the simplex algorithm:

>> k := [[x<=2, y<=2, x+2*y>=4], -x+y, NonNegative]:
   t := linopt::Transparent(k):
   t := linopt::Transparent::simplex(t)

test

           +-                                                 -+
           |  "linopt", "restr", slk[1], slk[2], slk[3], x, y  |
           |                                                   |
           |    "obj",     1,      3/2,     0,     1/2,  0, 0  |
           |                                                   |
           |      x,       2,       1,      0,      0,   1, 0  |
           |                                                   |
           |   slk[2],     1,      1/2,     1,     1/2,  0, 0  |
           |                                                   |
           |      y,       1,     -1/2,     0,    -1/2,  0, 1  |
           +-                                                 -+

Now we compute the solutions:

>> linopt::Transparent::dual_prices(t);
   linopt::minimize(k, DualPrices)[2]
      {[0 <= x, 0], [0 <= y, 0], [y <= 2, 0], [x <= 2, 3/2],
      
         [4 <= x + 2 y, 1/2]}
      
      {[0 <= x, 0], [0 <= y, 0], [y <= 2, 0], [x <= 2, 3/2],
      
         [4 <= x + 2 y, 1/2]}
>> delete k, t:
     

Example 2

We compute the dual solution of another linear program:

>> k := [[x <= 2, y <= 2, x + 2*y >= 4], -x + y, NonNegative]:
   t := linopt::Transparent(k);
   linopt::Transparent::dual_prices(t)
          +-                                                   -+
          |  "linopt", "restr", slk[1], slk[2], slk[3],  x,  y  |
          |                                                     |
          |    "obj",     0,       0,      0,      0,   -1,  1  |
          |                                                     |
          |   slk[1],     2,       1,      0,      0,    1,  0  |
          |                                                     |
          |   slk[2],     2,       0,      1,      0,    0,  1  |
          |                                                     |
          |   slk[3],     -4,      0,      0,      1,   -1, -2  |
          +-                                                   -+
      
      {[0 <= x, -1], [0 <= y, 1], [x <= 2, 0], [y <= 2, 0],
      
         [4 <= x + 2 y, 0]}
>> delete k, t:
     

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000