Page 1 of 1
hasse_diagram for selected vertices
Posted: 17 Mar 2015, 14:48
by satya123999
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
Re: hasse_diagram for selected vertices
Posted: 20 Mar 2015, 15:27
by joswig
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.
Re: hasse_diagram for selected vertices
Posted: 21 Mar 2015, 17:19
by satya123999
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
Re: hasse_diagram for selected vertices
Posted: 22 Mar 2015, 15:39
by gawrilow
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
Re: hasse_diagram for selected vertices
Posted: 22 Mar 2015, 18:25
by joswig
A function similar to the above will be part of the next snapshot or release; see
http://trac.polymake.org/changeset/ade6 ... 3e8483c347
Re: hasse_diagram for selected vertices
Posted: 30 Mar 2015, 13:07
by satya123999
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)
Re: hasse_diagram for selected vertices
Posted: 31 Mar 2015, 09:52
by assarf
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 {
...
}