Macaulay2 » Documentation
Packages » FourierMotzkin :: fourierMotzkin
next | previous | forward | backward | up | index | toc

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

- Usage:
    `(A',B') = fourierMotzkin(A,B)`
- Inputs:
  - A, a Matrix with entries in ZZ or QQ
  - B, a Matrix with entries in ZZ or QQ(this input is optional)
- Outputs:
  - A', a Matrix with entries in ZZ or QQ
  - B', a Matrix with entries in ZZ or QQ

## 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 : raylist = 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 : halfspaceList = fourierMotzkin raylist

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

    o2 : Sequence

    i3 : numgens source halfspaceList#0

    o3 = 6

    i4 : extremalRays = fourierMotzkin halfspaceList

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

    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.

- Finding the facets of the cyclic polytope
- Finding the facets of the permutahedron

## Ways to use fourierMotzkin:

- `fourierMotzkin(Matrix)`
- `fourierMotzkin(Matrix,Matrix)`

## For the programmer

The object fourierMotzkin is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/FourierMotzkin.m2:354:0.