# application: polytope

This is the historically first application, and the largest one.

It deals with convex pointed polyhedra. It allows to define a polyhedron either as a convex hull of a point set, an intersection of halfspaces, or as an incidence matrix without any embedding. Then you can ask for a plenty of its (especially combinatorial) properties, construct new polyhedra by modifying it, or study the behavior of the objective functions.

There is a wide range of visualization methods for polyhedra, even for dimensions > 4 and purely combinatorial descriptions, including interfaces to interactive geometry viewers (such as JavaView or geomview), generating PostScript drawings and povray scene files.

imports from: common, graph
uses: group, ideal, topaz

## Objects

•

### AffineLattice

Category: Geometry

a lattice that is displaced from the origin, i.e., a set of the form x + L, where x is a non-zero vector and L a (linear) lattice

•

### Cone

A polyhedral cone, not necessarily pointed. Note that in contrast to the vertices of a polytope, the RAYS are given in affine coordinates.

•

### Backward compatibility

These methods are provided for backward compatibility with older versions of polymake only. They should not be used in new code.

•

### Combinatorics

These methods capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

•
CONNECTIVITY ()

Connectivity of the GRAPH this is the minimum number of nodes that have to be removed from the GRAPH to make it disconnected

•
DUAL_CONNECTIVITY ()

Connectivity of the DUAL_GRAPH this is the minimum number of nodes that have to be removed from the DUAL_GRAPH to make it disconnected

•
DUAL_EVEN ()

True if the DUAL_GRAPH is bipartite

•
EVEN ()

True if the GRAPH is bipartite

•
FACET_DEGREES () → Vector<Int>

Facet degrees of the polytope. The degree of a facet is the number of adjacent facets.

##### Returns
 Vector - in the same order as FACETS
•
N_FLAGS (type ...)

Determine the number of flags of a given type. type must belong to {0,...,COMBINATORIAL_DIM-1}. Example: "N_FLAGS(0,3,4)" determines the entry f034 of the flag vector.

##### Parameters
 Int type ... flag type
•
VERTEX_DEGREES () → Vector<Int>

Ray degrees of the cone

##### Returns
 Vector - in the same order as RAYS
•

### Geometry

These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

•
AMBIENT_DIM ()

returns the dimension of the ambient space of the cone

•
DIM ()

returns the geometric dimension of the cone (including the lineality space) for the dimension of the pointed part ask for COMBINATORIAL_DIM

•

### Lattice points in cones

These methods capture information that depends on the lattice structure of the cone. polymake always works with the integer lattice.

•
HILBERT_BASIS () → Matrix<Integer>

for a cone this method returns a Hilbert basis of the cone for a polytope this method returns a Hilbert basis of the homogenization cone of the polytope note: if the cone is not pointed (the polytope is not bounded) then the returned basis is not unique and usually not minimal

##### Returns
 Matrix
•

### Topology

The following methods compute topological invariants.

•

### GroebnerBasis

Category: Lattice points in cones

The Groebner basis of the homogeneous toric ideal associated to the polytope, the term order is given in matrix form.

•

### LatticePolytope

A polytope all of whose vertex coordinates are integral.

derived from: Polytope<Rational>

•

### Lattice points in cones

These methods capture information that depends on the lattice structure of the cone. polymake always works with the integer lattice.

•
FACET_POINT_LATTICE_DISTANCES (v) → Vector<Integer>

Vector containing the distances of a given point v from all facets

##### Parameters
 Vector v point in the ambient space of the polytope
##### Returns
 Vector
•
N_LATTICE_POINTS_IN_DILATION (n)

The number of LATTICE_POINTS in the n-th dilation of the polytope

##### Parameters
 Int n dilation factor
•
POLYTOPE_IN_STD_BASIS (P) → Polytope<Rational>

returns a polytope in the integer lattice basis if a LATTICE_BASIS is given

##### Parameters
 Polytope P polytope
##### Returns
 Polytope Pnew polytope
•

### LinearProgram

Category: Optimization

A linear program specified by a linear or abstract objective function

•

### OrbitPolytope

Category: Symmetry

A symmetric polytope defined as the convex hull of the orbit of a single point under a permutation group acting on coordinates.

derived from: SymmetricPolytope
##### Type Parameters
 Scalar default: Rational

•

### PointConfiguration

The POINTS of an object of type PointConfiguration encode a not necessarily convex finite point set. The difference to a parent VectorConfiguration is that the points have homogeneous coordinates, i.e. they will be normalized to have first coordinate 1 without warning.

derived from: VectorConfiguration
##### Type Parameters
 Scalar default: Rational

•

### Triangulation and volume

These methods collect information about triangulations of the object and properties usually computed from such, as the volume.

•
TRIANGULATION_SIGNS () → Array<Int>

For each simplex in the TRIANGULATION, this contains the sign of the determinant of its coordinate matrix, which is the orientation of the simplex.

##### Returns
 Array
•

### Visualization

These methods are for visualization.

•
VISUAL () → Visual::PointConfiguration

Visualize a point configuration.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::PointConfiguration
•
VISUAL_POINTS () → Visual::PointSet

Visualize the POINTS of a point configuration.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::PointSet
•

### Polytope

Not necessarily bounded or unbounded polyhedron. Nonetheless, the name "Polytope" is used for two reasons: Firstly, combinatorially we always deal with polytopes; see the description of VERTICES_IN_FACETS for details. The second reason is historical. We use homogeneous coordinates, which is why Polytope is derived from Cone. Note that a pointed polyhedron is projectively equivalent to a polytope. Scalar is the numeric data type used for the coordinates.

derived from: Cone

•

### Backward compatibility

These methods are provided for backward compatibility with older versions of polymake only. They should not be used in new code.

•

### Combinatorics

These methods capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

•

### Geometry

These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

•
AMBIENT_DIM ()

returns the dimension of the ambient space of the polytope

•
contains (P, v) → Boolean

checks whether a given point is contained in a polytope

##### Parameters
 Polytope P polytope Vector v point
##### Returns
 Boolean
•
contains_in_interior (P, v) → Boolean

checks whether a given point is contained in the strict interior of a polytope

##### Parameters
 Polytope P polytope Vector v point
##### Returns
 Boolean
•
DIM ()

returns the dimension of the polytope

•
INNER_DESCRIPTION () → Array<Matrix<Scalar> >

Returns the inner description of a Polytope: [V,L] where V are the vertices and L is the lineality space

##### Returns
 Array >
•
labeled_vertices (label ...) → Set<Int>

Find the vertices by given labels.

##### Parameters
 String label ... vertex labels
##### Returns
 Set vertex indices
•
MINKOWSKI_CONE_COEFF (coeff) → Polytope<Rational>

returns the Minkowski summand of a polytope P given by a coefficient vector to the rays of the MINKOWSKI_CONE.

##### Parameters
 Vector coeff coefficient vector to the rays of the Minkowski summand cone
##### Returns
 Polytope
•
MINKOWSKI_CONE_POINT (point) → Polytope<Rational>

returns the Minkowski summand of a polytope P given by a point in the MINKOWSKI_CONE.

##### Parameters
 Vector point point in the Minkowski summand cone
##### Returns
 Polytope
•
OUTER_DESCRIPTION () → Array<Matrix<Scalar> >

Returns the outer description of a Polytope: [F,A] where F are the facets and A is the affine hull

##### Returns
 Array >
•

### Lattice points in polytopes

These methods capture information that depends on the lattice structure of the polytope. polymake always works with the integer lattice.

•
LATTICE_POINTS () → Matrix<Integer>

Returns the lattice points in bounded Polytopes.

##### Returns
 Matrix
•

### Triangulation and volume

These methods collect information about triangulations of the object and properties usually computed from such, as the volume.

•
TRIANGULATION_INT_SIGNS () → Array<Int>

the orientation of the simplices of TRIANGULATION_INT in the given order of the POINTS

##### Returns
 Array - +1/-1 array specifying the sign of the determinant of each simplex
•
TRIANGULATION_SIGNS () → Array<Int>

For each simplex in the TRIANGULATION, contains the sign of the determinant of its coordinate matrix, telling about its orientation.

##### Returns
 Array
•

### Unbounded polyhedra

These methods collect geometric information of a polytope only relevant if it is unbounded, e. g. the far face or the complex of bounded faces.

•
BOUNDED_DUAL_GRAPH ()

Dual graph of the bounded subcomplex.

•
BOUNDED_FACETS () → Set<Int>

Indices of FACETS that are bounded.

##### Returns
 Set
•
BOUNDED_GRAPH ()

Graph of the bounded subcomplex.

•
BOUNDED_HASSE_DIAGRAM ()

HASSE_DIAGRAM constrained to affine vertices Nodes representing the maximal inclusion-independent faces are connected to the top-node regardless of their dimension

•
BOUNDED_VERTICES () → Set<Int>

Indices of VERTICES that are no rays.

##### Returns
 Set
•

### Visualization

These methods are for visualization.

•
GALE () → Visual::Gale

Generate the Gale diagram of a d-polyhedron with at most d+4 vertices.

##### Returns
 Visual::Gale
•
SCHLEGEL () → Visual::SchlegelDiagram

Create a Schlegel diagram and draw it.

##### Options
 FIXME proj_facet decorations for the Edges of the projection face option list: schlegel_init option list: Visual::Wire::decorations
##### Returns
 Visual::SchlegelDiagram
•
VISUAL () → Visual::Polytope

Visualize a polytope as a graph (if 1d), or as a solid object (if 2d or 3d), or as a Schlegel diagram (4d).

##### Options
 option list: Visual::Polygons::decorations option list: Visual::Wire::decorations option list: Visual::PointSet::decorations option list: geometric_options
##### Returns
 Visual::Polytope
•
VISUAL_BOUNDED_GRAPH () → Visual::PolytopeGraph

Visualize the BOUNDED_COMPLEX.GRAPH of a polyhedron.

##### Options
 Int seed random seed value for the string embedder option list: Visual::Graph::decorations
##### Returns
 Visual::PolytopeGraph
•
VISUAL_DUAL () → Visual::Polygons

Visualize the dual polytope as a solid 3-d object. The polytope must be BOUNDED and CENTERED.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::Polygons
•
VISUAL_DUAL_FACE_LATTICE () → Visual::PolytopeLattice

Visualize the dual face lattice of a polyhedron as a multi-layer graph.

##### Options
 Int seed random seed value for the node placement option list: Visual::Lattice::decorations
##### Returns
 Visual::PolytopeLattice
•
VISUAL_DUAL_GRAPH () → Visual::Graph

Visualize the DUAL_GRAPH of a polyhedron.

##### Options
 Int seed random seed value for the string embedder option list: Visual::Graph::decorations
##### Returns
 Visual::Graph
•
VISUAL_FACE_LATTICE () → Visual::PolytopeLattice

Visualize the HASSE_DIAGRAM of a polyhedron as a multi-layer graph.

##### Options
 Int seed random seed value for the node placement option list: Visual::Lattice::decorations
##### Returns
 Visual::PolytopeLattice
•
VISUAL_GRAPH () → Visual::PolytopeGraph

Visualize the GRAPH of a polyhedron.

##### Options
 Int seed random seed value for the string embedder option list: Visual::Graph::decorations
##### Returns
 Visual::PolytopeGraph
•
VISUAL_TRIANGULATION_BOUNDARY () → Visual::Polygons

Visualize the TRIANGULATION_BOUNDARY of the polytope. Obsolete: the preferred procedure is to create a SimplicialComplex using the boundary_complex client of the application topaz and call its VISUAL method. FIXME: There is no boundary_complex in topaz.

##### Options
 option list: Visual::Polygon::decorations
##### Returns
 Visual::Polygons
•

### PropagatedPolytope

Polytope propagation means to define a polytope inductively by assigning vectors to arcs of a directed graph. At each node of such a graph a polytope arises as the joint convex hull of the polytopes at the translated sources of the inward pointing arcs.

For details see Joswig: Polytope Propagation on Graphs. Chapter 6 in Pachter/Sturmfels: Algebraic Statistics for Computational Biology, Cambridge 2005.

derived from: Polytope

•

### QuotientSpace

Category: Symmetry

A topological quotient space obtained from a Polytope by identifying faces. This object will sit inside the polytope.

Contained in extension `bundled:group`.

•

### SchlegelDiagram

A Schlegel diagram of a polytope.

##### Type Parameters
 Scalar default Rational

#### User Methods of SchlegelDiagram

•
VISUAL () → Visual::SchlegelDiagram

Draw the Schlegel diagram.

##### Options
 pm::perl::Hash proj_facet decoration for the edges of the projection face option list: Visual::Graph::decorations
##### Returns
 Visual::SchlegelDiagram
•

### SymmetricCone

Category: Symmetry

A cone which is generated by a group and a generating set of inequalities (+equations) or input rays (+input_lineality). The cone is the intersection or the convex hull of all inequalities or input rays in the orbit of the generating set under the GENERATING_GROUP.

derived from: Cone
##### Type Parameters
 Scalar default: Rational

#### User Methods of SymmetricCone

•
VISUAL_ORBIT_COLORED_GRAPH () → Visual::ConeGraph

Visualizes the graph of a symmetric cone: All nodes belonging to one orbit get the same color.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::ConeGraph
•

### SymmetricPolytope

Category: Symmetry

A polytope which is generated by a group and a generating set of inequalities (+equations) or points (+input_lineality). The polytope is the intersection or the convex hull of all inequalities or points in the orbit of the generating set under the GENERATING_GROUP.

derived from: SymmetricCone
##### Type Parameters
 Scalar default: Rational

#### User Methods of SymmetricPolytope

•
AMBIENT_DIM ()

must be copied (from common.rules) since SymmetricPolytope is derived from both objects, SymmetricCone and Polytope

•
DIM ()

must be copied (from common.rules) since SymmetricPolytope is derived from both objects, SymmetricCone and Polytope

•

### TightSpan

Bounded subcomplex of an unbounded polyhedron, which is associated with a finite metric space. The tight span is 1-dimensional if and only if the metric is tree-like. In this sense, the tight span captures the deviation of the metric from a tree-like one.

derived from: Polytope

•

### Visualization

These methods are for visualization.

•
VISUAL_BOUNDED_GRAPH () → Visual::PolytopeGraph

Visualize the BOUNDED_COMPLEX.GRAPH of a tight span.

##### Options
 Int seed random seed value for the string embedder option list: Visual::Graph::decorations
##### Returns
 Visual::PolytopeGraph
•
VISUAL_SPLITS () → Visual::FiniteMetricSpace

Visualize the splits of a finite metric space (that is, a planar image of a tight span). Calls SplitsTree.

##### Returns
 Visual::FiniteMetricSpace
•
VISUAL_TIGHT_SPAN () → Visual::Graph

