Sage includes cddlib, which I believe uses the Fourier-Motzkin
algorithm (keeping track of both vertices and inequalities.  The
easiest way to access this functionality is probably the Polyhedron
class, for example the following defines an unbouded region in R^3
through its inequalities (a list such as [2,0,1,1] means 2 + 0*x_0 +
1*x_1 + 1*x_2 >= 0):

sage: p = Polyhedron(ieqs = [[1, 0, 1,0], [1, 1, 0,0], [1, 1, -1,0],
[0,0,0,1]])
sage: p
A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 2
vertices and 3 rays.

You can get the vertices and rays defining this region:
sage: print p.vertices()
sage: print p.rays()
[[-1, -1, 0], [-1, 0, 0]]
[[1, 1, 0], [1, 0, 0], [0, 0, 1]]

and from that you could eliminate the third variable by restricting
the rays and vertices to the dimensions you want; for instance
eliminating the last variable:
sage: p2 = Polyhedron(vertices = [x[0:2] for x in p.vertices()], rays
= [x[0:2] for x in p.rays()])
sage: p2
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 2
vertices and 2 rays.

-Marshall Hampton

On Jan 24, 12:47 am, tvn <nguyenthanh...@gmail.com> wrote:
> hi,  just wondering if the Fourier-Motzkin algorithm for eliminating
> variable from a system of linear inequalities is implemented somewhere in
> Sage ?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to