How to add inequalities to a polyhedron

Questions and problems about using polymake go here.
athos
Posts: 3
Joined: 07 Feb 2013, 14:48

How to add inequalities to a polyhedron

Postby athos » 26 Feb 2013, 11:30

Dear All,


I am trying to figure out how to add inequalities to an existing polyhedron, and I can't really find this information in the tutorials. Can you please help on this?

Thanks!

Attila

herr
Developer
Posts: 40
Joined: 30 Dec 2010, 13:15

Re: Documentation / tutorial for beginners?

Postby herr » 26 Feb 2013, 11:47

Dear Attila,

You cannot add inequalities to an existing polytope, this is simply not the right way to look at a polymake object. Once you created an object, the properties (like INEQUALITES) you specified become immutable. This is necessary because polymake computes other properties from the given properties via rules, and stores them for further usage. Hence, the system of properties of an object needs to stay consistent.

The way to go is to create a new polytope with a new matrix of inequalities consisting of the original inequalities and a new set of inequalities. Here is an example:

Code: Select all

$p=cube(3);
Say, you want to cut off the part below the hyperplane H1:x1+x2+x3=1.

Code: Select all

$H1=new Vector(-1,1,1,1); $p_new=new Polytope(INEQUALITIES=>cube(3)->FACETS/$H1);
Notice that you must take care of the AFFINE_HULL if your polytope is not fulldimensional. In that case you should write

Code: Select all

$p_new=new Polytope(INEQUALITIES=>$p->FACETS/$H1,EQUATIONS=>$p->AFFINE_HULL);
PS: I tried to highlight the semantics of inequalities in the tutorial on polytopes. I hope it is more prominent now. Thanks for the hint!


Return to “Helpdesk”