This is a variation of Polytope::VISUAL_BOUNDED_GRAPH for the special case of a tight span. The vertices are embedded according to the METRIC, the others are hanged in between.

##### Options
 Int seed random seed value for the string embedder String norm which norm to use when calculating the distances between metric vectors ("max" or "square") option list: Visual::Graph::decorations
##### Returns
 Visual::Graph
•

### VectorConfiguration

An object of type VectorConfiguration deals with properties of row vectors, assembled into an n x d matrix called VECTORS. The entries of these row vectors are interpreted as non-homogeneous coordinates. In particular, the coordinates of a VECTOR will *NOT* be normalized to have a leading 1.

##### Type Parameters
 Scalar default: Rational

•

### Visual::PointConfiguration

Category: Visualization

Visualization of the point configuration.

#### User Methods of Visual::PointConfiguration

•
POLYTOPAL_SUBDIVISION () → Visual::PointConfiguration

Visualize the POLYTOPAL_SUBDIVISION of a point configuration.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::PointConfiguration
•
TRIANGULATION () → Visual::PointConfiguration

Visualize the TRIANGULATION of a point configuration

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::PointConfiguration
•
TRIANGULATION_BOUNDARY () → Visual::PointConfiguration

Draw the edges of the TRIANGULATION_BOUNDARY. The facets are made transparent.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::PointConfiguration
•

### Visual::Polytope

Category: Visualization

Visualization of a polytope as a graph (if 1d), or as a solid object (if 2d or 3d), or as a Schlegel diagram (4d).

#### User Methods of Visual::Polytope

•
DIRECTED_GRAPH (lp) → Visual::Polytope

Illustrate the behavior of a linear objective function on the polytope. Superpose the drawing with the directed graph induced by the objective function.

##### Parameters
 LinearProgram lp a Linear Program object attached to the polytope
##### Returns
 Visual::Polytope
•
LATTICE () → Visual::Polytope

Visualize the LATTICE_POINTS of a polytope

##### Options
 option list: Visual::PointSet::decorations
##### Returns
 Visual::Polytope
•
LATTICE_COLORED () → Visual::Polytope

Visualize the LATTICE_POINTS of a polytope in different colors (interior / boundary / vertices)

##### Options
 option list: Visual::PointSet::decorations
##### Returns
 Visual::Polytope
•
MIN_MAX_FACE (lp) → Visual::Polytope

Illustrate the behavior of a linear objective function on the polytope. Draw the facets contained in MAXIMAL_FACE and MINIMAL_FACE in distinct colors.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope.
##### Options
 Color min minimal face decoration (default: yellow vertices and/or facets) Color max maximal face decoration (default: red vertices and/or facets)
##### Returns
 Visual::Polytope
•
STEINER () → Visual::Polytope

Add the STEINER_POINTS to the 3-d visualization. The facets become transparent.

##### Options
 option list: Visual::PointSet::decorations
##### Returns
 Visual::Polytope
•
TRIANGULATION (t) → Visual::Polytope

Add the triangulation to the drawing. The facets of the whole polytope become transparent.

You may specify any triangulation of the current polytope. Per default, the TRIANGULATION property is taken. (Currently there is only one possible alternative triangulation: TRIANGULATION_INT).

Hint: Use the method Method -> Effect -> Explode Group of Geometries of JavaView for better insight in the internal structure.

##### Parameters
 Array> t facets of the triangulation
##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::Polytope
•
TRIANGULATION_BOUNDARY () → Visual::Polytope

Draw the edges of the TRIANGULATION_BOUNDARY. The facets are made transparent.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::Polytope
•
VERTEX_COLORS (lp) → Visual::Polytope

Illustrate the behavior of a linear objective function on the polytope. Color the vertices according to the values of the objective function.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope
##### Options
 Color min minimal vertex color (default: yellow) Color max maximal vertex color (default: red)
##### Returns
 Visual::Polytope
•

### Visual::PolytopeGraph

Category: Visualization

Visualization of the graph of a polyhedron.

#### User Methods of Visual::PolytopeGraph

•
DIRECTED_GRAPH (lp) → Visual::PolytopeGraph

Show the growth direction of a linear objective function via arrowed edges.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope
##### Returns
 Visual::PolytopeGraph
•
EDGE_COLORS () → Visual::PolytopeGraph

Produce an edge coloring of a bounded graph from local data in the Hasse diagram.

##### Returns
 Visual::PolytopeGraph
•
MIN_MAX_FACE (lp) → Visual::PolytopeGraph

Illustrate the behavior of a linear objective function on the polytope. The vertices belonging to MINIMAL_FACE and MAXIMAL_FACE are drawn in distinct colors

The spring embedder applies an additional force, which tries to arrange the nodes in the z-axis direction corresponding to the objective function values.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope
##### Options
 Color min minimal face decoration (default: yellow nodes) Color max maximal face decoration (default: red nodes)
##### Returns
 Visual::PolytopeGraph
•
VERTEX_COLORS (lp) → Visual::PolytopeGraph

Illustrate the behavior of a linear objective function on the polytope. Color the nodes according to the value the objective function takes on the vertices.

The spring embedder applies an additional force, which tries to arrange the nodes in the z-axis direction corresponding to the objective function values.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope.
##### Options
 Color min minimal face color (default: yellow) Color max maximal face color (default: red)
##### Returns
 Visual::PolytopeGraph
•

### Visual::PolytopeLattice

Category: Visualization

Visualization of the HASSE_DIAGRAM of a polyhedron as a multi-layer graph..

#### User Methods of Visual::PolytopeLattice

•
MIN_MAX_FACE (lp) → Visual::PolytopeLattice

Illustrate the behavior of a linear objective function on the polytope. Draw the filters of the MAXIMAL_FACE and MINIMAL_FACE in distinct colors.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope
##### Options
 Color min minimal face decoration (default: yellow border and ingoing edges) Color max maximal face decoration (default: red border and ingoing edges)
##### Returns
 Visual::PolytopeLattice
•

### Visual::SchlegelDiagram

Category: Visualization

Visualization of the Schlegel diagram of a polytope.

#### User Methods of Visual::SchlegelDiagram

•
CONSTRUCTION () → Visual::SchlegelDiagram

Visualize the construction of a 3D Schlegel diagram, that is, the Viewpoint, the 3-polytope and the projection onto one facet.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::SchlegelDiagram
•
DIRECTED_GRAPH (lp) → Visual::SchlegelDiagram

Illustrate the behavior of a linear objective function on the polytope. Superpose the drawing with the directed graph induced by the objective function.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope.
##### Returns
 Visual::SchlegelDiagram
•
MIN_MAX_FACE (lp) → Visual::SchlegelDiagram

Illustrate the behavior of a linear objective function on the polytope. The vertices belonging to MINIMAL_FACE and MAXIMAL_FACE are drawn in distinct colors

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope.
##### Options
 Color min minimal face decoration (default: yellow vertices and/or facets) Color max maximal face decoration (default: red vertices and/or facets)
##### Returns
 Visual::SchlegelDiagram
•
SOLID () → Visual::SchlegelDiagram

Draw the facets of the Schlegel diagram as polytopes.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::SchlegelDiagram
•
STEINER ()

UNDOCUMENTED

##### Options
 option list: Visual::PointSet::decorations
•
TRIANGULATION_BOUNDARY () → Visual::SchlegelDiagram

Draw the edges of the TRIANGULATION_BOUNDARY

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::SchlegelDiagram
•
TRIANGULATION_BOUNDARY_SOLID () → Visual::SchlegelDiagram

Draw the boundary simplices of the triangulation as solid tetrahedra.

##### Options
 option list: Visual::Polygons::decorations
##### Returns
 Visual::SchlegelDiagram
•
VERTEX_COLORS (lp) → Visual::SchlegelDiagram

Illustrate the behavior of a linear objective function on the polytope. Color the vertices according to the values of the objective function.

##### Parameters
 LinearProgram lp a LinearProgram object attached to the polytope.
##### Options
 Color min minimal vertex color (default: yellow) Color max maximal vertex color (default: red)
##### Returns
 Visual::SchlegelDiagram
•

### VoronoiDiagram

For a finite set of SITES S the Voronoi region of each site is the set of points closest (with respect to Euclidean distance) to the given site. All Voronoi regions (and their faces) form a polyhedral complex which is a vertical projection of the boundary complex of an unbounded polyhedron P(S). This way VoronoiDiagram becomes a derived class from Polytope<Scalar>.

derived from: Polytope

•

### Visualization

These methods are for visualization.

•
VISUAL_CRUST () → Visual::Container

Draw a Voronoi diagram, its |dual graph and the crust. Use the interactive features of the viewer to select.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::Container
•
VISUAL_NN_CRUST () → Visual::Container

Draw a Voronoi diagram, its dual graph and the nearest neighbor crust. Use the interactive features of the viewer to select.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::Container
•
VISUAL_VORONOI () → Visual::Container

Draw a Voronoi diagram and its dual. Use the interactive features of the viewer to select.

##### Options
 option list: Visual::Graph::decorations
##### Returns
 Visual::Container

## User Functions

•

### Combinatorics

These functions capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

•
circuits2matrix (co) → SparseMatrix<Rational>

Convert CIRCUITS or COCIRCUITS to a 0/+1/-1 matrix, with one row for each circuit/cocircuit, and as many columns as there are VECTORs/POINTS.

##### Parameters
 Set,Set>> co /circuits a set of circuits or cocircuits
##### Returns
 SparseMatrix
•
contraction (C, v)

Contract a vector configuration C along a specified vector v.

##### Parameters
 VectorConfiguration C Int v index of the vector to contract
•
deletion (C, v)

Delete a specified vector v from a vector configuration C.

##### Parameters
 VectorConfiguration C Int v index of the vector to delete
•
quotient_of_triangulation (T, G, R) → SparseVector

In a triangulation T, find the number of representatives of simplices wrt to G, and return the counts in the order indicated by the array R

Contained in extension `bundled:group`.
##### Parameters
 Array T the input triangulation, Array> G the generators of the symmetry group Array R the canonical lex-min representatives of the simplices
##### Options
 Bool foldable is the triangulation foldable?
##### Returns
 SparseVector V the number of times a simplex G-isomorphic to each representative in R occurs in T
•

### Comparing

Functions based on graph isomorphisms.

•
congruent (P1, P2) → Scalar

Check whether two given polytopes P1 and P2 are congruent, i.e. whether there is an affine isomorphism between them that is induced by a (possibly scaled) orthogonal matrix. Returns the scale factor, or 0 if the polytopes are not congruent.

We are using the reduction of the congruence problem (for arbitrary point sets) to the graph isomorphism problem due to:

Akutsu, T.: On determining the congruence of point sets in `d` dimensions.
Comput. Geom. Theory Appl. 9, 247--256 (1998), no. 4
##### Parameters
 Polytope P1 the first polytope Polytope P2 the second polytope
##### Returns
 Scalar the scale factor or 0 if the polytopes are not congruent
•
equal_polyhedra (P1, P2) → Bool

Tests if the two polyhedra P1 and P2 are equal.

##### Parameters
 Polytope P1 the first polytope Polytope P2 the second polytope
##### Returns
 Bool true if the two polyhedra are equal, false otherwise
•
find_facet_vertex_permutations (P1, P2) → Pair<Array<Int>, Array<Int>>

Find the permutations of facets and vertices which maps the cone or polyhedron P1 to P2. The facet permutation is the first component, the vertex permutation is the second component of the return value.

Only the combinatorial isomorphism is considered. If the polytopes are not isomorphic, an exception is thrown.

##### Parameters
 Cone P1 the first cone/polytope Cone P2 the second cone/polytope
##### Returns
 Pair, Array> the facet and the vertex permutations
•
included_polyhedra (P1, P2) → Bool

Tests if polyhedron P1 is included in polyhedron P2.

##### Parameters
 Polytope P1 the first polytope Polytope P2 the second polytope
##### Returns
 Bool 'true' if P1 is included in P2, 'false' otherwise
•
isomorphic (P1, P2) → Bool

Check whether the face lattices of two cones or polytopes are isomorphic. The problem is reduced to graph isomorphism of the vertex-facet incidence graphs.

##### Parameters
 Cone P1 the first cone/polytope Cone P2 the second cone/polytope
##### Returns
 Bool 'true' if the face lattices are isomorphic, 'false' otherwise
•
lattice_isomorphic_smooth_polytopes (P1, P2) → Bool

Tests whether two smooth lattice polytopes are lattice equivalent by comparing lattice distances between vertices and facets.

##### Parameters
 LatticePolytope P1 the first lattice polytope LatticePolytope P2 the second lattice polytope
##### Returns
 Bool 'true' if the polytopes are lattice equivalent, 'false' otherwise
•

### Consistency check

These functions are for checking the consistency of some properties.

•
check_inc (points, hyperplanes, sign, verbose) → Bool

Check coordinate data. For each pair of vectors from two given matrices their inner product must satisfy the given relation.

##### Parameters
 Matrix points Matrix hyperplanes String sign composed of one or two characters from [-+0], representing the allowed domain of the vector inner products. Bool verbose print all products violating the required relation
##### Returns
 Bool 'true' if all relations are satisfied, 'false' otherwise
•
check_poly (VIF) → Polytope

Try to check whether a given vertex-facet incidence matrix VIF defines a polytope. Note that a successful certification by check_poly is not sufficient to determine whether an incidence matrix actually defines a polytope. Think of it as a plausibility check.

##### Parameters
 IncidenceMatrix VIF
##### Options
 Bool dual transposes the incidence matrix Bool verbose prints information about the check.
##### Returns
 Polytope the resulting polytope under the assumption that VIF actually defines a polytope
•
validate_moebius_strip (P) → Bool

Validates the output of the client edge_orientable, in particular it checks whether the MOEBIUS_STRIP_EDGES form a Moebius strip with parallel opposite edges. Prints a message to stdout.

##### Parameters
 Polytope P the given polytope
##### Returns
 Bool 'true' if the Moebius strip edges form such a Moebius strip, 'false' otherwise
•

Checks whether the MOEBIUS_STRIP_QUADS form a Moebius strip with parallel opposite edges. Prints a message to stdout and returns the MOEBIUS_STRIP_EDGES if the answer is affirmative.

##### Parameters
 Polytope P the given polytope
##### Options
 Bool verbose print details
##### Returns
 Matrix the Moebius strip edges
•

### Coordinate conversions

The following functions allow for the conversion of the coordinate type of cones and polytopes.

•
affine_float_coords (P) → Matrix<Float>

Dehomogenize the vertex coordinates and convert them to Float

##### Parameters
 Polytope P source object
##### Returns
 Matrix the dehomogenized vertices converted to Float
