convex hull representation conversion cddlib and lrslib
play

Convex Hull Representation Conversion: cddlib and lrslib Niklas - PowerPoint PPT Presentation

Convex Hull Representation Conversion: cddlib and lrslib Niklas Pfister ETH Contents 1 Introduction Polytopes Minkowski-Weyl Theorem V- and H-Representation 2 Theoretical Algorithms Representation Conversion Problem Incremental Algorithm


  1. Convex Hull Representation Conversion: cddlib and lrslib Niklas Pfister ETH

  2. Contents 1 Introduction Polytopes Minkowski-Weyl Theorem V- and H-Representation 2 Theoretical Algorithms Representation Conversion Problem Incremental Algorithm Pivoting Algorithm 3 Implementations cddlib and lrslib Input Implementation Details (cddlib) Examples GNU GMP Additional Functionality 4 References ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 2 / 24

  3. Polytopes Definition (convex polytope/polyhedron) Let A 2 R m ⇥ d and b 2 R m , then a convex polyhedron P corresponding to the pair ( A , b ) is defined as P := { x 2 R d : Ax  b } . We call P a convex polytope if P is bounded. ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 3 / 24

  4. Polytopes Example The square S given by 2 S = { x 2 R 2 : � 1  x 1  1.5 1 1 , � 1  x 2  1 } can be 0.5 represented using the following 0 ( A , b ) pair: − 0.5 0 1 0 1 0 1 1 − 1 � 1 0 1 B C B C − 1.5 A = A , b = B C B C 0 1 1 − 2 @ @ A − 2 − 1.5 − 1 − 0.5 0 0.5 1 1.5 2 0 � 1 1 ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 4 / 24

  5. Minkowski-Weyl Theorem Theorem (Minkowski-Weyl) For a subset P of R d , the following statements are equivalent: (i) P is a Polyhedron, i.e., there exist A 2 R m ⇥ d and b 2 R m such that P := { x 2 R d : Ax  b } . (ii) P is finitely generated, i.e., there exist finitely many vectors v i ’s and r j ’s such that P = conv ( { v 1 , . . . , v s } ) + cone ( { r 1 , . . . , r t } ). ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 5 / 24

  6. Minkowski-Weyl Theorem Remarks conv denotes the convex hull, i.e. X conv ( { v 1 , . . . , v s } ) := { x : x = a i v i , k a k 1 = 1 and a � 0 } i cone denotes the nonnegative hull, i.e. X cone ( { r 1 , . . . , r t } ) := { x : x = λ i r i , λ i � 0 } i (ii) can be equivalently written in matrix form: P is finitely generated, i.e., there exists V 2 R d ⇥ s and R 2 R d ⇥ t for some s and t such that P := { x : x = V µ + R λ , µ � 0 , k µ k 1 = 1 , λ � 0 } . ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 6 / 24

  7. V- and H-Representation The Minkowski-Weyl theorem suggests the following definition: Definition (H- and V-Representation) A polyhedron has H-Representation if it is given in the form (i) (Halfspace-representation) A polyhedron has V-Representation if it is given in the form (ii) (Vertex-representation) ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 7 / 24

  8. V- and H-Representation Example (continued) S is given in H-representation 2 by 1.5 1 S = { x 2 R 2 : Ax  b } . 0.5 0 S is given in V-representation − 0.5 by − 1 − 1.5 S = conv ( { (1 , 1) , (1 , � 1) , − 2 − 2 − 1.5 − 1 − 0.5 0 0.5 1 1.5 2 ( � 1 , � 1) , (1 , � 1) } ) . ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 8 / 24

  9. V- and H-Representation Question How can we convert between the two representations of a Polyhedron? This problem of computing a (minimal) V-representation from an H-representation or vice versa is known as the representation conversion problem for polyhedra. It can be shown using the concept of dual polytopes that switching from the V-representation to the H-representation of a Polyhedron is essentially the same as switching from the V-representation to the H-representation. Therefore an algorithm describing one direction of the conversion will also give the other direction. ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 9 / 24

  10. Contents 1 Introduction Polytopes Minkowski-Weyl Theorem V- and H-Representation 2 Theoretical Algorithms Representation Conversion Problem Incremental Algorithm Pivoting Algorithm 3 Implementations cddlib and lrslib Input Implementation Details (cddlib) Examples GNU GMP Additional Functionality 4 References ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 10 / 24

  11. Representation Conversion Problem An important property of the representation conversion problem is that the size of the output is not easy to measure given the size of the input. For example the d-dimensional cube has 2 d facets and 2 d vertices. Consequently a good algorithm should be sensitive to the output size . Ideally bounded by a polynomial function of both output and input size. be light on the memory usage . Ideally the required memory is bounded by a polynomial of the input size. For the general representation problem no such algorithm exist. However restricted to special classes of polyhedra this is possible. ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 11 / 24

  12. Incremental Algorithm Double Description Method Input: Matrix A 2 R m ⇥ d . Output: Matrix R 2 R d ⇥ n such that ( A , R ) are a DD pair, i.e. the columns of R generate C ( A ) := { x : Ax  0 } . General Step Let K subset of row indices { 1 , 2 , . . . , m } of A and let A k the matrix of the rows of A indexed by K . Assume ( A K , R ) is a DD pair. If A = A K we are done. Else take i not in K and construct the DD pair ( A K + i , R 0 ). ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 12 / 24

  13. Incremental Algorithm How can R 0 be constructed? ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 13 / 24

  14. Incremental Algorithm In what order should the rows be chosen? ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 14 / 24

  15. Pivoting Algorithm ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 15 / 24

  16. Contents 1 Introduction Polytopes Minkowski-Weyl Theorem V- and H-Representation 2 Theoretical Algorithms Representation Conversion Problem Incremental Algorithm Pivoting Algorithm 3 Implementations cddlib and lrslib Input Implementation Details (cddlib) Examples GNU GMP Additional Functionality 4 References ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 16 / 24

  17. Input Inputs for cddlib and lrslib are given in the following form for H-representations and V-representations respectively. ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 17 / 24

  18. Implementation Details typedef st r u c t dd matrixdata ∗ dd MatrixPtr ; typedef st r u c t dd matrixdata { dd rowrange r o w s i z e ; dd rowset l i n s e t ; / ∗ a subset of rows of l i n e a r i t y ( ie , g e n e r a t o r s of l i n e a r i t y space f o r V − r e p r e s e n t a t i o n , and equa tion s f o r H − r e p r e s e n t a t i o n . ∗ / dd colrang e c o l s i z e ; dd RepresentationType r e p r e s e n t a t i o n ; dd NumberType numbtype ; dd Amatrix matrix ; dd LPObjectiveType o b j e c t i v e ; dd Arow rowvec ; } dd MatrixType ; Listing 1: cdd MatrixPtr in cddtypes.h ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 18 / 24

  19. Implementation Details void d d s e t g l o b a l c o n s t a n t s ( void ) initializes global constants such as dd zero and dd purezero void d d f r e e g l o b a l c o n s t a n t s ( void ) frees the global constants again dd MatrixPtr d d P o l y F i l e 2 M a t r i x ( f , dd ErrorType ∗ e r r ) read polyhedra data from stream f into matrixdata and return a pointer to it dd PolyhedraPtr dd DDMatrix2Poly ( dd MatrixPtr matrix , dd ErrorType ∗ e r r ) store the representation given by matrix in a polyhedra data and generate the second representation of *poly ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 19 / 24

  20. Implementation Details dd PolyhedraPtr dd DDMatrix2Poly2 ( dd MatrixPtr matrix , dd RowOrderType roworder , dd ErrorType ∗ e r r ) same as above with the extra argument roworder specifying the insertion order (eg. dd MaxCuto ff , dd LexMin or dd RandomRow) dd MatrixPtr d d C o p y I n e q u a l i t i e s ( dd PolyhedraPtr poly ) copy inequality representation pointed to by poly to matrixdata and return a pointer dd MatrixPtr dd CopyGenerators ( dd PolyhedraPtr poly ) copy generator representation pointed to by poly to matrixdata and return a pointer ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 20 / 24

  21. Examples example showing basic functionality (2-d cube) example demonstrating the importance of the ordering (8-d, 10-d cross polytope) cddlib vs lrslib example, i.e. very degenerate polytope (cddlib good) non degenerate polytope (lrslib good) ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 21 / 24

  22. GMP: Why is this useful? cddlib and lrslib can both be compiled with the GNU GMP library. This allows the conversion of polytopes with rational representation to be converted exact without the use of approximation by floating points. ETH Niklas Pfister Student Seminar in Combinatorics: Mathematical Software October 21, 2014 22 / 24

Recommend


More recommend