Different output from polytopes

Questions and problems about using polymake go here.
torpe
Posts: 2
Joined: 20 Dec 2011, 15:38

Different output from polytopes

Postby torpe » 20 Dec 2011, 15:59

Hi there,

my intention is to analyse a polytope when adding additional inequalities to its definition. But something seems to be going wrong when defining a polytope via its vertices on one hand and via its inequality description on the other.

I create my first polytope with this script:

Code: Select all

use application "polytope"; declare $p; $p = new Polytope<Rational>(POINTS=>[ [1,1,0,0,0,1,0,0,0,1,0,0,1], [1,1,0,0,0,1,0,0,0,1,0,1,0], [1,1,0,0,0,1,0,0,0,1,1,0,0], [1,1,0,0,0,1,0,0,1,0,0,0,1], [1,1,0,0,0,1,0,0,1,0,0,1,0], [1,1,0,0,0,1,0,0,1,0,1,0,0], [1,1,0,0,0,1,0,1,0,0,0,0,1], [1,1,0,0,0,1,0,1,0,0,0,1,0], [1,1,0,0,0,1,0,1,0,0,1,0,0], [1,1,0,0,1,0,0,0,1,0,0,0,1], [1,1,0,0,1,0,0,0,1,0,0,1,0], [1,1,0,0,1,0,0,0,1,0,1,0,0], [1,1,0,0,1,0,0,1,0,0,0,1,0], [1,1,0,0,1,0,0,1,0,0,1,0,0]]); print "DIM\n"; print $p->DIM; print "\n\nN_VERTICES\n"; print $p->N_VERTICES; print "\n\nVERTICES\n"; print $p->VERTICES; print "\n\nN_FACETS\n"; print $p->N_FACETS; print "\n\nFACETS\n"; print $p->FACETS; [\code] The output is: [code] DIM 5 N_VERTICES 14 VERTICES 1 1 0 0 0 1 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 N_FACETS 9 FACETS 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 -1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 -1 0 1 0 0 0 0 0 0 -1 -1 0 0 0 0 [\code] Now I take the facets from this output, which are a inequality description of the polytope, and create a polytope with that description: [code] use application "polytope"; declare $p; $p = new Polytope<Rational>(INEQUALITIES=>[ [0,0,0,0,0,0,0,0,0,0,1,0,0], [0,0,0,0,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,-1,0,0,0,1,0,1,1,0], [0,0,0,0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,-1,0,0,1,1,0,0,0,0], [1,0,0,0,0,0,0,0,0,0,-1,-1,0], [1,0,0,0,0,0,0,-1,-1,0,0,0,0]]); print "DIM\n"; print $p->DIM; print "\n\nN_VERTICES\n"; print $p->N_VERTICES; print "\n\nVERTICES\n"; print $p->VERTICES; print "\n\nN_FACETS\n"; print $p->N_FACETS; print "\n\nFACETS\n"; print $p->FACETS; [\code] The output here is: [code] DIM 12 N_VERTICES 14 VERTICES 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 N_FACETS 9 FACETS 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 -1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 -1 0 1 0 0 0 0 0 0 -1 -1 0 0 0 0 [\code] Shouldn't the vertices or at least the dimension be the same as before? Am I understanding or doing something wrong? If someone has an idea, please help. Thanks, Martin

blorenz
Developer
Posts: 139
Joined: 10 Jan 2011, 17:21

Re: Different output from polytopes

Postby blorenz » 20 Dec 2011, 20:39

Now I take the facets from this output, which are a inequality description of the polytope, and create a polytope with that description:
The facets do not suffice to describe the polytope, as it is not full-dimensional. You also need the subspace that contains the polytope, which is given in the AFFINE_HULL property. This can be used as input for the EQUATIONS property of the new polytope.

The new polytope you created is in fact a polyhedron with a nontrivial lineality space, have a look at the properties LINEALITY_DIM and LINEALITY_SPACE.

Ben

torpe
Posts: 2
Joined: 20 Dec 2011, 15:38

Re: Different output from polytopes

Postby torpe » 21 Dec 2011, 09:18

I thought about this being a problem but didn't know how to fix it. Now I have the output I was expecting.

Thank you!

Martin


Return to “Helpdesk”