•
convert_to <Coord> (c) → Cone<Coord>

Creates a new Cone object with different coordinate type target coordinate type Coord must be specified in angle brackets e.g. \$new_cone = convert_to<Coord>(\$cone)

##### Type Parameters
 Coord target coordinate type
##### Parameters
 Cone c the input cone
##### Returns
 Cone a new cone object or C itself it has the requested type
•
convert_to <Coord> (P) → Polytope<Coord>

provide a Polytope object with desired coordinate type

##### Type Parameters
 Coord target coordinate type
##### Parameters
 Polytope P source object
##### Returns
 Polytope P if it already has the requested type, a new object otherwise
•

### Geometry

These functions capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

•
all_steiner_points (P) → Matrix

Compute the Steiner points of all faces of a polyhedron P using a randomized approximation of the angles. P must be BOUNDED.

##### Parameters
 Polytope P
##### Options
 eps controls the accuracy of the angles computed Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Matrix
•
dihedral_angle (H1, H2) → Float

Compute the dihedral angle between two (oriented) affine or linear hyperplanes.

##### Parameters
 Vector H1 : first hyperplane Vector H2 : second hyperplane
##### Options
 deg output in degrees rather than radians, default 0 cone hyperplanes seen as linear hyperplanes, default 0
##### Returns
 Float
•
induced_lattice_basis (p) → Matrix<Integer>

Returns a basis of the affine lattice spanned by the vertices

##### Parameters
 Polytope p the input polytope
##### Returns
 Matrix - the lattice basis.
•
integer_points_bbox (P) → Matrix<Integer>

Enumerate all integer points in the given polytope by searching a bounding box.

##### Parameters
 Polytope P
##### Returns
 Matrix
•
is_vertex (q, points) → Bool

Checks whether a given point q is a vertex of the polytope P generated by q and a set of other points points via solving a suitable LP (compare cdd redundancy check). Works without knowing the facets of P!

##### Parameters
 Vector q the vertex (candidate) which is to be separated from points Matrix points the points from which q is to be separated
##### Returns
 Bool 'true' if q is a vertex
•
minimal_vertex_angle (P) → Float

Computes the minimal angle between two vertices of the input polytope P.

##### Parameters
 Polytope P
##### Returns
 Float
•
normaliz_compute (C) → perl::ListReturn

Compute degree one elements, Hilbert basis or Hilbert series of a cone C with libnormaliz Hilbert series and Hilbert h-vector depend on the given grading and will not work unless C is HOMOGENEOUS or a MONOID_GRADING is set

Contained in extension `bundled:libnormaliz`.
##### Parameters
 Cone C
##### Options
 Bool from_facets supply facets instead of rays to normaliz Bool degree_one_generators compute the generators of degree one, i.e. lattice points of the polytope Bool hilbert_basis compute Hilbert basis of the cone C Bool h_star_vector compute Hilbert h-vector of the cone C Bool hilbert_series compute Hilbert series of the monoid Bool facets compute support hyperplanes (=FACETS,LINEAR_SPAN) Bool rays compute extreme rays (=RAYS) Bool dual_algorithm use the dual algorithm by Pottier Bool skip_long do not try to use long coordinates first Bool verbose libnormaliz debug output
##### Returns
 perl::ListReturn (degree one generators, Hilbert basis, Hilbert h-vector, Hilbert series, facets, linear_span, rays) (if they are requested)
•
print_face_lattice (VIF, dual)

Write the face lattice of a vertex-facet incidence matrix VIF to stdout. If dual is set true the face lattice of the dual is printed.

##### Parameters
 IncidenceMatrix VIF Bool dual
•
steiner_point (P) → Vector

Compute the Steiner point of a polyhedron P using a randomized approximation of the angles.

##### Parameters
 Polytope P
##### Options
 eps controls the accuracy of the angles computed Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Vector
•
zonotope_tiling_lattice (P) → AffineLattice

Calculates a generating set for a tiling lattice for P, i.e., a lattice L such that P + L tiles the affine span of P.

##### Parameters
 Polytope P the zonotope
##### Options
 lattice_origin_is_vertex Bool true if the origin of the tiling lattice should be a vertex of P; default false, ie, the origin will be the barycenter of P
##### Returns
 AffineLattice
•

### Optimization

These functions provide tools from linear, integer and dicrete optimization. In particular, linear programs are defined here.

•
core_point_algo (p, optLPvalue) → perl::ListReturn

Algorithm to solve highly symmetric integer linear programs (ILP). It is required that the group of the ILP induces the alternating or symmetric group on the set of coordinate directions. The linear objective function is the vector (0,1,1,..,1).

##### Parameters
 Polytope p Rational optLPvalue optimal value of LP approximation
##### Options
 Bool verbose
##### Returns
 perl::ListReturn (optimal solution, optimal value) or empty
•
core_point_algo_Rote (p, optLPvalue) → perl::ListReturn

Version of core_point_algo with improved running time (according to a suggestion by G. Rote). The core_point_algo is an algorithm to solve highly symmetric integer linear programs (ILP). It is required that the group of the ILP induces the alternating or symmetric group on the set of coordinate directions. The linear objective function is the vector (0,1,1,..,1).

##### Parameters
 Polytope p Rational optLPvalue optimal value of LP approximation
##### Options
 Bool verbose
##### Returns
 perl::ListReturn (optimal solution, optimal value) or empty
•
find_transitive_lp_sol (Inequalities) → perl::ListReturn

Algorithm to solve symmetric linear programs (LP) of the form max ctx , c=(0,1,1,..,1) subject to the inequality system given by Inequalities. It is required that the symmetry group of the LP acts transitively on the coordinate directions.

##### Parameters
 Matrix Inequalities the inequalities describing the feasible region
##### Returns
 perl::ListReturn (optLPsolution,optLPvalue,feasible,max_bounded)
•
inner_point (points)

Compute a true inner point of a convex hull of the given set of points.

##### Parameters
 Matrix points
•
lp2poly (file, testvec, prefix) → Polytope

Read a linear programming problem given in LP-Format (as used by cplex & Co.) and convert it to a Polytope<Scalar=Rational> object. By default Rational is used as coordinate type, but lp2poly<Float>("filename.lp") can be used to create a Polytope with Float coordinates.

WARNING The property FEASIBLE is NOT computed upon creation. This is done to avoid possibly long computation times before the object becomes available to the caller. This is NOT in keeping with standard practice in polymake, but after, all, these are linear programs and not polytopes.

##### Parameters
 String file filename of a linear programming problem in LP-Format Vector testvec If present, after reading in each line of the LP it is checked whether testvec fulfills it String prefix If testvec is present, all variables in the LP file are assumed to have the form \$prefix\$i
##### Options
 Int nocheck Do not automatically compute FEASIBLE for the polytope (recommended for very large LPs)
##### Returns
 Polytope
•
poly2lp (P, LP, maximize, file)

Convert a polymake description of a polyhedron to LP format (as used by CPLEX and other linear problem solvers) and write it to standard output or to a file. If LP comes with an attachment 'INTEGER_VARIABLES' (of type Array<Bool>), the output will contain an additional section 'GENERAL', allowing for IP computations in CPLEX. If the polytope is not FEASIBLE, the function will throw a runtime error.

##### Parameters
 Polytope P LinearProgram LP default value: P->LP Bool maximize produces a maximization problem; default value: 0 (minimize) String file default value: standard output
•
porta2poly (file) → Polytope<Rational>

Read an .ieq or .poi file (porta input) or .poi.ieq or .ieq.poi (porta output) and convert it to a Polytope<Rational> object

##### Parameters
 String file filename of a porta file (.ieq or .poi)
##### Returns
 Polytope
•
print_constraints (C) → Bool

Write the FACETS / INEQUALITIES and the LINEAR_SPAN / EQUATIONS of a polytope P or cone C in a readable way. COORDINATE_LABELS are adopted if present.

##### Parameters
 Cone C the given polytope or cone
##### Options
 Array ineq_labels changes the labels of the inequality rows Array eq_labels changes the labels of the equation rows
##### Returns
 Bool
•
random_edge_epl (G) → Vector<Rational>

Computes a vector containing the expected path length to the maximum for each vertex of a directed graph G. The random edge pivot rule is applied.

##### Parameters
 Graph G a directed graph
##### Returns
 Vector
•
rand_aof (P, start) → Vector<Rational>

Produce a random abstract objective function on a given simple polytope P. It is assumed that the boundary complex of the dual polytope is extendibly shellable. If, during the computation, it turns out that a certain partial shelling cannot be extended, then this is given instead of an abstract objective function. It is possible (but not required) to specify the index of the starting vertex start.

##### Parameters
 Polytope P a simple polytope Int start the index of the starting vertex; default value: random
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Vector
•
rel_int_point (P)

Computes a relative interior point of a polyhedron P and stores it in P->REL_INT_POINT. The unbounded flag needs to be set to true if the polyhedron could be unbounded.

##### Parameters
 Polytope P
•
separating_hyperplane (q, points) → ListReturn

Computes (the normal vector of) a hyperplane which separates a given point q from points via solving a suitable LP. The scalar product of the normal vector of the separating hyperplane and a point in points is greater or equal than 0 (same behavior as for facets!). If q is not a vertex of P=conv(points,q), the function returns a zero vector and sets answer to 'false'. Works without knowing the facets of P!

##### Parameters
 Vector q the vertex (candidate) which is to be separated from points Matrix points the points from which q is to be separated
##### Returns
•
separating_hyperplane_poly (p1, p2) → Vector

Computes (the normal vector of) a hyperplane which separates two given polytopes p1 and p2 if possible.

##### Parameters
 Polytope p1 the first polytope Polytope p2 the second polytope
##### Returns
 Vector a hyperplane separating p1 from p2
•
totally_dual_integral (inequalities) → Bool

Checks weather a given system of inequalities is totally dual integral or not. The inequalities should describe a full dimensional polyhedron

##### Parameters
 Matrix inequalities
##### Returns
 Bool
•
vertex_colors (P, LP) → Array<RGB>

Calculate RGB-color-values for each vertex depending on a linear or abstract objective function. Maximal and minimal affine vertices are colored as specified. Far vertices (= rays) orthogonal to the linear function normal vector are white. The colors for other affine vertices are linearly interpolated in the HSV color model.

If the objective function is linear and the corresponding LP problem is unbounded, then the affine vertices that would become optimal after the removal of the rays are painted pale.

##### Parameters
 Polytope P LinearProgram LP
##### Options
 RGB min the minimal RGB value RGB max the maximal RGB value
##### Returns
 Array
•
write_foldable_max_signature_ilp (P, outfile_name)

construct a linear program whose optimal value is an upper bound for the algebraic signature of a triangulation of P.

Contained in extension `bundled:group`.
##### Parameters
 Polytope P String outfile_name
•
write_simplexity_ilp (P, outfile_name)

construct a linear program whose optimal value is a lower bound for the minimal number of simplices in a triangulation of P.

Contained in extension `bundled:group`.
##### Parameters
 Polytope P String outfile_name
•

### Other

Special purpose functions.

•
edge_orientable (P)

Checks whether a 2-cubical polytope P is edge-orientable (in the sense of Hetyei), that means that there exits an orientation of the edges such that for each 2-face the opposite edges point in the same direction. It produces the certificates EDGE_ORIENTATION if the polytope is edge-orientable, or MOEBIUS_STRIP_EDGES otherwise. In the latter case, the output can be checked with the client validate_moebius_strip.

##### Parameters
 Polytope P the given 2-cubical polytope
•
violations (P, q) → Set

Check which relations, if any, are violated by a point.

##### Parameters
 Polytope P Vector q
##### Options
 String section Which section of P to test against q Int violating_criterion has the options: +1 (positive values violate; this is the default), 0 (*non*zero values violate), -1 (negative values violate)
##### Returns
 Set
•
wronski_center_ideal (L, lambda)

Returns a system of polynomials which is necessary to check if degeneration avoids center of projection: compute eliminant e(s); this must not have a zero in (0,1)

##### Parameters
 Matrix L lattice points Vector lambda height function on lattice points
•
wronski_polynomial (M, lambda, coeff, s)

Returns a Wronski polynomial of a topaz::FOLDABLE triangulation of a lattice polytope

##### Parameters
 Matrix M points (in homogeneous coordinates); affinely span the space Vector lambda height function on lattice points Array coeff coefficients Scalar s additional Parameter in the polynomial
##### Options
 topaz::SimplicialComplex triangulation The triangulation of the pointset corresponding to the lifting function Ring ring the ring in which the polynomial should be
•
wronski_system (M, lambda, coeff_array, s)

Returns a Wronski system of a topaz::FOLDABLE triangulation of a lattice polytope

##### Parameters
 Matrix M points (in homogeneous coordinates); affinely span the space Vector lambda height function on lattice points Array> coeff_array coefficients Scalar s additional Parameter in the polynomial
##### Options
 topaz::SimplicialComplex triangulation The triangulation of the pointset corresponding to the lifting function Ring ring the ring in which the polynomial should be
•

### Producing a cone

Various constructions of cones.

•
normal_cone (p, v, outer) → Cone

Computes the normal cone of p at the vertex v. By default this is the inner normal cone.

##### Parameters
 Polytope p Int v vertex number which is not contained in the far face Bool outer asks for outer normal cone. Default value is 0 (= inner)
##### Returns
 Cone
•
recession_cone (P) → Cone<Scalar>

retuns the recession cone (tail cone, characteristic cone) of a polytope

##### Parameters
 Polytope P polytope
##### Returns
 Cone
•
subcone (C) → Cone

Make a subcone from a cone.

##### Parameters
 Cone C the input cone
##### Options
 Bool relabel creates an additional section RAY_LABELS;
##### Returns
 Cone
•

### Producing a point configuration

Constructing a point configuration, either from scratch or from existing objects.

•
minkowski_sum (P1, P2) → PointConfiguration

Produces the Minkowski sum of P1 and P2.

##### Parameters
 PointConfiguration P1 PointConfiguration P2
##### Returns
 PointConfiguration
•
minkowski_sum (lambda, P1, mu, P2) → PointConfiguration

Produces the polytope lambda*P1+mu*P2, where * and + are scalar multiplication and Minkowski addition, respectively.

##### Parameters
 Scalar lambda PointConfiguration P1 Scalar mu PointConfiguration P2
##### Returns
 PointConfiguration
•

### Producing a polytope from graphs

Polytope constructions which take graphs as input.

•
cut_polytope (G) → Polytope

Cut polytope of an undirected graph.

##### Parameters
 Graph G
##### Returns
 Polytope
•
flow_polytope <Scalar> (G, Arc_Bounds, source, sink) → Polytope

Produces the flow polytope of a directed Graph G=(V,E) with a given source and sink. The flow polytope has the following outer description: forall v in V-{source, sink}: sum_{e in E going into v} x_e - sum_{e in E going out of v} x_e = 0

