ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 06 Oct 2014 10:30:12 +0200Integer hull of a polytopehttps://ask.sagemath.org/question/24404/integer-hull-of-a-polytope/I'm trying to generate the matching polytope for general graphs by using `MixedIntegerLinearProgram` and `Polyhedron`.
Generally, starting with the incidence matrix of a given graph $G$, I can accomplish this task by either setting variables in `MixedIntegerLinearProgram` to be `binary` or adding the odd set constraints to `MixedIntegerLinearProgram`.
But now I'm trying to get the matching polytope by simply taking the **Integer Hull** of the polytope defined by incidence matrix of $G$ without setting variables to be `binary` or adding the odd set constraints to `MixedIntegerLinearProgram`.
So is there a `integer_hull` function in sage or how can I get the integer hull from a given convex hull?HanMon, 06 Oct 2014 10:30:12 +0200https://ask.sagemath.org/question/24404/interpreting 4d representation of infinite dualhttps://ask.sagemath.org/question/23224/interpreting-4d-representation-of-infinite-dual/ So, in my usual way of throwing somewhat arbitrary commands at CASes to see what they do, I executed the following:
implex = Polyhedron(vertices = [[1.2,0,0,0],[0,0,0,1],[0,1,0,0],[0,0,1,0]])
implexdual = implex.polar()
show(implexdual)
implex is a 3-simplex in 4-space.
implexdual is "A 4-dimensional polyhedron in RDF^4 defined as the convex hull of 4 vertices and 1 line."
Because it's 4-dimensional, I expected to see a wireframe Schlegel-diagram-ish thing when executing show(implexdual). What I get is four cones pointing in different directions, each of which has a smaller cone sticking out of its base.
Errrrrr.... what am I looking at?
smbelcasSat, 05 Jul 2014 15:52:00 +0200https://ask.sagemath.org/question/23224/Compute the centroid of a polytopehttps://ask.sagemath.org/question/8092/compute-the-centroid-of-a-polytope/Does SAGE have a way to compute the center of mass of a polytope? I tried using polymake's centroid method, but that returned an error because the dimension of my polytope is not equal to the ambient dimension. I've read the manual and looked at the available functions but can't seem to find a SAGE command to do this. Does it exist?
EDIT: By request here's some sample _polymake_ code that fails (I'm not sure why this would be useful unless SAGE is using polymake under the hood):
polytope > $q=permutahedron(3);
polytope > print $q->CENTROID;
polymake: WARNING: could not compute 'CENTROID' probably because of unsatisfied preconditions:
precondition : DIM, AMBIENT_DIM ( CENTROID, VOLUME : VERTICES, TRIANGULATION.FACETS )
I'm guessing the error occurs because the ambient dimension of this polytope is 4 but the actual dimension of the polytope is 3; this is the same reason polymake tells me the volume of q is 0.adkWed, 27 Apr 2011 15:50:26 +0200https://ask.sagemath.org/question/8092/