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 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 halfspaces#0 o3 = 6 |
i4 : extremalRays = fourierMotzkin halfspaces 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 |
Here are some further examples illustrating fourierMotzkin elimination.
The object fourierMotzkin is a method function.