sum_{e in E going into source} x_e - sum_{e in E going out of source} x_e <= 0

sum_{e in E going into sink} x_e - sum_{e in E going out of sink} x_e >= 0

forall e in E: x_e <= given bound on edge e

##### Type Parameters
 Scalar
##### Parameters
 Graph G EdgeMap Arc_Bounds Int source Int sink
##### Returns
 Polytope
•
flow_polytope <Scalar> (G, Arc_Bounds, source, sink) → Polytope

Produces the flow polytope of a directed Graph G=(V,E) with a given source and sink. The flow polytope has the following outer description: forall v in V-{source, sink}: sum_{e in E going into v} x_e - sum_{e in E going out of v} x_e = 0

sum_{e in E going into source} x_e - sum_{e in E going out of source} x_e <= 0

sum_{e in E going into sink} x_e - sum_{e in E going out of sink} x_e >= 0

forall e in E: x_e <= given bound on edge e

##### Type Parameters
 Scalar
##### Parameters
 Graph G Array Arc_Bounds Int source Int sink
##### Returns
 Polytope
•
matching_polytope (G) → Polytope

Matching polytope of an undirected graph.

##### Parameters
 Graph G
##### Returns
 Polytope
•
tutte_lifting (G) → Polytope

Let G be a 3-connected planar graph. If the corresponding polytope contains a triangular facet (ie. the graph contains a non- separating cycle of length 3), the client produces a realization in R3.

##### Parameters
 Graph G
##### Returns
 Polytope
•
weighted_digraph_polyhedron (encoding) → polytope::Polytope

Weighted digraph polyhedron of a directed graph with a weight function. The graph and the weight function are combined into a matrix.

##### Parameters
 Matrix encoding weighted digraph
##### Returns
 polytope::Polytope
•

### Producing a polytope from polytopes

An important way of constructing polytopes is to modify an already existing polytope.

Actually, these functions don't alter the input polytope (it is forbidden in polymake), but create a new polytope object.

Many functions can at your choice either calculate the vertex or facet coordinates, or constrain themselves on the purely combinatorial description of the resulting polytope.

•
bipyramid (P, z, z_prime)

Make a bipyramid over a pointed polyhedron. The bipyramid is the convex hull of the input polyhedron P and two points (v, z), (v, z_prime) on both sides of the affine span of P. For bounded polyhedra, the apex projections v to the affine span of P coincide with the vertex barycenter of P.

##### Parameters
 Polytope P Scalar z distance between the vertex barycenter and the first apex, default value is 1. Scalar z_prime distance between the vertex barycenter and the second apex, default value is -z.
##### Options
 Bool noc : don't compute the coordinates, purely combinatorial description is produced. Bool relabel copy the vertex labels from the original polytope, label the new vertices with "Apex" and "Apex'".
•
blending (P1, v1, P2, v2) → Polytope

Compute the blending of two polyhedra at simple vertices. This is a slightly less standard construction. A vertex is simple if its vertex figure is a simplex.

Moving a vertex v of a bounded polytope to infinity yields an unbounded polyhedron with all edges through v becoming mutually parallel rays. Do this to both input polytopes P1 and P2 at simple vertices v1 and v2, respectively. Up to an affine transformation one can assume that the orthogonal projections of P1 and P2 in direction v1 and v2, respectively, are mutually congruent.

Any bijection b from the set of edges through v1 to the edges through v2 uniquely defines a way of glueing the unbounded polyhedra to obtain a new bounded polytope, the blending with respect to b. The bijection is specified as a permutation of indices 0 1 2 etc. The default permutation is the identity.

The number of vertices of the blending is the sum of the numbers of vertices of the input polytopes minus 2. The number of facets is the sum of the numbers of facets of the input polytopes minus the dimension.

The resulting polytope is described only combinatorially.

##### Parameters
 Polytope P1 Int v1 the index of the first vertex Polytope P2 Int v2 the index of the second vertex
##### Options
 Array permutation Bool relabel copy vertex labels from the original polytope
##### Returns
 Polytope
•
cayley_embedding (P_0, P_1, t_0, t_1) → Polytope

Create a Cayley embedding of two polytopes (one of them must be pointed). The vertices of the first polytope P_0 get embedded to (t_0,0) and the vertices of the second polytope P_1 to (0,t_1).

Default values are t_0=t_1=1.

The option relabel creates an additional section VERTEX_LABELS.

##### Parameters
 Polytope P_0 the first polytope Polytope P_1 the second polytope Scalar t_0 the extra coordinate for the vertices of P_0 Scalar t_1 the extra coordinate for the vertices of P_1
##### Options
 Bool relabel
##### Returns
 Polytope
•
cayley_embedding (A) → Polytope

Create a Cayley embedding of an array (P1,...,Pm) of polytopes. All polytopes must have the same dimension, at least one of them must be pointed, and all must be defined over the same number type. Each vertex v of the i-th polytope is embedded to v|t_i e_i, where t_i is the i-th entry of the optional array t.

The option relabel creates an additional section VERTEX_LABELS.

##### Parameters
 Polytope A the input polytopes
##### Options
 Array t array of scaling factors for the Cayley embedding; defaults to the all-1 vector Bool relabel
##### Returns
 Polytope
•
cayley_polytope (P_Array) → Polytope

Construct the cayley polytope of a set of pointed lattice polytopes contained in P_Array which is the convex hull of P1×e1, ..., Pk×ek where e1, ...,ek are the standard unit vectors in Rk. In this representation the last k coordinates always add up to 1. The option proj projects onto the complement of the last coordinate.

##### Parameters
 Array P_Array an array containing the lattice polytopes P1,...,Pk
##### Options
 Bool proj
##### Returns
 Polytope
•
cells_from_subdivision (P, cells) → Polytope<Scalar>

Extract the given cells of the subdivision of a polyhedron and write their union as a new polyhedron.

##### Parameters
 Polytope P Set cells
##### Options
 Bool relabel copy the vertex labels from the original polytope
##### Returns
 Polytope
•
cell_from_subdivision (P, cell) → Polytope

Extract the given cell of the subdivision of a polyhedron and write it as a new polyhedron.

##### Parameters
 Polytope P Int cell
##### Options
 Bool relabel copy the vertex labels from the original polytope
##### Returns
 Polytope
•
conv (P_Array) → PropagatedPolytope

Construct a new polyhedron as the convex hull of the polyhedra given in P_Array.

##### Parameters
 Array P_Array
##### Returns
 PropagatedPolytope
•
dual_linear_program (P, maximize) → Polytope

Produces the dual linear program for a given linear program of the form min {cx | Ax >= b, Bx = d}. Here (A,b) are given by the FACETS (or the INEQAULITIES), and (B,d) are given by the AFFINE_HULL (or by the EQUATIONS) of the polytope P, while the objective function c comes from an LP subobject.

##### Parameters
 Polytope P = {x | Ax >= b, Bx = d} Bool maximize tells if the primal lp is a maximization problem. Default value is 0 (= minimize)
##### Returns
 Polytope
•
edge_middle (P) → Polytope

Produce the convex hull of all edge middle points of some polytope P. The polytope must be BOUNDED.

##### Parameters
 Polytope P
##### Returns
 Polytope
•
facet (P, facet) → Cone

Extract the given facet of a polyhedron and write it as a new polyhedron.

##### Parameters
 Cone P Int facet
##### Options
 Bool noc don't copy the coordinates, produce purely combinatorial description. Bool relabel copy the vertex labels from the original polytope.
##### Returns
 Cone
•
facet_to_infinity (i) → Polytope

Make an affine transformation such that the i-th facet is transformed to infinity

##### Parameters
 Int i the facet index
##### Returns
 Polytope
•
free_sum (P1, P2) → Polytope

Construct a new polyhedron as the free sum of two given bounded ones.

##### Parameters
 Polytope P1 Polytope P2
##### Returns
 Polytope
•
gc_closure (P) → Polytope

Produces the gomory-chvatal closure of a full dimensional polyhedron

##### Parameters
 Polytope P
##### Returns
 Polytope
•
integer_hull (P) → Polytope

Produces the integer hull of a polyhedron

##### Parameters
 Polytope P
##### Returns
 Polytope
•
intersection (C ...) → Cone

Construct a new polyhedron or cone as the intersection of given polyhedra and/or cones. Works only if all CONE_AMBIENT_DIM values are equal. If the input contains both cones and polytopes, the output will be a polytope.

##### Parameters
 Cone C ... polyhedra and cones to be intersected
##### Returns
 Cone
•
join_polytopes (P1, P2) → Polytope

Construct a new polyhedron as the join of two given bounded ones.

##### Parameters
 Polytope P1 Polytope P2
##### Returns
 Polytope
•
lattice_bipyramid (P, v, v_prime, z, z_prime) → Polytope

Make a lattice bipyramid over a polyhedron. The bipyramid is the convex hull of the input polyhedron P and two points (v, z), (v_prime, z_prime) on both sides of the affine span of P.

##### Parameters
 Polytope P Vector v basis point for the first apex Vector v_prime basis for the second apex If v_prime is omitted, v will be used for both apices. If both v and v_prime are omitted, it tries to find two vertices which don't lie in a common facet. If no such vertices can be found or P is a simplex, it uses an interior lattice point as both v and v_prime. Rational z height for the first apex, default value is 1 Rational z_prime height for the second apex, default value is -z
##### Options
 Bool relabel copy the vertex labels from the original polytope, label the new vertices with "Apex" and "Apex'".
##### Returns
 Polytope
•
lattice_pyramid (P, z, v) → Polytope

Make a lattice pyramid over a polyhedron. The pyramid is the convex hull of the input polyhedron P and a point v outside the affine span of P.

##### Parameters
 Polytope P Rational z the height for the apex (v,z), default value is 1. Vector v the lattice point to use as apex, default is the first vertex of P.
##### Options
 Bool relabel copy the original vertex labels, label the new top vertex with "Apex".
##### Returns
 Polytope
•
lawrence (P) → Cone

Create the Lawrence polytope Lambda(P) corresponding to P. If V is the matrix whose rows are the n vertices of P, then the vertices of Lambda(P) are the rows of the matrix ( V I_n ) ( 0_n I_n ). Lambda(P) has the property that Gale(Lambda(P)) = Gale(P) union -Gale(P).

##### Parameters
 Cone P an input cone or polytope
##### Returns
 Cone the Lawrence cone or polytope to P
•
make_totally_dual_integral (P) → Polytope

Produces a polyhedron with an totally dual integral inequality formulation of a full dimensional polyhedron

##### Parameters
 Polytope P
##### Returns
 Polytope
•
mapping_polytope (P1, P2) → Polytope

Construct a new polytope as the mapping polytope of two polytopes P1 and P2. The mapping polytope is the set of all affine maps from Rp to Rq, that map P1 into P2.

The label of a new facet corresponding to v1 and h1 will have the form "v1*h1".

##### Parameters
 Polytope P1 Polytope P2
##### Options
 Bool relabel
##### Returns
 Polytope
•
minkowski_sum (P1, P2) → Polytope

Produces the Minkowski sum of P1 and P2.

##### Parameters
 Polytope P1 Polytope P2
##### Returns
 Polytope
•
minkowski_sum (lambda, P1, mu, P2) → Polytope

Produces the polytope lambda*P1+mu*P2, where * and + are scalar multiplication and Minkowski addition, respectively.

##### Parameters
 Scalar lambda Polytope P1 Scalar mu Polytope P2
##### Returns
 Polytope
•
minkowski_sum_fukuda <Scalar> (summands) → Polytope<Scalar>

Computes the (VERTICES of the) Minkowski sum of a list of polytopes using the algorithm by Fukuda described in

Komei Fukuda, From the zonotope construction to the Minkowski addition of convex polytopes, J. Symbolic Comput., 38(4):1261-1272, 2004.
##### Type Parameters
 Scalar
##### Parameters
 Array> summands
##### Returns
 Polytope
•
mixed_integer_hull (P, int_coords) → Polytope

Produces the mixed integer hull of a polyhedron

##### Parameters
 Polytope P Array int_coords the coordinates to be integral;
##### Returns
 Polytope
•
pointed_part (P) → Polytope

Produces the pointed part of a polyhedron

##### Parameters
 Polytope P
##### Returns
 Polytope
•
prism (P, z1, z2) → Polytope

Make a prism over a pointed polyhedron. The prism is the product of the input polytope P and the interval [z1, z2].

##### Parameters
 Polytope P the input polytope Scalar z1 the left endpoint of the interval; default value: -1 Scalar z2 the right endpoint of the interval; default value: -z1
