Tutorial for polymake Winthrop: June 28 July 2, 2014

Embed Size (px)

DESCRIPTION

Abstract This document provides a brief introduction to polymake. While it is designed to accompany lectures for working groups by Rudy Yoshida and Terrell Hodge for the NSF/CBMS Conference on Mathematical Phylogeny at Winthrop University, June 28 – July 2, 2014, we hope this will be a useful reference more broadly.

Citation preview

Tutorial for polymake Winthrop: June 28 July 2, 2014
STILL WORK IN PROGRESS !!! Tutorial for polymake Winthrop: June 28 July 2, 2014 Terrell L. Hodge Add material to explore NJ cones vs. BME cones using polymake; also, affiliated tree-drawing program to polymake was? Abstract This document provides a brief introduction to polymake. While it is designed to accompany lectures for working groups by Rudy Yoshida and Terrell Hodge for the NSF/CBMS Conference on Mathematical Phylogeny at Winthrop University, June 28 July 2, 2014, we hope this will be a useful reference more broadly. Tutorial Goals After completing this tutorial, you will be able to:
Use polymake to find the convex hull of a set of points (may or may not be known to be vertices of the resulting polytope, a priori) Use polymake to explore the resulting polytope, including finding the face vector Use polymake to explore the associated normal cones to a polytope Use polymake to explore other cones Call up basic help commands and be aware of online resources to assist with polymake Apply these tools to the Balanced Minimum Evolution (BME) polytope and other related geometric constructs from mathematical phylogenetics Add to/refine this slide, including reference to graphical structure. polymake Tool for studying convex geometry: convex polytopes and polyhedra and their combinatorics in particular Other objects it can handle include simplicial complexes, matroids, polyhedral fans, graphs, some objects from tropical geometry Reference: Ewgenij Gawrilow and Michael Joswig. polymake: a framework for analyzing convex polytopes. Polytopescombinatorics and computation (Oberwolfach, 1997), 4373, DMV Sem., 29, Birkhuser, Basel, MR (2001f:52033). Convex Polytopes Convex hull of n vectors a1,,am in Rn:
Convex polytopes are bounded polyhedra, where a polyhedron is an intersection of finitely many closed half-spaces in some Rd. Closed half-planes and cones are examples of polyhedra that are not convex polytopes. V-repn vs. H-repn of Polytopes
There are these dual representations of a polytopelater we will use both; one can translate between them using polymake, as shown also in the polymake Tutorial on Polytopes. polymake: Homepage Polymake homepage: Download polymake Currently two versions available: 2.13 and Source code download is desirable default, but for Macs, there are bundled packages (with perl); see bottom of webpage above. Since I have a Mac OS X , I downloaded the 10.8 Mac bundle (with perl) Example: Mac 10.8 Bundle Download
NOTES FOR TERRELL: This from the bundle download. Note that, for Mac, at the bottom of the original download page,they say for the source code version one first needs Xcode from the App store. I wasnt aware of having this already, but apparently did/do; I clicked on link to the app store and wasnt aware of it downloading, but it appeared when I searched in my Finder with the claim I last opened/touched it about two minutes before I went looking for it on Finder to check to see if I had it. BUT This bundle didnt work for me personally!! See the polymake wiki forum (installation questions) where I posted my query. Alternative: polymake Online
To initiate a session online, follow the initial directions, including e.g., calling up polymake. See the Polymake download page, or directly at: Tutorial Page for polymake
Useful tutorials: Introduction Tutorial, Constructing and Analyzing Polytopes, Dealing with Graphs. (Useful, but not terrifically useful!!) From the main polymake page, or directly at Exercise 1 Explain what you believe is the convex hull of the four points (1/4,1/4,1/2,1/2,1/4,1/4), (1/3,1/3,1/3,1/3,1/3,1/3), (1/2,1/4,1/4,1/4,1/4,1/2), and (1/4,1/2,1/4,1/4,1/2,1/4) in R6, and confirm your expectation using polymake. The polytope here is easy/boring; the point here is to introduce use of polymake where one already knows what the output should be and doesnt have to enter a lot of data (so can concentrate on the syntax and how the program works). Will add more interesting exercises (increase $n$) later on. Suggestions appear on the next page. An additional suggestion is that you create a separate .txt file to hold and save your input for the exercises as you create it. This will make it easier to go back and forth, and to copy and paste into the online version of polymake, in particular. Getting Started: HINTS for ONLINE INFO and HELP
Step 1: Read the section A Very Simple Example: the 3-Cube in the Introduction Tutorial for polymake off polymakes homepage or the tutorial homepage, and imitate the first two subsequent print commands you see there to the polytope $p you will have just defined. Note: with this approach, you will be prompted by polymake to enter the points one at a time after having gotten to and entered $p->POINTS= $p->POINTS= 1 1/3 1/3 1/3 1/3 1/3 1/3 polytope (4)> 1 1/2 1/4 1/4 1/4 1/4 1/2 polytope (5)> 1 1/4 1/2 1/4 1/4 1/2 1/4 polytope (6)> . polytope > print $p->N_FACETS; polymake: used package cddlib Implementation of the double description method of Motzkin et al. Copyright by Komei Fukuda. http://www.ifor.math.ethz.ch/~fukuda/cdd_home/cdd.html polymake: used package lrslib Implementation of the reverse search algorithm of Avis and Fukuda. Copyright by David Avis. http://cgm.cs.mcgill.ca/~avis/lrs.html 3 polytope > print $p->SIMPLE; 1 Since polymake uses homogeneous coordinates you will need to set the additional first coordinate x0 to 1. Given polytope P, N_FACETS output equals number of d-1 dimensional faces for d = dim(P); here, result is 3 (shown below) The entry of the convex polytope used code suggested by the Introduction Tutorial. Since polymake uses homogeneous coordinates you need to set the additional coordinate x0 to 1. The calls for the polytope to be simple were from the Introduction Tutorial. A polytope P is simple if each vertex is contained in d facets, for d=dim P.The output of 1 to this call is a binary response (1 = Yes, 0 = No). The call for the polytopes N_FACETS was also from the Introduction Tutorial. The face vector (F-vector) call code was from the latter tutorial. The output shows that the polytope has 3 vertices and 3 edges. (One point of things being obvious in this example, is to see what the code does/output is, where we are sure we know the polytope (a triangle!) itself.) N.B.: As reminded at the beginning of a session, to initiate polymake online, one does have to first enter `polymake; thats not shown here on this slide, for reasons of space. N.B.: Someone following this tutorial may have decided not to enter the second point (believing it to be interior); we have included it here for purposes of a particular illustration in the next few slides. Given polytope P, SIMPLE output shows 1 (``TRUE) if each vertex is contained in d = dim(P) facets (0 if FALSE) Exercise 1 Soln: polymake in a Box
The result of trying the help WORD form of a help command on the word F_VECTOR polytope > help "F_VECTOR"; There are 3 help topics matching 'F_VECTOR': : objects/QuotientSpace/properties/Combinatorics/F_VECTOR: property F_VECTOR : Array An array that tells how many faces of each dimension there are 2: objects/Cone/properties/Combinatorics/F_VECTOR: property F_VECTOR : Vector The vector counting the number of faces (`fk` is the number of `(k+1)`-faces). 3: objects/Polytope/properties/Combinatorics/F_VECTOR: fk is the number of k-faces. The next slide shows the result of adding a request to print the F_VECTOR, i.e., the face vector,for our polytope $p to our previous set of commands Exercise 1 Soln: polymake in a Box
polytope > $p=new Polytope; polytope > $p->POINTS= 1 1/2 1/4 1/4 1/4 1/4 1/2 polytope (4)> 1 1/4 1/2 1/4 1/4 1/2 1/4 polytope (5)> . polytope > print $p->N_FACETS; polymake: used package cddlib Implementation of the double description method of Motzkin et al. Copyright by Komei Fukuda. http://www.ifor.math.ethz.ch/~fukuda/cdd_home/cdd.html polymake: used package lrslib Implementation of the reverse search algorithm of Avis and Fukuda. Copyright by David Avis. http://cgm.cs.mcgill.ca/~avis/lrs.html 3 polytope > print $p->SIMPLE; 1 polytope > print $p->F_VECTOR; 3 3 Since polymake uses homogeneous coordinates you will need to set the additional first coordinate x0 to 1. Given polytope P, N_FACETS output equals number of d-1 dimensional faces for d = dim(P); here, result is 3 (shown below) The entry of the convex polytope used code suggested by the Introduction Tutorial. Since polymake uses homogeneous coordinates you need to set the additional coordinate x0 to 1. The calls for the number of facets and for the polytope to be simple were from the Introduction Tutorial and the ``Tutorial on Polytopes. A polytope P is simple if each vertex is contained in d facets, for d=dim P.The output of 1 to this call is a binary response (1 = Yes, 0 = No). The face vector (F-vector) call code was from the latter tutorial. The output shows that the polytope has 3 vertices and 3 edges. (One point of things being obvious in this example, is to see what the code does/output is, where we are sure we know the polytope (a triangle!) itself.) N.B.: As reminded at the beginning of a session, to initiate polymake online, one does have to first enter `polymake; thats not shown here on this slide, for reasons of space. Given polytope P, SIMPLE output shows 1 (``TRUE) if each vertex is contained in d = dim(P) facets (0 if FALSE) F_VECTOR output shows there are 3 vertices and 3 edges Soln to Exer 1(?): Alternate Commands
It is also possible to enter point data in a matrix format, rather than one-by-one. Follow the commands below to define a set of vertices via a matrix, and then assign to those the polytope $p. 2. Then, as before, determine the number of facets of $p, the face vector of $p, and whether $p is simple or not. $vertices=new Matrix( [[1 ,1/4, 1/4, 1/2, 1/2, 1/4, 1/4 ], [1, 1/3,1/3,1/3,1/3,1/3,1/3], [1,1/2,1/4,1/4,1/4,1/4,1/2], [1,1/4,1/2,1/4,1/4,1/2,1/4] ] ); $p=new Polytope(VERTICES=>$vertices); As explored further on the next side, this set of commands is currently problematic: VERTICES command presumes we know these are the extreme points, vs. POINTS commandwhich doesnt presume this and takes convex hull.One can include the centroid for this example when using POINTS and not have extraneous data.See the Soln to Exer 1(?): Alternate Commands
$vertices=new Matrix( [[1 ,1/4, 1/4, 1/2, 1/2, 1/4, 1/4 ], [1, 1/3,1/3,1/3,1/3,1/3,1/3], [1,1/2,1/4,1/4,1/4,1/4,1/2], [1,1/4,1/2,1/4,1/4,1/2,1/4] ] ); $p=new Polytope(VERTICES=>$vertices); print $p->N_FACETS; print $p->F_VECTOR; print $p->SIMPLE; As explored further on the next side, this set of commands is currently problematic: VERTICES command presumes we know these are the extreme points, vs. POINTS commandwhich doesnt presume this and takes convex hull.One can include the centroid for this example when using POINTS and not have extraneous data.See the Soln to Exer1 (?): Alt. Commands Output
polytope > $vertices=new Matrix( [[1 ,1/4, 1/4, 1/2, 1/2, 1/4, 1/4 ], [1, 1/3 ,1/3,1/3,1/3,1/3,1/3], [1,1/2,1/4,1/4,1/4,1/4,1/2], [1,1/4,1/2,1/4,1/4,1/2,1/4] ] ); Homogenous coordinates are still used; what is different from before? polytope > $p=new Polytope(VERTICES=>$vertices); polytope > print $p->N_FACETS; 3 polytope > print $p->F_VECTOR; 4 3 polytope > print $p->SIMPLE; F_VECTOR output shows there are 4 vertices and 3 edges Given polytope P, SIMPLE output shows 1 (``TRUE) if each vertex is contained in d = dim(P) facets (0 if FALSE) WARNING: Do not use VERTICES to define your polytope unless you are sure you have the actual vertices of your polytope! Some Context Before More Commands
Well work with binary phylogenetic X-trees, i.e.,unrooted binary trees on a set X of n leaves (taxa). Recall the smallest interesting examples are quartets (n = 4): X3 X2 X24 X2 ((1,3), (2,4))((1,2), (3,4))((1,4),(2,3)) When edge-weighted, each gives a vector of pairwise distances DT = (dij) = (dab, dac, dad, dbc, dbd, dcd) in R6. Exercise: Find the BME vectors for the quartet trees (as on the previous slide). BME for Non-Binary Trees
Pauplins Formula for estimating branch lengths underlies the definition of the BME vectors There is an extension of Pauplins Formula to non-binary trees, using circular orders Under this extension, the star tree on 3 leaves has the BME vector(1/3, 1/3, 1/3, 1/3, 1/3, 1/3) Reference:Mike Steels talk on 6/29, or the relevant papers (citations TBA). May add visualization slide from polymake as well, if can get downloaded version to work, or ask if Rudy can compute and send the output for illustration purposes. The BME vectors for the quartet trees and the BME polytope on these vertices. Exercise 1, Continued: Further Explorations of Polytopes
Previously, we asked polymake to print the number of facets of the BME polytope for n = 4 (Exercise 1).Now ask polymake to find the actual facets of the BME polytope for n = 4. Ask polymake to find the normal cones to the BME polytope.(See representative pictures on next slide.) Polytopes, Normal Cones, and Fans
From Alignment Polytopes lecture by Lior Pachter: Continuing: MORE HINTS for ONLINE INFO and HELP
Step 3: Now read the subsection V Descriptionin the section Constructing a Polytope from Scratch in the Tutorial on Polytopes (off the link Construct and analyze polytopes from polymakes tutorial homepage), and imitate the relevant commands you see there. Step 4: Use the help features to determine the meaning of the command AFFINE_HULL and apply it to get this info about the polytope from Exercise 1. If you have access to polymakes visualization capabilities and think this will be applicable, you may also then wish to read the next section in the Introduction Tutorial, called Visualizing a Random 3-Polytope. One Solution to Exercise 1 (Continued)
polytope > $vertices=new Matrix( [[1 ,1/4, 1/4, 1/2, 1/2, 1/4, 1/4 ], [1,1/2,1/4,1/4,1/4,1/4,1/2], [1,1/4,1/2,1/4,1/4,1/2,1/4] ] ); polytope > $p=new Polytope(VERTICES=>$vertices); polytope > print $p->FACETS; polymake: used package cddlib Implementation of the double description method of Motzkin et al. Copyright by Komei Fukuda /3 -4/ Previously, we printed the number of facets; now we show them via FACETS.According to a help request for FACETS, these are the facets of the cone, encoded as inequalities. Facets as Inequalities
The output /3 -4/ represents the inequalities x1 >= /3x1 - 4/3x2 >= x3 >= 0 Associated to each inequality is an equality that is defined by the inner product with a normal vector. That is, the facets are defined by their normal vectors; here: (4,0,0,0,0,0) (-4/3,-4/3,0,0,0,0) (0,0,4,0,0,0) One Solution to Exercise 1 (Continued)
polytope > print $p->AFFINE_HULL; /3 1/3 1/3 -2/ /5 2/5 -3/5 1/5 1/ /2 -1/2 1/4 1/4 1/4 1/4 1 AFFINE_HULL provides the normal cones to the polyope Q: How does this describe the normal cones? BME Cones n = 4 A Few Remarks re: BME Cones
For the nth BME polytope, and a fixed phylogenetic tree T on n letters having associated BME vector wT, the BME cone associated to T is Less formally, the BME cone associated to T consists of alldissimilarity maps (distance matrices) d for which applying the BME method to d returns T as the output. Add a picture still The BME cone of Tis a convex cone which is a normal cone at the vertex wT in the BME polytope. Exercises 2 5 (also 2 - 5 in WG Hour 2 Slides)
Find all vertices of the BME polytope for n =5. Use polymaketo find all faces of the BME polytope for n =5. From what you found at Exercise 3, compute the BME cones for n =5. Verify that the edge graph is the complete graph by polymake . This is the same as the set Rudy proposed in her Winthrop notes. For the first: Write out some by hand, then see the pattern for the rest. Theres only one tree topology. Do one computation while in the lecture. Be careful to homogenize. MORE HINTS for ONLINE INFO and HELP
1. Weve not yet seen how to associate a graph to a polytope, nor what it means. To get a sense of all the objects that can be assigned to a well-known polytope, define the 3-cube in polymake, and ask it to show us what properties it has. The output is below: polytope > $c=cube(3); polytope > print join(", ", $c->list_properties); CONE_AMBIENT_DIM, CONE_DIM, FACETS, AFFINE_HULL, VERTICES_IN_FACETS, BOUNDED, FEASIBLE, N_VERTICES, N_FACETS, FULL_DIM, LINEALITY_SPACE, LINEALITY_DIM, COMBINATORIAL_DIM, SIMPLICIAL, SIMPLE, GRAPH, VERTICES, FAR_FACE, DUAL_H_VECTOR, F_VECTOR, HASSE_DIAGRAM, FLAG_VECTOR, CD_INDEX_COEFFICIENTS, G_VECTOR, H_VECTOR, WEAKLY_CENTERED HINTS, and MORE HINTS for ONLINE INFO and HELP
2. Now, for the polytope $c, try entering print $p->GRAPH->N_EDGES; NOTE: The online polymake tutorial Dealing with Graphs gives additional information about graphs in polymake, but not this particular command. More generally, to see descriptions of all object commands/properties (such as VERTICES_IN_FACETS or GRAPH, etc.) associated to a polytope (or to a cone), go to: For example, from that page, expand POLYTOPES to find COMBINATORICS and then GRAPHS. Does this help? For another example, try the same path, but VERTICES_IN_FACETS instead of GRAPHS. Exercise: Verify these results. What happens if n >= 7?
Now can ask participants to explore n = 6, n = 7, n= 8, or as much as they can compute! (Does polymake go any further than info about n=8, now?) Exercise: Verify these results. What happens if n >= 7? Tutorial Goals After completing this tutorial, you will be able to:
Use polymake to find the convex hull of a set of points (may or may not be known to be vertices of the resulting polytope, a priori) Use polymake to explore the resulting polytope, including finding the face vector Use polymake to explore the associated normal cones to a polytope Use polymake to explore other cones Call up basic help commands and be aware of online resources to assist with polymake Apply these tools to the Balanced Minimum Evolution (BME) polytope and other related geometric constructs from mathematical phylogenetics So far, we have given the tools to reach all the goals, except for the further exploration of cones,as will be handy for further comparing BME and NJ cones in WG days 3 and 4. More on Cones in polymake
TBA, for WG Days 3 and 4 TBC End of polymake Tutorial for WG Day 2 WG Day 3: More on Cones in polymake
TBC More on Neighbor-Joining Cones NJ_5.txt Code on the next two slides creates the example above from Winthrop 5-3.pdf in polymake TLH: Add material I saved in .txt files: Code from NJ_5.txt: Provides inequalities and equalities on this page; commands to create cone and print vertices and face vector on next page. Inequalities are from cherry-picking (Q-criteria) and the equalities are from dimension-shifting. $inequalities=new Matrix( [[0, 1, -1, -1, 0, 0, 1, 0, 0, 1, -1], [0, -1, 1, -1, 0, 1, 0, 0, 1, 0, -1], [0, -1, -1, 1, 1, 0, 0, 1, 0, 0, -1], [0, -1, -1, 0, 2, 0, 0, 0, 1, 1, -2], [0, -1, 0, -1, 0, 2, 0, 1, 0, 1, -2], [0, 0, -1, -1, 0, 0, 2, 1, 1, 0, -2], [0, -1, -1, 0, 0, 1, 1, 2, 0, 0, -2], [0, -1, 0, -1, 1, 0, 1, 0, 2, 0, -2], [0, 0, -1, -1, 1, 1, 0, 0, 0, 2, -2], [0, -1, 0, 1, 1/2, 0, -1/2, 1/2, 0, -1/2, 0], [0, -1, 1, 0, 0, 1/2, -1/2, 0, 1/2, -1/2, 0]]); $equations=new Matrix( [[0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1]]); Code from NJ_4.txt: Provides inequalities and equalities on the previous page; commands to create cone and print vertices and face vector on this page $p=new Polytope(INEQUALITIES=>$inequalities, LINEALITY_SPACE=>$equations); print_constraints($inequalities); print $p->VERTICES; print $p->F_VECTOR; Exercise: Define the NJ Cones = BME Cones, for quartet space Commands re: Cones Example: Defining a cone in polymake via inequalities $inequalities=new Matrix([[1,1,0],[1,0,1],[1,-1,0],[1,0,-1],[17,1,1]]); $p=new Polytope(INEQUALITIES=>$inequalities); Q: I want to take a half-space representation of a polyhedron and find the extreme points (and rays) - in other words do an H-rep to V-rep. A: You can define a polytope in polymake by specifing a matrix of POINTS or INEQUALITIES as follows: CODE: SELECT ALL $inequalities=new Matrix([[1,1,0],[1,0,1],[1,-1,0],[1,0,-1],[17,1,1]]); $p=new Polytope(INEQUALITIES=>$inequalities); Commands re: Cones See: Producing a cone under User Functions at Commands re: Cones See: Producing a cone under User Functions at Commands re: Cones polymake > $cn = new Cone(INPUT_RAYS=>[[1,0,0],[1,0,1]]); polymake > print $cn->FACETS; polymake > print $cn->LINEAR_SPAN; To define a (rational) cone by e.g., two rays, then obtain its defining inequalities and its defining equations (such that cn is the intersection of halfspaces and hyperplanes). (NOTE: there is a space between new and Cone(INPUT) which is why the spacing keeps pushing them apart. First output of FACETS call gives: 1 0 -1 0 0 1, which gives the definining inequalities; for the defining equations, use the LINEAR_SPAN command (from: Coordinates for Polyhedra
Other Useful Commands polytope > $fs = $p->FACET_SIZES;
polytope > print $fs; polytope > help 'objects'; polytope > help 'objects/Polytope'; polytope > print $c->F_VECTOR, "\n", $c->H_VECTOR; FACET_SIZES (lists the number of vertices contained in each facet; see) Interactive help commands (see F-vector and H-vector (in two rows) of a previously defined polytope c References Appendices Additional information for undergraduate instructors looking for materials to quickly define and/or demonstrate some of the basic concepts in polyhedral geometry for their students: Normal cones and fans Characteristic cones, lineality spaces, and decomposition of polyhedra into convex hull, cone, and lineality space Some slides of code and output for the exercises Normal Cones and Fans Polytopes, Normal Cones, and Fans
From Alignment Polytopes lecture by Lior Pachter: Polytopes, Normal Cones, and Fans
From Alignment Polytopes lecture by Lior Pachter: Characteristic Cones and Lineality Spaces Characteristic/Recession Cone
The characteristic/recession cone of a given polyhedron P, denoted by char.cone(P) is the polyhedral cone: char.cone(P) = {y | x + y P for all x in P} = {y | Ay 0} y char.cone(P) there is an x in P such that x + y P for all 0 P + char.cone(P) = P P is bounded char.cone(P) = {0} If P = Q + C, with Q a polytope and C a polyhedral cone, then C = char.cone(P) The nonzero vectors in char.cone(P) are called infinite directions of P From a presentation: The Structure of Polyhedra, by G. Indik This is taken from a super nice set of slides, The Structure of Polyhedra, by Gabriel Indik, for a course CAS 746 Advanced Topics in Combinatorial Optimization in 2006 at McMaster University; url given below is horrible, so Google the data above. Available at: Lineality Space The lineality space of P, denoted my lin.space(P) is the linear space: lin.space(P) = char.cone(P) char.cone(P) = {y | Ay = 0} From a presentation: The Structure of Polyhedra, by G. Indik TLH: Slides originally hadlin.space(P) = char.cone(P) char.cone(P) = {y | Ay 0}; Ive corrected that here. Otherwise, this is taken from a super nice set of slides, The Structure of Polyhedra, by Gabriel Indik, for a course CAS 746 Advanced Topics in Combinatorial Optimization in 2006 at McMaster University; url to it is horrible, so Google the data above. If lin.space(P) has dimension 0, then P is called pointed Decomposition of Polyhedra
Any polyhedron has a unique minimal representation as: P = conv.hull{x1,,xn} + cone{y1,,yn} + lin.space(P) This is known as the internal representation, while the external representation is given by: P = {x | A+x b+} From a presentation: The Structure of Polyhedra, by G. Indik This is taken from a super nice set of slides, The Structure of Polyhedra, by Gabriel Indik, for a course CAS 746 Advanced Topics in Combinatorial Optimization in 2006 at McMaster University; url to it is horrible, so Google the data above. Decomposition of Polyhedra
Any polyhedron has a unique minimal representation as: P = conv.hull{x1,,xn} + cone{y1,,yn} + lin.space(P) This is known as the internal representation, while the external representation is given by: P = {x | A+x b+} From a presentation: The Structure of Polyhedra, by G. Indik This is taken from a super nice set of slides, The Structure of Polyhedra, by Gabriel Indik, for a course CAS 746 Advanced Topics in Combinatorial Optimization in 2006 at McMaster University; url to it is horrible, so Google the data above. Decomposition of Polyhedra
If P is convex and bounded (polytope), then its minimal representation is given by: P = conv.hull{x1,,xn} From a presentation: The Structure of Polyhedra, by G. Indik This is taken from a super nice set of slides, The Structure of Polyhedra, by Gabriel Indik, for a course CAS 746 Advanced Topics in Combinatorial Optimization in 2006 at McMaster University; url to it is horrible, so Google the data above. The set of points {x1,,xn} are the extremal points (vertices faces of dimension 0) of the polytope. Lineality Space and Reduction to Pointed Polyhedra
Another, more compact, summary of the outcome of the previous set of slides from Indik. From Zieglers Lectures on Polytopes (Springer GTM 1995) V-Repn vs. H Repn V-repn vs. H-repn of Polytopes V-Description in polymake
H-Description in polymake
Some Slides of Code/Output Output: Polytope for Exercise 1 (w/out centroid)
polytope > $p=new Polytope; polytope > $p->POINTS= $p=new Polytope; polytope > $p->POINTS= 1 1/3 1/3 1/3 1/3 1/3 1/3 polytope (4)> 1 1/2 1/4 1/4 1/4 1/4 1/2 polytope (5)> 1 1/4 1/2 1/4 1/4 1/2 1/4 polytope (6)> . Input: Polytope for Exercise 1 (w/ centroid)
$p=new Polytope; $p->POINTS=