next | previous | forward | backward | up | top | index | toc | home

fourierMotzkin -- interchange inequality/generator representation of a polyhedral cone

Synopsis

Description

The input pair (A,B) describes a rational polyhedral cone generated by nonnegative linear combinations of the column vectors of A and containing the linear space generated by the column vectors of B. Dually, the pair (A,B) describes a rational polyhedral cone as the intersection of closed halfspaces; the set of vectors x satisfying (transpose A) * x <= 0 and (transpose B) * x == 0. If the convex cone spans its ambient affine space, then the input B may be omitted.

The output pair (A',B') is the dual description of the same cone. In particular, the output pair (A',B') is valid input. If the convex cone spans its ambient affine space, then the output B' will be zero.

For example, consider the convex cone generated by the 26 columns of the following matrix. Using Fourier-Motzkin elimination, we see that this cone is the intersection of 6 halfspaces and spans 3-space.

i1 : rays = transpose matrix(QQ, {{1,1,6},{1,2,4},{1,2,5},
                    {1,2,6},{1,3,4},{1,3,5},{1,3,6},{1,4,4},{1,4,5},
                    {1,4,6},{1,5,4},{1,5,5},{1,5,6},{1,5,7},{1,6,3},
                    {1,6,4},{1,6,5},{1,6,6},{1,6,7},{1,7,4},{1,7,5},
                    {1,7,6},{1,7,8},{1,8,4},{1,8,5},{1,8,6}})

o1 = | 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 2 2 2 3 3 3 4 4 4 5 5 5 5 6 6 6 6 6 7 7 7 7 8 8 8 |
     | 6 4 5 6 4 5 6 4 5 6 4 5 6 7 3 4 5 6 7 4 5 6 8 4 5 6 |

              3        26
o1 : Matrix QQ  <--- QQ
i2 : halfspaces = fourierMotzkin rays
FM: elim 3 3 3
FM: elim 4 3 3
FM: elim 5 4 4
FM: elim 6 5 5
FM: elim 7 4 4
FM: elim 8 4 4
FM: elim 9 5 5
FM: elim 10 4 4
FM: elim 11 4 4
FM: elim 12 5 5
FM: elim 13 4 4
FM: elim 14 4 4
FM: elim 15 4 4
FM: elim 16 5 5
FM: elim 17 5 5
FM: elim 18 5 5
FM: elim 19 5 5
FM: elim 20 6 6
FM: elim 21 7 7
FM: elim 22 7 7
FM: elim 23 5 5
FM: elim 24 5 5
FM: elim 25 6 6

o2 = (| -8 -22 0  -17 18 8  |, 0)
      | 1  2   1  -1  -1 -2 |
      | 0  1   -2 3   -4 -1 |

o2 : Sequence
i3 : numgens source halfspaces#0

o3 = 6
i4 : extremalRays = fourierMotzkin halfspaces
FM: elim 3 3 3
FM: elim 4 4 4
FM: elim 5 5 5

o4 = (| 1 1 1 1 1 1 |, 0)
      | 2 1 6 7 8 8 |
      | 4 6 3 8 4 6 |

o4 : Sequence
i5 : numgens source extremalRays#0

o5 = 6
Using Fourier-Motzkin elimination a second time, we see that this cone is in fact generated by 6 vectors.

Here are some further examples illustrating fourierMotzkin elimination.

Ways to use fourierMotzkin :