##### Options
 Bool noc only combinatorial information is handled Bool relabel creates an additional section VERTEX_LABELS; the bottom facet vertices get the labels from the original polytope; the labels of their clones in the top facet get a tick (') appended.
##### Returns
 Polytope
•
product (P1, P2) → Polytope

Construct a new polytope as the product of two given polytopes P1 and P2.

##### Parameters
 Polytope P1 Polytope P2
##### Options
 Bool noc only combinatorial information is handled Bool relabel creates an additional section VERTEX_LABELS; the label of a new vertex corresponding to v1 ⊕ v2 will have the form LABEL_1*LABEL_2.
##### Returns
 Polytope
•
projection (P, indices) → Cone

Orthogonally project a pointed polyhedron to a coordinate subspace.

The subspace the polyhedron P is projected on is given by indices in the set indices. The option revert inverts the coordinate list. The client scans for all coordinate sections and produces proper output from each. If a description in terms of inequalities is found, the client performs Fourier-Motzkin elimination unless the nofm option is set. Setting the nofm option is useful if the corank of the projection is large; in this case the number of inequalities produced grows quickly.

##### Parameters
 Cone P Array indices
##### Options
 Bool revert inverts the coordinate list Bool nofm suppresses Fourier-Motzkin elimination
##### Returns
 Cone
•
projection_full (P) → Cone

Orthogonally project a polyhedron to a coordinate subspace such that redundant columns are omitted, i.e., the projection becomes full-dimensional without changing the combinatorial type. The client scans for all coordinate sections and produces proper output from each. If a description in terms of inequalities is found, the client performs Fourier-Motzkin elimination unless the nofm option is set. Setting the nofm option is useful if the corank of the projection is large; in this case the number of inequalities produced grows quickly.

##### Parameters
 Cone P
##### Options
 Bool nofm suppresses Fourier-Motzkin elimination Bool relabel copy labels to projection
##### Returns
 Cone
•
pyramid (P, z) → Polytope

Make a pyramid over a polyhedron. The pyramid is the convex hull of the input polyhedron P and a point v outside the affine span of P. For bounded polyhedra, the projection of v to the affine span of P coincides with the vertex barycenter of P.

##### Parameters
 Polytope P Scalar z is the distance between the vertex barycenter and v, default value is 1.
##### Options
 Bool noc don't compute new coordinates, produce purely combinatorial description. Bool relabel copy vertex labels from the original polytope, label the new top vertex with "Apex".
##### Returns
 Polytope
•
rand_inner_points (P, n) → Polytope

Produce a polytope with n random points from the input polytope P. Each generated point is a convex linear combination of the input vertices with uniformly distributed random coefficients. Thus, the output points can't in general be expected to be distributed uniformly within the input polytope; cf. unirand for this. The polytope must be BOUNDED.

##### Parameters
 Polytope P the input polytope Int n the number of random points
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
rand_vert (V, n) → Matrix

Selects n random vertices from the set of vertices V. This can be used to produce random polytopes which are neither simple nor simplicial as follows: First produce a simple polytope (for instance at random, by using rand_sphere, rand, or unirand). Then use this client to choose among the vertices at random. Generalizes random 0/1-polytopes.

##### Parameters
 Matrix V the vertices of a polytope Int n the number of random points
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Matrix
•
spherize (P) → Polytope

Project all vertices of a polyhedron P on the unit sphere. P must be CENTERED and BOUNDED.

##### Parameters
 Polytope P
##### Returns
 Polytope
•
stack (P, stack_facets) → Polytope

Stack a (simplicial or cubical) polytope over one or more of its facets.

For each facet of the polytope P specified in stack_facets, the barycenter of its vertices is lifted along the normal vector of the facet. In the simplicial case, this point is directly added to the vertex set, thus building a pyramid over the facet. In the cubical case, this pyramid is truncated by a hyperplane parallel to the original facet at its half height. This way, the property of being simplicial or cubical is preserved in both cases.

The option lift controls the exact coordinates of the new vertices. It should be a rational number between 0 and 1, which expresses the ratio of the distance between the new vertex and the stacked facet, to the maximal possible distance. When lift=0, the new vertex would lie on the original facet. lift=1 corresponds to the opposite extremal case, where the new vertex hit the hyperplane of some neighbor facet. As an additional restriction, the new vertex can't lie further from the facet as the vertex barycenter of the whole polytope. Alternatively, the option noc (no coordinates) can be specified to produce a pure combinatorial description of the resulting polytope.

##### Parameters
 Polytope P Set stack_facets the facets to be stacked; A single facet to be stacked is specified by its number. Several facets can be passed in a Set or in an anonymous array of indices: [n1,n2,...] Special keyword All means that all factes are to be stacked.
##### Options
 Rational lift controls the exact coordinates of the new vertices; rational number between 0 and 1; default value: 1/2 Bool noc produces a pure combinatorial description (in contrast to lift) Bool relabel creates an additional section VERTEX_LABELS; New vertices get labels 'f(FACET_LABEL)' in the simplicial case, and 'f(FACET_LABEL)-NEIGHBOR_VERTEX_LABEL' in the cubical case.
##### Returns
 Polytope
•
stellar_all_faces (P, d) → Polytope

Perform a stellar subdivision of all proper faces, starting with the facets.

Parameter d specifies the lowest dimension of the faces to be divided. It can also be negative, then treated as the co-dimension. Default is 1, that is, the edges of the polytope.

##### Parameters
 Polytope P , must be bounded Int d the lowest dimension of the faces to be divided; negative values: treated as the co-dimension; default value: 1.
##### Returns
 Polytope
•
stellar_indep_faces (P, in_faces) → Polytope

Perform a stellar subdivision of the faces in_faces of a polyhedron P.

The faces must have the following property: The open vertex stars of any pair of faces must be disjoint.

##### Parameters
 Polytope P , must be bounded Array> in_faces
##### Returns
 Polytope
•
tensor (P1, P2) → Polytope

Construct a new polytope as the convex hull of the tensor products of the vertices of two polytopes P1 and P2. Unbounded polyhedra are not allowed. Does depend on the vertex coordinates of the input.

##### Parameters
 Polytope P1 Polytope P2
##### Returns
 Polytope
•
truncation (P, trunc_vertices) → Polytope

Cut off one or more vertices of a polyhedron.

The exact location of the cutting hyperplane(s) can be controlled by the option cutoff, a rational number between 0 and 1. When cutoff=0, the hyperplane would go through the chosen vertex, thus cutting off nothing. When cutoff=1, the hyperplane touches the nearest neighbor vertex of a polyhedron.

Alternatively, the option noc (no coordinates) can be specified to produce a pure combinatorial description of the resulting polytope, which corresponds to the cutoff factor 1/2.

##### Parameters
 Polytope P Set trunc_vertices the vertex/vertices to be cut off; A single vertex to be cut off is specified by its number. Several vertices can be passed in a Set or in an anonymous array of indices: [n1,n2,...] Special keyword All means that all vertices are to be cut off.
##### Options
 Scalar cutoff controls the exact location of the cutting hyperplane(s); rational number between 0 and 1; default value: 1/2 Bool noc produces a pure combinatorial description (in contrast to cutoff) Bool relabel creates an additional section VERTEX_LABELS; New vertices get labels of the form 'LABEL1-LABEL2', where LABEL1 is the original label of the truncated vertex, and LABEL2 is the original label of its neighbor.
##### Returns
 Polytope
•
unirand (Polytope, n) → Polytope

Produce a polytope with n random points that are uniformly distributed within the given polytope P. P must be bounded and full-dimensional.

##### Parameters
 P Polytope Int n the number of random points
##### Options
 Bool boundary forces the points to lie on the boundary of the given polytope Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
vertex_figure (p, n) → Polytope

Construct the vertex figure of the vertex n of a polyhedron. The vertex figure is dual to a facet of the dual polytope.

##### Parameters
 Polytope p Int n number of the chosen vertex
##### Options
 Scalar cutoff controls the exact location of the cutting hyperplane. It should lie between 0 and 1. Value 0 would let the hyperplane go through the chosen vertex, thus degenerating the vertex figure to a single point. Value 1 would let the hyperplane touch the nearest neighbor vertex of a polyhedron. Default value is 1/2. Bool noc skip the coordinates computation, producing a pure combinatorial description. Bool relabel inherit vertex labels from the corresponding neighbor vertices of the original polytope.
##### Returns
 Polytope
•
wedge (P, facet, z, z_prime) → Polytope

Make a wedge from a polytope over the given facet. The polytope must be bounded. The inclination of the bottom and top side facet is controlled by z and z_prime, which are heights of the projection of the old vertex barycenter on the bottom and top side facet respectively.

##### Parameters
 Polytope P , must be bounded Int facet the `cutting edge'. Scalar z default value is 0. Scalar z_prime default value is -z, or 1 if z==0.
##### Options
 Bool noc don't compute coordinates, pure combinatorial description is produced. Bool relabel create vertex labels: The bottom facet vertices obtain the labels from the original polytope; the labels of their clones in the top facet get a tick (') appended.
##### Returns
 Polytope
•
wreath (P1, P2) → Polytope

Construct a new polytope as the wreath product of two input polytopes P1, P2. P1 and P2 have to be BOUNDED.

##### Parameters
 Polytope P1 Polytope P2
##### Options
 Bool dual invokes the computation of the dual wreath product Bool relabel creates an additional section VERTEX_LABELS; the label of a new vertex corresponding to v1 ⊕ v2 will have the form LABEL_1*LABEL_2.
##### Returns
 Polytope
•

### Producing a polytope from scratch

With these clients you can create polytopes belonging to various parameterized families which occur frequently in polytope theory, as well as random polytopes with different models of randomness.

•
associahedron (d) → Polytope

Produce a d-dimensional associahedron (or Stasheff polytope). We use the facet description given in Ziegler's book on polytopes, section 9.2.

##### Parameters
 Int d the dimension
##### Returns
 Polytope
•
binary_markov_graph (observation) → PropagatedPolytope

Defines a very simple graph for a polytope propagation related to a Hidden Markov Model. The propagated polytope is always a polygon. For a detailed description see

M. Joswig: Polytope propagation, in: Algebraic statistics and computational biology
by L. Pachter and B. Sturmfels (eds.), Cambridge, 2005.
##### Parameters
 Array observation
##### Returns
 PropagatedPolytope
•
binary_markov_graph (observation)

##### Parameters
 String observation encoded as a string of "0" and "1".
•
birkhoff (n, even) → Polytope

Constructs the Birkhoff polytope of dimension n2 (also called the assignment polytope, the polytope of doubly stochastic matrices, or the perfect matching polytope).

##### Parameters
 Int n Bool even
##### Returns
 Polytope
•
constructible_n_gon () → Polytope

Create exact constructible regular polygon.

##### Returns
 Polytope
•
cross <Scalar> (d, scale) → Polytope<Scalar>

Produce a d-dimensional cross polytope. Regular polytope corresponding to the Coxeter group of type Bd-1 = Cd-1.

All coordinates are +/- scale or 0.

##### Type Parameters
 Scalar Coordinate type of the resulting polytope. Unless specified explicitly, deduced from the type of bound values, defaults to Rational.
##### Parameters
 Int d the dimension Scalar scale the absolute value of each non-zero vertex coordinate. Needs to be positive. The default value is 1.
##### Options
 Bool group add a symmetry group description to the resulting polytope
##### Returns
 Polytope
•
cube <Scalar> (d, x_up, x_low) → Polytope<Scalar>

Produce a d-dimensional cube. Regular polytope corresponding to the Coxeter group of type Bd-1 = Cd-1.

The bounding hyperplanes are xi <= x_up and xi >= x_low.

##### Type Parameters
 Scalar Coordinate type of the resulting polytope. Unless specified explicitly, deduced from the type of bound values, defaults to Rational.
##### Parameters
 Int d the dimension Scalar x_up upper bound in each dimension Scalar x_low lower bound in each dimension
##### Options
 Bool group add a symmetry group description to the resulting polytope
##### Returns
 Polytope
•
cuboctahedron () → Polytope

Create cuboctahedron. An Archimedean solid.

##### Returns
 Polytope
•
cyclic (d, n) → Polytope

Produce a d-dimensional cyclic polytope with n points. Prototypical example of a neighborly polytope. Combinatorics completely known due to Gale's evenness criterion. Coordinates are chosen on the (spherical) moment curve at integer steps from start, or 0 if unspecified. If spherical is true the vertices lie on the sphere with center (1/2,0,...,0) and radius 1/2. In this case (the necessarily positive) parameter start defaults to 1.

##### Parameters
 Int d the dimension Int n the number of points
##### Options
 Int start defaults to 0 (or to 1 if spherical) Bool spherical defaults to false
##### Returns
 Polytope
•
cyclic_caratheodory (d, n) → Polytope

Produce a d-dimensional cyclic polytope with n points. Prototypical example of a neighborly polytope. Combinatorics completely known due to Gale's evenness criterion. Coordinates are chosen on the trigonometric moment curve.

##### Parameters
 Int d the dimension Int n the number of points
##### Returns
 Polytope
•
delpezzo (d, scale) → Polytope<Scalar>

Produce a d-dimensional del-Pezzo polytope. Del-Pezzo polytope which is the convex hull of the cross polytope together with the all-ones and minus all-ones vector.

All coordinates are +/- scale or 0.

##### Parameters
 Int d the dimension Scalar scale the absolute value of each non-zero vertex coordinate. Needs to be positive. The default value is 1.
##### Returns
 Polytope
•
dodecahedron () → Polytope

Create exact regular dodecahedron in Q(sqrt{5}). A Platonic solid.

##### Returns
 Polytope
•
dwarfed_cube (d) → Polytope

Produce a d-dimensional dwarfed cube.

##### Parameters
 Int d the dimension
##### Returns
 Polytope
•
dwarfed_product_polygons (d, s) → Polytope

Produce a d-dimensional dwarfed product of polygons of size s.

##### Parameters
 Int d the dimension Int s the size
##### Returns
 Polytope
•
explicit_zonotope (zones) → Polytope

Produce the POINTS of a zonotope as the iterated Minkowski sum of all intervals [-x,x], where x ranges over the rows of the input matrix zones.

##### Parameters
 Matrix zones the input vectors
##### Options
 Bool rows_are_points the rows of the input matrix represent affine points(true, default) or linear vectors(false)
##### Returns
 Polytope
•
fano_simplex (d) → Polytope

Produce a fano d-simplex.

##### Parameters
 Int d the dimension
##### Options
 Bool group
##### Returns
 Polytope
•
goldfarb (d, e, g) → Polytope

Produces a d-dimensional Goldfarb cube if e<1/2 and g<=e/4. The Goldfarb cube is a combinatorial cube and yields a bad example for the Simplex Algorithm using the Shadow Vertex Pivoting Strategy. Here we use the description as a deformed product due to Amenta and Ziegler. For e<1/2 and g=0 we obtain the Klee-Minty cubes.

##### Parameters
 Int d the dimension Rational e Rational g
##### Returns
 Polytope
•
hypersimplex (k, d) → Polytope

Produce the hypersimplex Δ(k,d), that is the the convex hull of all 0/1-vector in Rd with exactly k 1s. Note that the output is never full-dimensional.

##### Parameters
 Int k number of 1s Int d ambient dimension
##### Options
 Bool group
##### Returns
 Polytope
•
hypertruncated_cube <Scalar> (d, k, lambda) → Polytope<Scalar>

Produce a d-dimensional hypertruncated cube. With symmetric linear objective function (0,1,1,...,1).

##### Type Parameters
 Scalar Coordinate type of the resulting polytope. Unless specified explicitly, deduced from the type of bound values, defaults to Rational.
##### Parameters
 Int d the dimension Scalar k cutoff parameter Scalar lambda scaling of extra vertex
##### Returns
 Polytope
•
icosahedron () → Polytope

Create exact regular icosahedron in Q(sqrt{5}). A Platonic solid.

##### Returns
 Polytope
•
icosidodecahedron () → Polytope

Create exact icosidodecahedron in Q(sqrt{5}). An Archimedean solid.

##### Returns
 Polytope
•
knapsack (b) → Polytope

Produce a knapsack polytope defined by one linear inequality (and non-negativity constraints).

##### Parameters
 Vector b linear inequality
##### Returns
 Polytope
•
k_cyclic (n, s) → Polytope

Produce a (rounded) 2*k-dimensional k-cyclic polytope with n points, where k is the length of the input vector s. Special cases are the bicyclic (k=2) and tricyclic (k=3) polytopes. Only possible in even dimensions.

The parameters s_i can be specified as integer, floating-point, or rational numbers. The coordinates of the i-th point are taken as follows:

cos(s_1 * 2πi/n),
sin(s_1 * 2πi/n),
...
cos(s_k * 2πi/n),
sin(s_k * 2πi/n)

Warning: Some of the k-cyclic polytopes are not simplicial. Since the components are rounded, this function might output a polytope which is not a k-cyclic polytope!

P. Schuchert: "Matroid-Polytope und Einbettungen kombinatorischer Mannigfaltigkeiten",
Z. Smilansky: "Bi-cyclic 4-polytopes",
Isr. J. Math. 70, 1990, 82-92
##### Parameters
 Int n Vector s s=(s_1,...,s_k)
##### Returns
 Polytope
•
max_GC_rank (d) → Polytope

Produce a d-dimensional polytope of maximal Gomory-Chvatal rank Omega(d/log(d)), integrally infeasible. With symmetric linear objective function (0,1,1..,1). Construction due to Pokutta and Schulz.

##### Parameters
 Int d the dimension
##### Returns
 Polytope
•
multiplex (d, n) → Polytope

Produce a combinatorial description of a multiplex with parameters d and n. This yields a self-dual d-dimensional polytope with n+1 vertices.

They are introduced by

T. Bisztriczky,
On a class of generalized simplices, Mathematika 43:27-285, 1996,

M.M. Bayer, A.M. Bruening, and J.D. Stewart,
A combinatorial study of multiplexes and ordinary polytopes,
Discrete Comput. Geom. 27(1):49--63, 2002.
##### Parameters
 Int d the dimension Int n
##### Returns
 Polytope
•
neighborly_cubical (d, n) → Polytope

Produce the combinatorial description of a neighborly cubical polytope. The facets are labelled in oriented matroid notation as in the cubical Gale evenness criterion.

See Joswig and Ziegler, Discr. Comput. Geom. 24:315-344 (2000).
##### Parameters
 Int d dimension of the polytope Int n dimension of the equivalent cube
##### Returns
 Polytope
•
newton (p) → LatticePolytope

Produce the Newton polytope of a polynomial p.

##### Parameters
 Polynomial p
##### Returns
 LatticePolytope
•
n_gon (n, r) → Polytope

Produce a regular n-gon. All vertices lie on a circle of radius r. The radius defaults to 1.

##### Parameters
 Int n the number of vertices Rational r the radius
##### Options
 Bool group
##### Returns
 Polytope
•
perles_irrational_8_polytope () → Polytope

Create an 8-dimensional polytope without rational realizations due to Perles

##### Returns
 Polytope
•
permutahedron (d) → Polytope

Produce a d-dimensional permutahedron. The vertices correspond to the elements of the symmetric group of degree d+1.

##### Parameters
 Int d the dimension
##### Options
 Bool group
##### Returns
 Polytope
•
pile (sizes) → Polytope

Produce a (d+1)-dimensional polytope from a pile of cubes. Start with a d-dimensional pile of cubes. Take a generic convex function to lift this polytopal complex to the boundary of a (d+1)-polytope.

##### Parameters
 Vector sizes a vector (s1,...,sd, where si specifies the number of boxes in the i-th dimension.
##### Returns
 Polytope
•

Produce the list of all five Platonic solids with ascending number of vertices.

##### Returns
 Array>
•
pseudo_delpezzo (d, scale) → Polytope<Scalar>

Produce a d-dimensional del-Pezzo polytope. Del-Pezzo polytope which is the convex hull of the cross polytope together with the all-ones and minus all-ones vector.

All coordinates are +/- scale or 0.

##### Parameters
 Int d the dimension Scalar scale the absolute value of each non-zero vertex coordinate. Needs to be positive. The default value is 1.
##### Returns
 Polytope
•
rand01 (d, n) → Polytope

Produce a d-dimensional 0/1-polytope with n random vertices. Uniform distribution.

##### Parameters
 Int d the dimension Int n the number of random vertices
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
rand_box (d, n, b) → Polytope

Computes the convex hull of n points sampled uniformly at random from the integer points in the cube [0,b]d.

##### Parameters
 Int d the dimension of the box Int n the number of random points Int b the size of the box
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
rand_cyclic (d, n) → Polytope

Computes a random instance of a cyclic polytope of dimension d on n vertices by randomly generating a Gale diagram whose cocircuits have alternating signs.

##### Parameters
 Int d the dimension Int n the number of vertices
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
rand_metric <Scalar> (n) → Matrix

Produce an n-point metric with random distances. The values are uniformily distributed in [1,2].

##### Type Parameters
 Scalar element type of the result matrix
##### Parameters
 Int n
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Matrix
•
rand_metric_int <Scalar> (n) → Matrix

Produce an n-point metric with random distances. The values are uniformily distributed in [1,2].

##### Type Parameters
 Scalar element type of the result matrix
##### Parameters
 Int n
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Matrix
•
rand_sphere (d, n) → Polytope

Produce a d-dimensional polytope with n random vertices uniformly distributed on the unit sphere.

##### Parameters
 Int d the dimension Int n the number of random vertices
##### Options
 Int seed controls the outcome of the random number generator; fixing a seed number guarantees the same outcome.
##### Returns
 Polytope
•
regular_120_cell () → Polytope

Create exact regular 120-cell in Q(sqrt{5}).

##### Returns
 Polytope
•
regular_24_cell () → Polytope

Create regular 24-cell.

##### Returns
 Polytope
•
regular_600_cell () → Polytope

Create exact regular 600-cell in Q(sqrt{5}).

##### Returns
 Polytope
•
regular_simplex (d) → Polytope

Produce a regular d-simplex embedded in R^d with edge length sqrt(2).

##### Parameters
 Int d the dimension
##### Options
 Bool group
##### Returns
 Polytope
•
rhombicosidodecahedron () → Polytope

Create exact rhombicosidodecahedron in Q(sqrt{5}). An Archimedean solid.

##### Returns
 Polytope
•

Produce a polytope of constrained expansions in dimension l according to

Rote, Santos, and Streinu: Expansive motions and the polytope of pointed pseudo-triangulations.
Discrete and computational geometry, 699--736, Algorithms Combin., 25, Springer, Berlin, 2003.
##### Parameters
 Int l ambient dimension
##### Returns
 Polytope
•
signed_permutahedron (d) → Polytope

Produce a d-dimensional signed permutahedron.

##### Parameters
 Int d the dimension
##### Returns
 Polytope
•
simplex (d, scale) → Polytope

Produce the standard d-simplex. Combinatorially equivalent to a regular polytope corresponding to the Coxeter group of type Ad-1. Optionally, the simplex can be scaled by the parameter scale.

##### Parameters
 Int d the dimension Scalar scale default value: 1
##### Options
 Bool group
##### Returns
 Polytope
•
simple_roots_type_A (index) → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type A Indices are taken w.r.t. the Dynkin diagram 0 ---- 1 ---- ... ---- n-1 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length sqrt{2}.

##### Parameters
 Int index of the arrangement (3, 4, etc)
##### Returns
 SparseMatrix
•
simple_roots_type_B (index) → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type B Indices are taken w.r.t. the Dynkin diagram 0 ---- 1 ---- ... ---- n-2 --(4)--> n-1 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length sqrt{2}.

##### Parameters
 Int index of the arrangement (3, 4, etc)
##### Returns
 SparseMatrix
•
simple_roots_type_C (index) → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type C Indices are taken w.r.t. the Dynkin diagram 0 ---- 1 ---- ... ---- n-2 <--(4)-- n-1 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length sqrt{2}.

##### Parameters
 Int index of the arrangement (3, 4, etc)
##### Returns
 SparseMatrix
•
simple_roots_type_D (index) → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type D Indices are taken w.r.t. the Dynkin diagram n-2 / 0 - 1 - ... - n-3

n-1 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length sqrt{2}.

##### Parameters
 Int index of the arrangement (3, 4, etc)
##### Returns
 SparseMatrix
•
simple_roots_type_E6 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type E6 Indices are taken w.r.t. the Dynkin diagram 3 | | 0 ---- 1 ---- 2 ---- 4 ---- 5 Note that the roots lie at infinity to facilitate reflecting in them.

##### Returns
 SparseMatrix
•
simple_roots_type_E7 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type E7 Indices are taken w.r.t. the Dynkin diagram 4 | | 0 ---- 1 ---- 2 ---- 3 ---- 5 ---- 6 Note that the roots lie at infinity to facilitate reflecting in them.

##### Returns
 SparseMatrix
•
simple_roots_type_E8 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type E8 Indices are taken w.r.t. the Dynkin diagram 5 | | 0 ---- 1 ---- 2 ---- 3 ---- 4 ---- 6 ---- 7 Note that the roots lie at infinity to facilitate reflecting in them.

##### Returns
 SparseMatrix
•
simple_roots_type_F4 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type F4 Indices are taken w.r.t. the Dynkin diagram 0 ---- 1 --(4)--> 2 ---- 3

##### Returns
 SparseMatrix
•
simple_roots_type_G2 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type G2 Indices are taken w.r.t. the Dynkin diagram 0 <--(6)-- 1

##### Returns
 SparseMatrix
•
simple_roots_type_H3 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type H3 Indices are taken w.r.t. the Dynkin diagram 0 --(5)-- 1 ---- 2 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length 2

##### Returns
 SparseMatrix
•
simple_roots_type_H4 () → SparseMatrix

Produce the simple roots of the Coxeter arrangement of type H4 Indices are taken w.r.t. the Dynkin diagram 0 --(5)-- 1 ---- 2 ---- 3 Note that the roots lie at infinity to facilitate reflecting in them, and are normalized to length sqrt{2}

##### Returns
 SparseMatrix
•
stable_set (G) → Polytope

Produces the stable set polytope from an undirected graph G=(V,E). The stable set Polytope has the following inequalities: x_i + x_j <= 1 forall {i,j} in E x_i >= 0 forall i in V x_i <= 1 forall i in V with deg(i)=0

##### Parameters
 Graph G
##### Returns
 Polytope
•
tetrahedron () → Polytope

Create regular tetrahedron. A Platonic solid.

##### Returns
 Polytope
•
transportation (r, c) → Polytope

Produce the transportation polytope from two vectors r of length m and c of length n, i.e. all positive m×n Matrizes with row sums equal to r and column sums equal to c.

##### Parameters
 Vector r Vector c
##### Returns
 Polytope
•
truncated_cuboctahedron () → SymmetricPolytope

Create truncated cuboctahedron. An Archimedean solid. This is actually a misnomer. The actual truncation of a cuboctahedron is obtained as wythoff(B3,range(0,2)), which is rational and normally equivalent to this construction.

Contained in extension `bundled:group`.
##### Returns
 SymmetricPolytope
•
truncated_dodecahedron () → Polytope

Create exact truncated dodecahedron in Q(sqrt{5}). An Archimedean solid.

##### Returns
 Polytope
•
truncated_icosahedron () → Polytope

Create exact truncated icosahedron in Q(sqrt{5}). An Archimedean solid. Also known as the soccer ball.

##### Returns
 Polytope
•
truncated_icosidodecahedron () → Polytope

Create exact truncated icosidodecahedron in Q(sqrt{5}). An Archimedean solid.

##### Returns
 Polytope
•
truncated_octahedron () → Polytope

Create truncated octahedron. An Archimedean solid. Also known as the 3-permutahedron.

##### Returns
 Polytope
•
upper_bound_theorem (d, n) → Polytope

Produce combinatorial data common to all simplicial d-polytopes with n vertices with the maximal number of facets as given by McMullen's Upper-Bound-Theorem. Essentially this lets you read off all possible entries of the H_VECTOR and the F_VECTOR.

##### Parameters
 Int d the dimension Int n the number of points
##### Returns
 Polytope
•
wythoff (type, rings) → Polytope

Produce the orbit polytope of a point under a Coxeter arrangement with exact coordinates, possibly in a qudratic extension field of the rationals

##### Parameters
 String type single letter followed by rank representing the type of the arrangement Set rings indices of the hyperplanes corresponding to simple roots of the arrangement that the initial point should NOT lie on
##### Returns
 Polytope
•
zonotope <Scalar> (M) → Polytope<Scalar>

Create a zonotope from a matrix whose rows are input points or vectors. This method merely defines a Polytope object with the property ZONOTOPE_INPUT_POINTS.

##### Type Parameters
 Scalar target coordinate type
##### Parameters
 Matrix M input points or vectors
##### Options
 Bool rows_are_points true if M are points instead of vectors; default true
##### Returns
 Polytope the zonotope generated by the input points or vectors
•
zonotope_vertices_fukuda <Scalar> (M) → Polytope<Scalar>

Create a zonotope from a matrix whose rows are input points or vectors.

##### Type Parameters
 Scalar
##### Parameters
 Matrix M
##### Options
Bool centered_zonotope default 1
##### Returns
 Polytope
•

### Producing other objects

Functions producing big objects which are not contained in application polytope.

•
coxeter_group (type) → group::GroupOfPolytope

Produces the Coxeter group of type type. The Dynkin diagrams of the different types can be found in the description of the clients simple_roots_type_*.

##### Parameters
 String type the type of the Coxeter group
##### Returns
 group::GroupOfPolytope the Coxeter group of type type
•
crosscut_complex (p) → SimplicialComplex

Produce the crosscut complex of the boundary of a polytope.

##### Parameters
 Polytope p
##### Returns
 SimplicialComplex
•

### Quotient spaces

Topologic cell complexes defined as quotients over polytopes modulo a discrete group.

•
cs_quotient (P)

For a centrally symmetric polytope, divide out the central symmetry, i.e, identify diametrically opposite faces.

Contained in extension `bundled:group`.
##### Parameters
 Polytope P , centrally symmetric
•
cylinder_2 () → Polytope

Return a 2-dimensional cylinder obtained by identifying two opposite sides of a square.

Contained in extension `bundled:group`.
##### Returns
 Polytope
•
quarter_turn_manifold () → Polytope

Return the 3-dimensional Euclidean manifold obtained by identifying opposite faces of a 3-dimensional cube by a quarter turn. After identification, two classes of vertices remain.

Contained in extension `bundled:group`.
##### Returns
 Polytope
•
quotient_space_faces (P)

Find the faces of the quotient space represented by P and its IDENTIFICATION_GROUP.

Contained in extension `bundled:group`.
##### Parameters
 Polytope P
•
write_quotient_space_simplexity_ilp ()

outputs a linear program whose optimal value is a lower bound for the number of simplices necessary to triangulate the polytope in such a way that its symmetries respect the triangulation of the boundary.

Contained in extension `bundled:group`.
•

### Symmetry

These functions capture information of the object that is concerned with the action of permutation groups.

•
alternating_group (degree, domain) → group::GroupOfPolytope

Contained in extension `bundled:group`.
##### Parameters
 Int degree Int domain of the polytope's symmetry group
##### Returns
 group::GroupOfPolytope
•
combinatorial_symmetries (poly, on_vertices) → group::GroupOfPolytope

Compute the combinatorial symmetries (i.e., automorphisms of the face lattice) of a given polytope poly. If on_vertices is set to 1, the function returns a GroupOfPolytope which acts on the vertices. If on_vertices is set to any other number, the function returns a GroupOfPolytope which acts on the facets of the polytope. If on_vertices is unspecified, both groups are returned.

##### Parameters
 Polytope poly Int on_vertices specifies whether the returned group should act on vertices (1) or on facets (2)
##### Returns
 group::GroupOfPolytope the combinatorial symmetry group acting on the vertices or the facets depending on on_vertices or (group::GroupOfPolytope, group::GroupOfPolytope) = (group on vertices, group on facets) if //on_vertices is undefined
•
convert_coord_action (group, mat, dom_out) → group::Group

Converts the generators of a group acting on coordinates to generators of the corresponding group which acts on the rows of the given matrix mat. The parameter dom_out specifies whether mat describes vertices or facets.

Contained in extension `bundled:group`.
##### Parameters
 group::Group group input group acting on coordinates Matrix mat vertices or facets of a polytope Int dom_out OnRays(1) or OnFacets(2)
##### Options
 String name an optional name for the output group
##### Returns
 group::Group a new group object with the generators induced on the new domain
•
convert_group_domain (group, VIF) → group::Group

Converts the generators of the input group from the domain onRays to generators on the domain onFacets, and vice versa.

Contained in extension `bundled:group`.
##### Parameters
 group::Group group IncidenceMatrix VIF the vertex-facet incidence matrix of the cone or polytope
##### Options
 String name an optional name for the output group
##### Returns
 group::Group a new group object with the generators induced on the new domain
•
cyclic_group (degree, domain) → group::GroupOfPolytope

Contained in extension `bundled:group`.
##### Parameters
 Int degree Int domain of the polytope's symmetry group
##### Returns
 group::GroupOfPolytope
•
group_from_cyclic_notation0 (group, domain) → group::GroupOfPolytope

Constructs a group from a string with generators in cyclic notation. All numbers in the string are 0-based. Example: "(0,2)(1,3)"

Contained in extension `bundled:group`.
##### Parameters
 String group generators in cyclic notation Int domain of the polytope symmetry group
##### Returns
 group::GroupOfPolytope
•
group_from_cyclic_notation1 (group, domain) → group::GroupOfPolytope

Constructs a group from a string with generators in cyclic notation. All numbers in the string are 1-based. Example: "(1,3)(2,4)"

Contained in extension `bundled:group`.
##### Parameters
 String group generators in cyclic notation Int domain of the polytope symmetry group
##### Returns
 group::GroupOfPolytope
•
lattice_automorphisms_smooth_polytope (P) → Array<Array<Int>>

Returns a generating set for the lattice automorphism group of a smooth polytope P by comparing lattice distances between vertices and facets.

##### Parameters
 LatticePolytope P the given polytope
##### Returns
 Array> the generating set for the lattice automorphism group
•
lex_min_representative (G, S) → Set

Computes the lexicographically smallest representative of a given set with respect to a group

Contained in extension `bundled:group`.
##### Parameters
 Group G a symmetry group Set S a set
##### Returns
 Set the lex-min representative of S
•
linear_symmetries (c, dual) → group::GroupOfCone

Computes the linear symmetries of a given polytope p via 'sympol'. If the input is a cone, it may compute only a subgroup of the linear symmetry group.

Contained in extension `bundled:group`.
##### Parameters
 Cone c the cone (or polytope) whose linear symmetry group is to be computed Bool dual true if group action on vertices, false if action on facets
##### Returns
 group::GroupOfCone the linear symmetry group of p (or a subgroup if p is a cone)
•
nestedOPGraph (gen_point, points, lattice_points, group, verbose) → ARRAY

Constructs the NOP-graph of an orbit polytope. It is used by the rule for the NOP_GRAPH.

##### Parameters
 Vector gen_point the generating point Matrix points the vertices of the orbit polytope Matrix lattice_points the lattice points of the orbit polytope group::GroupOfPolytope group the generating group Bool verbose print out additional information
##### Returns
 ARRAY (\$Graph, \$lp_reps, \$minInStartOrbit, \@core_point_reps, \$CPindices)
•
orbit_polytope (gen_point, group) → OrbitPolytope

Constructs the orbit polytope of a given point gen_point with respect to a given permutation group group.

##### Parameters
 Vector gen_point the basis point of the orbit polytope group::GroupOfPolytope group a group acting on coordinates
##### Returns
 OrbitPolytope the orbit polytope of gen_point w.r.t. group
•
ortho_project (p) → Polytope

Projects a symmetric polytope in R4 cap H1,k to R3. (See also the polymake extension 'tropmat' by S. Horn.)

##### Parameters
 Polytope p the symmetric polytope to be projected
##### Returns
 Polytope the image of p in R3
•
representation_conversion_up_to_symmetry (c, a, dual, rayCompMethod) → perl::ListReturn

Computes the dual description of a polytope up to its linear symmetry group.

Contained in extension `bundled:group`.
##### Parameters
 Cone c the cone (or polytope) whose dual description is to be computed group::Group a symmetry group of the cone c (group::GroupOfCone or group::GroupOfPolytope) Bool dual true if V to H, false if H to V Bool rayCompMethod specifies sympol's method of ray computation via lrs(0), cdd(1), beneath_and_beyond(2)
##### Returns
 perl::ListReturn list which contains success as bool, vertices/inequalities and lineality/equations as Matrix
•
symmetric_group (degree, domain) → group::GroupOfPolytope

Contained in extension `bundled:group`.
##### Parameters
 Int degree Int domain of the polytope's symmetry group
##### Returns
 group::GroupOfPolytope
•
truncated_orbit_polytope (v, group, eps) → SymmetricPolytope

Constructs an orbit polytope of a given point v with respect to a given group group, in which all vertices are cut off by hyperplanes in distance eps

Contained in extension `bundled:group`.
##### Parameters
 Vector v point of which orbit polytope is to be constructed group::GroupOfPolytope group group for which orbit polytope is to be constructed Rational eps scaled distance by which the vertices of the orbit polytope are to be cut off
##### Returns
 SymmetricPolytope the truncated orbit polytope
•
visualizeNOP (orb, colors_ref, trans_ref)

Visualizes all (nested) orbit polytopes contained in orb in one picture.

##### Parameters
 OrbitPolytope orb the orbit polytope Scalar colors_ref the reference to an array of colors Scalar trans_ref the reference to an array of transparency values
•
visualizeNOPGraph (orb, filename)

Visualizes the NOP-graph of an orbit polytope. Requires 'graphviz' and a Postscript viewer. Produces a file which is to be processed with the program 'dot' from the graphviz package. If 'dot' is installed, the NOP-graph is visualized by the Postscript viewer.

##### Parameters
 OrbitPolytope orb the orbit polytope String filename the filename for the 'dot' file
•

### Transformations

These functions take a realized polytope and produce a new one by applying a suitable affine or projective transformation in order to obtain some special coordinate description but preserve the combinatorial type.

For example, before you can polarize an arbitrary polyhedron, it must be transformed to a combinatorially equivalent bounded polytope with the origin as a relatively interior point. It is achieved with the sequence orthantify - bound - center - polarize.

•
ambient_lattice_normalization (p) → Polytope

Transform to a full-dimensional polytope while preserving the ambient lattice Z^n

##### Parameters
 Polytope p the input polytope,
##### Options
 Bool store_transform store the reverse transformation as an attachement
##### Returns
 Polytope - the transformed polytope defined by its vertices. Facets are only written if available in p.
•
bound (P) → Polytope

Make a positive polyhedron bounded. Apply a projective linear transformation to a polyhedron mapping the far hyperplane to the hyperplane spanned by the points (1,0,...,0,1,0,...). The origin (1,0,...,0) is fixed.

The input polyhedron should be POSITIVE; i.e. no negative coordinates.

##### Parameters
 Polytope P a positive polyhedron
##### Returns
 Polytope
•
center (P) → Polytope

Make a polyhedron centered. Apply a linear transformation to a polyhedron P such that a relatively interior point (preferably the vertex barycenter) is moved to the origin (1,0,...,0).

##### Parameters
 Polytope P
##### Returns
 Polytope
•
orthantify (P, v) → Polytope

Make a polyhedron POSITIVE. Apply an affine transformation to a polyhedron such that the vertex v is mapped to the origin (1,0,...,0) and as many facets through this vertex as possible are mapped to the bounding facets of the first orthant.

##### Parameters
 Polytope P Int v vertex to be moved to the origin. By default it is the first affine vertex of the polyhedron.
##### Returns
 Polytope
•
polarize (C) → Cone

Given a bounded, centered, not necessarily full-dimensional polytope P, produce its polar with respect to the standard Euclidean scalar product. Note that the definition of the polar has changed after version 2.10: the polar is reflected in the origin to conform with cone polarization If P is not full-dimensional, the output will contain lineality orthogonal to the affine span of P. In particular, polarize() of a pointed polytope will always produce a full-dimensional polytope. If you want to compute the polar inside the affine hull you may use the pointed_part client afterwards.

##### Parameters
 Cone C
##### Options
 Bool noc only combinatorial information is handled
##### Returns
 Cone
•
revert (P) → Polytope

Apply a reverse transformation to a given polyhedron P. All transformation clients keep track of the polytope's history. They write or update the attachment REVERSE_TRANSFORMATION.

Applying revert to the transformed polytope reconstructs the original polytope.

##### Parameters
 Polytope P a (transformed) polytope
##### Returns
 Polytope the original polytope
•
scale (P, factor, store) → Polytope

Scale a polyhedron P by a given scaling parameter factor.

##### Parameters
 Polytope P the polyhedron to be scaled Scalar factor the scaling factor Bool store stores the reverse transformation as an attachment (REVERSE_TRANSFORMATION); default value: 1.
##### Returns
 Polytope
•
transform (P, trans, store) → Polytope

Transform a polyhedron P according to the linear transformation trans.

##### Parameters
 Polytope P the polyhedron to be transformed Matrix trans the transformation matrix Bool store stores the reverse transformation as an attachment (REVERSE_TRANSFORMATION); default value: 1.
##### Returns
 Polytope
•
translate (P, trans, store) → Polytope

Translate a polyhedron P by a given translation vector trans.

##### Parameters
 Polytope P the polyhedron to be translated Vector trans the translation vector Bool store stores the reverse transformation as an attachment (REVERSE_TRANSFORMATION); default value: 1.
##### Returns
 Polytope
•
vertex_lattice_normalization (p) → Polytope

Transform to a full-dimensional polytope while preserving the lattice spanned by vertices induced lattice of new vertices = Z^dim

##### Parameters
 Polytope p the input polytope,
##### Options
 Bool store_transform store the reverse transformation as an attachement
##### Returns
 Polytope - the transformed polytope defined by its vertices. Facets are only written if available in p.
•

### Triangulations, subdivisions and volume

These functions collect information about triangulations and other subdivisions of the object and properties usually computed from such, as the volume.

•
barycentric_subdivision (c) → SimplicialComplex

Create a simplicial complex as a barycentric subdivision of a given cone or polytope. Each vertex in the new complex corresponds to a face in the old complex.

##### Parameters
 Cone c input cone or polytope
##### Options
 Bool relabel generate vertex labels from the faces of the original complex; default true Bool geometric_realization read RAYS of the input complex, compute the coordinates of the new vertices and store them as RAYS of the produced complex; default true
##### Returns
 SimplicialComplex or GeometricSimplicialComplex
•
barycentric_subdivision (pc) → PointConfiguration

Create a simplicial complex as the barycentric subdivision of a given point configuration. Each vertex in the new complex corresponds to a face in the old complex.

##### Parameters
 PointConfiguration pc input point configuration
##### Options
 Bool relabel generate vertex labels from the faces of the original complex; default true Bool geometric_realization read POINTS of the input complex, compute the coordinates of the new vertices and store them as POINTS of the produced complex; default false
##### Returns
 PointConfiguration
•
common_refinement (points, sub1, sub2, dim) → IncidenceMatrix

Computes the common refinement of two subdivisions of points. It is assumed that there exists a common refinement of the two subdivisions.

##### Parameters
 Matrix points IncidenceMatrix sub1 first subdivision IncidenceMatrix sub2 second subdivision Int dim dimension of the point configuration
##### Returns
 IncidenceMatrix the common refinement
•
common_refinement (p1, p2) → Polytope

Computes the common refinement of two subdivisions of the same polytope p1, p2. It is assumed that there exists a common refinement of the two subdivisions. It is not checked if p1 and p2 are indeed the same!

##### Parameters
 Polytope p1 Polytope p2
##### Returns
 Polytope
•
delaunay_triangulation (V) → Array<Set<Int>>

Compute the (a) Delaunay triangulation of the given SITES of a VoronoiDiagram V. If the sites are not in general position, the non-triangular facets of the Delaunay subdivision are triangulated (by applying the beneath-beyond algorithm).

##### Parameters
 VoronoiDiagram V
##### Returns
 Array>
•
foldable_max_signature_ilp (d, points, volume, cocircuit_equations) → an

Set up an ILP whose MAXIMAL_VALUE is the maximal signature of a foldable triangulation of a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Rational volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Options
 filename a name for a file in .lp format to store the linear program
##### Returns
 an ILP that provides the result
•
foldable_max_signature_upper_bound (d, points, volume, cocircuit_equations) → the

Calculate the LP relaxation upper bound to the maximal signature of a foldable triangulation of polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Rational volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Returns
 the optimal value of an LP that provides a bound
•
interior_and_boundary_ridges (P) → Pair<Array<Set>,Array<Set>>

Find the (d-1)-dimensional simplices in the interior and in the boundary of a d-dimensional polytope or cone

Contained in extension `bundled:group`.
##### Parameters
 Polytope P the input polytope or cone
##### Returns
 Pair,Array>
•
is_regular (points, subdiv) → Pair<Bool,Vector>

For a given subdivision subdiv of points tests if the subdivision is regular and if yes computes a weight vector inducing this subdivsion. The output is a pair of Bool and the weight vector. Options can be used to ensure properties of the resulting vector. The default is having 0 on all vertices of the first face of subdiv.

##### Parameters
 Matrix points in homogeneous coordinates Array > subdiv
##### Options
 Matrix equations system of linear equation the cone is cut with. Set lift_to_zero gives only lifting functions lifting the designated vertices to 0 Int lift_face_to_zero gives only lifting functions lifting all vertices of the designated face to 0
##### Returns
 Pair
•
is_subdivision (points, faces)

Checks whether faces forms a valid subdivision of points, where points is a set of points, and faces is a collection of subsets of (indices of) points. If the set of interior points of points is known, this set can be passed by assigning it to the option interior_points. If points are in convex position (i.e., if they are vertices of a polytope), the option interior_points should be set to [ ] (the empty set).

##### Parameters
 Matrix points Array> faces
##### Options
 Set interior_points
•
iterated_barycentric_subdivision (c, how) → SimplicialComplex

Create a simplicial complex as an iterated barycentric subdivision of a given cone or polytope.

##### Parameters
 Cone c input cone or polytope Int how many times to subdivide
##### Options
 Bool relabel write labels of new points; default don't write labels Bool geometric_realization read RAYS of the input complex, compute the coordinates of the new vertices and store them as RAYS of the produced complex; default false
##### Returns
 SimplicialComplex
•
max_interior_simplices (P) → Array<Set>

Find the maximal interior simplices of a polytope P. Symmetries of P are NOT taken into account.

Contained in extension `bundled:group`.
##### Parameters
 Polytope P the input polytope
##### Returns
 Array
•
max_interior_simplices (P)

find the maximal interior simplices of a point configuration that DO NOT contain any point in their closure, except for the vertices. Symmetries of the configuration are NOT taken into account.

Contained in extension `bundled:group`.
##### Parameters
 PointConfiguration P the input point configuration
•
max_interior_simplices_impl (P) → Array<Set>

Find the interior d-dimensional simplices of a polytope or cone of combinatorial dimension d

Contained in extension `bundled:group`.
##### Parameters
 Polytope P the input polytope or cone
##### Returns
 Array
•
max_metric (n) → Matrix

Compute a metric such that the f-vector of its tight span is maximal among all metrics with n points.

S. Herrmann and M. Joswig: Bounds on the f-vectors of tight spans.
Contrib. Discrete Math., Vol.2, 2007 161-184
##### Parameters
 Int n the number of points
##### Returns
 Matrix
•
metric2hyp_triang (FMS) → Polytope

Given a generic finite metric space FMS, construct the associated (i.e. dual) triangulation of the hypersimplex.

##### Parameters
 TightSpan FMS
##### Returns
 Polytope
•
metric2splits (D) → Array<Pair<Set>>

Computes all non-trivial splits of a metric space D (encoded as a symmetric distance matrix).

##### Parameters
 Matrix D
##### Returns
 Array> each split is encoded as a pair of two sets.
•
min_metric (n) → Matrix

Compute a metric such that the f-vector of its tight span is minimal among all metrics with n points.

S. Herrmann and M. Joswig: Bounds on the f-vectors of tight spans.
Contrib. Discrete Math., Vol.2, 2007 161-184
##### Parameters
 Int n the number of points
##### Returns
 Matrix
•
mixed_volume (P1, P2, Pn) → E

Produces the mixed volume of polytopes P1,P2,...,Pn.

##### Parameters
 Polytope P1 first polytope Polytope P2 second polytope Polytope Pn last polytope
##### Returns
 E mixed volume
•
placing_triangulation (Points, permutation) → Array<Set<Int>>

Compute the placing triangulation of the given point set using the beneath-beyond algorithm.

##### Parameters
 Matrix Points the given point set Array permutation
##### Returns
 Array>
•
points2metric (points) → Matrix

Define a metric by restricting the Euclidean distance function to a given set of points. Due to floating point computations (sqrt is used) the metric defined may not be exact. If the option max or l1 is set to true the max-norm or l1-nomr is used instead (with exact computation).

##### Parameters
 Matrix points
##### Options
 Bool max triggers the usage of the max-norm (exact computation) Bool l1 triggers the usage of the l1-norm (exact computation)
##### Returns
 Matrix
•
poly2metric (P) → Matrix

Define a metric by restricting the Euclidean distance function to the vertex set of a given polytope P. Due to floating point computations (sqrt is used) the metric defined may not be exact. If the option max or l1 is set to true the max-norm or l1-nomr is used instead (with exact computation).

##### Parameters
 Polytope P
##### Options
 Bool max triggers the usage of the max-norm (exact computation)
##### Returns
 Matrix
•
positive_circuits (or, S) → Set<Set<Int>>

returns all sets of points that form a circuit with the given list of points

##### Parameters
 Polytope or PointConfiguration P Set S subset of point indices
##### Returns
 Set> A list of point sets that intersect positively the set S
•
quotient_space_simplexity_ilp (d, V, volume, cocircuit_equations) → an

Set up an LP whose MINIMAL_VALUE is a lower bound for the minimal number of simplices needed to triangulate a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix V the input points or vertices Scalar volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Options
 filename a name for a file in .lp format to store the linear program
##### Returns
 an LP that provides a lower bound
•
quotient_space_simplexity_lower_bound (d, V, volume, cocircuit_equations) → the

Calculate a lower bound for the minimal number of simplices needed to triangulate a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix V the input points or vertices Scalar volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Returns
 the optimal value of an LP that provides a lower bound
•
regularity_lp (points, subdiv) → Polytope<Scalar>

For a given subdivision subdiv of points determines a LinearProgram to decide whether the subdivision is regular. The output a Polytope with an attached LP. Options can be used to ensure properties of the resulting LP. The default is having 0 on all vertices of the first face of subdiv.

##### Parameters
 Matrix points in homogeneous coordinates Array > subdiv
##### Options
 Matrix equations system of linear equation the cone is cut with. Set lift_to_zero gives only lifting functions lifting the designated vertices to 0 Int lift_face_to_zero gives only lifting functions lifting all vertices of the designated face to 0 Scalar epsilon minimum distance from all inequalities
##### Returns
 Polytope
•
regular_subdivision (points, weights) → Array<Set<Int>>

Compute a regular subdivision of the polytope obtained by lifting points to weights and taking the lower complex of the resulting polytope. If the weight is generic the output is a triangulation.

##### Parameters
 Matrix points Vector weights
##### Returns
 Array>
•
secondary_cone (points, subdiv) → Cone

For a given subdivision subdiv of points tests computes the corresponding secondary cone. If the subdivision is not regular, the cone will be the secondary cone of the finest regular coarsening of subdiv. (See option test_regularity) Options can be used to make the Cone POINTED.

##### Parameters
 Matrix points in homogeneous coordinates Array > subdiv
##### Options
 Matrix equations system of linear equation the cone is cut with. Set lift_to_zero gives only lifting functions lifting the designated vertices to 0 Int lift_face_to_zero gives only lifting functions lifting all vertices of the designated face to 0 Bool test_regularity throws an exception if the subdivision is not regular
##### Returns
 Cone
•
simplexity_ilp (d, points, the, volume, cocircuit_equations) → an

Set up an ILP whose MINIMAL_VALUE is the minimal number of simplices needed to triangulate a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Array the representatives of maximal interior simplices Scalar volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Options
 filename a name for a file in .lp format to store the linear program
##### Returns
 an LP that provides a lower bound
•
simplexity_ilp_with_angles (d, points, the, volume, cocircuit_equations) → an

Set up an ILP whose MINIMAL_VALUE is the minimal number of simplices needed to triangulate a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Array the (representative) maximal interior simplices Scalar volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Options
 filename a name for a file in .lp format to store the linear program
##### Returns
 an LP that provides a lower bound
•
simplexity_lower_bound (d, points, volume, cocircuit_equations) → the

Calculate the LP relaxation lower bound for the minimal number of simplices needed to triangulate a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Scalar volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Returns
 the optimal value of an LP that provides a lower bound
•
splits (V, G, F, dimension) → Matrix

Computes the SPLITS of a polytope. The splits are normalized by dividing by the first non-zero entry. If the polytope is not fulldimensional the first entries are set to zero unless coords are specified.

##### Parameters
 Matrix V vertices of the polytope Graph G graph of the polytope Matrix F facets of the polytope Int dimension of the polytope
##### Options
 Set coords entries that should be set to zero
##### Returns
 Matrix
•
splits_in_subdivision (vertices, subdivision, splits) → Set<Int>

Tests which of the splits of a polyhedron are coarsenings of the given subdivision.

##### Parameters
 Matrix vertices the vertices of the polyhedron Array> subdivision a subdivision of the polyhedron Matrix splits the splits of the polyhedron
##### Returns
 Set
•
split_compatibility_graph (splits, P) → Graph

DOC_FIXME: Incomprehensible description! Computes the compatibility graph among the splits of a polytope P.

##### Parameters
 Matrix splits the splits given by split equations Polytope P the input polytope
##### Returns
 Graph
•
split_polyhedron (P) → Polytope

Computes the split polyhedron of a full-dimensional polyhdron P.

##### Parameters
 Polytope P
##### Returns
 Polytope
•
staircase_weight (k, l) → Vector<Rational>

Gives a weight vector for the staircase triangulation of the product of a k- and an l-dimensional simplex.

##### Parameters
 Int k the dimension of the first simplex Int l the dimension of the second simplex
##### Returns
 Vector
•
stellar_subdivision (pc, faces) → PointConfiguration

Computes the complex obtained by stellar subdivision of all faces of the TRIANGULATION of the PointConfiguration.

##### Parameters
 PointConfiguration pc input point configuration Array> faces list of faces to subdivide
##### Options
 Bool no_labels : do not write any labels
##### Returns
 PointConfiguration
•
symmetrized_foldable_max_signature_ilp (d, points, volume, generators, symmetrized_foldable_cocircuit_equations) → an

Set up an ILP whose MAXIMAL_VALUE is the maximal signature of a foldable triangulation of a polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Rational volume the volume of the convex hull Array> generators the generators of the symmetry group SparseMatrix symmetrized_foldable_cocircuit_equations the matrix of symmetrized cocircuit equations
##### Options
 filename a name for a file in .lp format to store the linear program
##### Returns
 an ILP that provides the result
•
symmetrized_foldable_max_signature_upper_bound (d, points, volume, cocircuit_equations) → the

Calculate the LP relaxation upper bound to the maximal signature of a foldable triangulation of polytope, point configuration or quotient manifold

Contained in extension `bundled:group`.
##### Parameters
 Int d the dimension of the input polytope, point configuration or quotient manifold Matrix points the input points or vertices Rational volume the volume of the convex hull SparseMatrix cocircuit_equations the matrix of cocircuit equations
##### Returns
 the optimal value of an LP that provides a bound
•
thrackle_metric (n) → Matrix

Compute a metric such that the f-vector of its tight span is maximal among all metrics with n points. This metric can be interpreted as a lifting function for the thrackle triangulation (see de Loera, Sturmfels and Thomas: Groebner Basis and triangultaions of the second hypersimplex)

##### Parameters
 Int n the number of points
##### Returns
 Matrix
•
tight_span (points, weight, full) → Polytope

Compute the tight span dual to the regular subdivision obtained by lifting points to weight and taking the lower complex of the resulting polytope.

##### Parameters
 Matrix points Vector weight Bool full true if the polytope is full-dimensional. Default value is 1.
##### Returns
 Polytope (The polymake object TightSpan is only used for tight spans of finite metric spaces, not for tight spans of subdivisions in general.)
•
tight_span (P) → Polytope

Compute the tight span dual to the regular subdivision of a polytope P obtained by the WEIGHTS and taking the lower complex of the resulting polytope.

##### Parameters
 Polytope P
##### Returns
 Polytope (The polymake object TightSpan is only used for tight spans of finite metric spaces, not for tight spans of subdivisions in general.)
•
topcom_all_fine_triangulations (pc) → Array<Array<Set<Int>>>

Compute all fine triangulations of a point configuration via its chirotope.

##### Parameters
 PointConfiguration pc input point configuration
##### Returns
 Array>>
•
topcom_all_triangulations (pc) → Array<Array<Set<Int>>>

Compute all triangulations of a point configuration via its chirotope.

##### Parameters
 PointConfiguration pc input point configuration
##### Returns
 Array>>
•
ts_max_metric (n) → TightSpan

Computes the tight span of a metric such that its f-vector is maximal among all metrics with n points.

S. Herrmann and M. Joswig: Bounds on the f-vectors of tight spans.
Contrib. Discrete Math., Vol.2, 2007 161-184
##### Parameters
 Int n the number of points
##### Returns
 TightSpan
•
ts_min_metric (n) → TightSpan

Compute the tight span of a metric such its f-vector is minimal among all metrics with n points.

S. Herrmann and M. Joswig: Bounds on the f-vectors of tight spans.
Contrib. Discrete Math., Vol.2, 2007 161-184
##### Parameters
 Int n the number of points
##### Returns
 TightSpan
•
ts_thrackle_metric (n) → TightSpan

Compute a tight span of a metric such that its f-vector is maximal among all metrics with n points. This metric can be interpreted as a lifting function for the thrackle triangulation (see de Loera, Sturmfels and Thomas: Groebner Basis and triangultaions of the second hypersimplex)

##### Parameters
 Int n the number of points
##### Returns
 TightSpan
•

### Visualization

These functions are for visualization.

•
bounding_box (V, surplus_k, voronoi) → Matrix

Introduce artificial boundary facets (which are always vertical, i.e., the last coordinate is zero) to allow for bounded images of unbounded polyhedra (e.g. Voronoi polyhedra). If the voronoi flag is set, the last direction is left unbounded.

##### Parameters
 Matrix V vertices that should be in the box Scalar surplus_k size of the bounding box relative to the box spanned by V Bool voronoi useful for visualizations of Voronoi diagrams that do not have enough vertices default value is 0.
##### Returns
 Matrix
•
splitstree (vis_obj ...)

Call wiki:external_software#SplitsTree with the given visual objects.

##### Parameters
 Visual::Object vis_obj ... objects to display
##### Options
 String File "filename" or "AUTO" Only create a NEXUS format file, don't start the GUI. The `.nex` suffix is automatically added to the file name. Specify AUTO if you want the filename be automatically derived from the drawing title. You can also use any expression allowed for the `open` function, including "-" for terminal output, "&HANDLE" for an already opened file handle, or "| program" for a pipe.
•
vlabels (vertices, wo_zero) → arrayref

Creates vertex labels for visualization from the vertices of the polytope. The parameter wo_zero decides whether the entry at position 0 (homogenizing coordinate) is omitted (1) or included (0) in the label string."

##### Parameters
 Matrix vertices the vertices of the polytope Bool wo_zero includes (0) or omits (1) the entry at position 0
##### Returns
 arrayref a reference to an array of vertex label strings

## Common Option Lists

•

### Visualization

These options are for visualization.

•
geometric_options

Options for visualizing polytopes.

##### Options
 Matrix BoundingBox
•
schlegel_init

Initial properties of the Schlegel diagram to be displayed.

##### Options
 Int FACET index of the projection facet, see Visual::SchlegelDiagram::FACET Rational ZOOM zoom factor, see Visual::SchlegelDiagram::ZOOM Vector FACET_POINT Vector INNER_POINT