Constructing a polytope from a list of facets

Questions and problems about using polymake go here.
Nicolas
Posts: 2
Joined: 21 Jan 2013, 17:37

Constructing a polytope from a list of facets

Postby Nicolas » 21 Jan 2013, 17:41

Hello,

In the following example, I construct $p from a list of inequalities, then I define $q as the polytope with the same vertices as $p, and $r as the polytope with the same facets as $q. But $p->VERTICES and $r->VERTICES are different.

$p=new Polytope<Rational>;
$p->INEQUALITIES = <<".";
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
0 0 0 0 0
-1 1 0 0 1
1 -1 0 0 -1
-1 0 1 1 0
1 0 -1 -1 0
0 -1 0 -1 1
0 -1 -1 1 0
.
$q=new Polytope<Rational>(VERTICES=>$p->VERTICES);
$r=new Polytope<Rational>(FACETS=>$q->FACETS);
print $p->VERTICES;
print $r->VERTICES;

I'm new to polymake so I guess I missed something simple, but I can't see what it is.

Thanks for your help!
Nicolas

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

Re: Constructing a polytope from a list of facets

Postby herr » 21 Jan 2013, 20:28

Hi Nicolas,

The problem is that your polytope $p is not fulldimensional:

Code: Select all

polytope > print $p->DIM; 2
Since your polytope is 2-dimensional in R^4, its affine hull is nontrivial:

Code: Select all

polytope > print $p->AFFINE_HULL; -1 0 1 1 0 -1 1 0 0 1
Therefore, the representation of a facet is not unique. The polytope does not change if you add vectors of the affine hull to the facets. (Think of a line segment in 2D, which can be bounded by a lot of different lines.)
For example, we have

Code: Select all

print $r->FACETS->[0]+$p->AFFINE_HULL->[0]; 0 -1 -1 1 0
which is equal to $p->FACETS->[2].

In fact, your code is a little wrong. You are not allowed to define a polytope only by its FACETS (or VERTICES). If you want to define these properties, you always have to specify the AFFINE_HULL (or the LINEALITY_SPACE) as well (and you need to be sure that your description is irredundant). If you don't really know the polytope, you should define it via the properties INEQUALITIES or POINTS, see also the Tutorial on polytopes.

Nicolas
Posts: 2
Joined: 21 Jan 2013, 17:37

Re: Constructing a polytope from a list of facets

Postby Nicolas » 22 Jan 2013, 11:14

Got it! Thank you very much for your kind and detailed explanations.


Return to “Helpdesk”