hasse_diagram for selected vertices

Questions and problems about using polymake go here.

Moderator: Moderators

satya123999
Posts: 25
Joined: 02 Apr 2013, 17:30

hasse_diagram for selected vertices

Postby satya123999 » 17 Mar 2015, 14:48

Dear all,

I followed your tutorial: http://polymake.org/doku.php/tutorial/f ... e_tutorial to compute a part of face lattice (e.g. 1 -dimensional faces). Is it possible to use this function to compute a part of face lattice with few selected vertices (which is pre-defined) ? For example, I am interested only to test if few selected vertices share a common 1 or 2-dimensional face ? (because even computing a part of face lattice (with all vertices) for a very large polytope is taking considerable amount of time)

Best Regards,
Satya

User avatar
joswig
Main Author
Posts: 224
Joined: 24 Dec 2010, 11:10

Re: hasse_diagram for selected vertices

Postby joswig » 20 Mar 2015, 15:27

No, currently, such a function is not supported directly. However, it is not difficult to obtain: Take all facets (i.e. rows of VERTICES_IN_FACETS) containing the two given vertices and intersect them (as sets of vertices, i.e., as objects of type Set<Int>). Then compute the dimension of the affine span of the VERTICES corresponding to that intersection. This is the dimension of the face spanned by the two vertices given.

satya123999
Posts: 25
Joined: 02 Apr 2013, 17:30

Re: hasse_diagram for selected vertices

Postby satya123999 » 21 Mar 2015, 17:19

Thank you very much for the reply.

If I understand correctly, to realise this in polymake, I think I have to create a new Polytope with the vertices (with POINTS property) obtained from the intersection and compute its dimension (this should be the dimension of affine hull & also the dimension of the face spanned by two given vertices ) ?

Regards,
Satya

User avatar
gawrilow
Main Author
Posts: 354
Joined: 25 Dec 2010, 17:40

Re: hasse_diagram for selected vertices

Postby gawrilow » 22 Mar 2015, 15:39

A rank() function should be enough:

Code: Select all

my $vif=$P->VERTICES_IN_FACETS; my $common_facets=new Set($vif->col(pop @selected_vertices)); $common_facets *= $vif->col($_) for @selected_vertices; if ($common_facets->size > 0) { my @common_facets=@{$common_facets}; my $point_set=new Set($vif->row(pop @common_facets)); $point_set *= $vif->row($_) for @common_facets; # subtracting 1 for homogeneous coordinate return rank($P->VERTICES->minor($point_set, All) - 1; } return -1;
I hope there are no errors here :?

User avatar
joswig
Main Author
Posts: 224
Joined: 24 Dec 2010, 11:10

Re: hasse_diagram for selected vertices

Postby joswig » 22 Mar 2015, 18:25

A function similar to the above will be part of the next snapshot or release; see http://trac.polymake.org/changeset/ade6 ... 3e8483c347

satya123999
Posts: 25
Joined: 02 Apr 2013, 17:30

Re: hasse_diagram for selected vertices

Postby satya123999 » 30 Mar 2015, 13:07

Thank you very much for the function. I will try it and get back if I face any problems

I cannot access http://trac.polymake.org/changeset/ade6 ... 3e8483c347 (the polymake forum user credentials are not accepted by it)

User avatar
assarf
Developer
Posts: 74
Joined: 12 Oct 2011, 15:52

Re: hasse_diagram for selected vertices

Postby assarf » 31 Mar 2015, 09:52

That is true. It's basically just a link to the added function.

Code: Select all

# @category Combinatorics # For a given set of vertices compute the smallest face F containing them all. # Returns a Pair<Set,Set> where the first is the set of vertices of F, while the second is the set of facets containing F. # Example: $c=cube(3); print rank($c->VERTICES->minor($c->face([0,1])->first(),All))-1; # computes the dimension of the face of the 3-cube which is spanned by the vertices 0 and 1. user_method face { ... }
no signature


Return to “Helpdesk”

cron