1.3. Marco Teórico
1.3.7. El Contrato de Compraventa internacional en el marco de la
1.3.7.5. Transmisión del riesgo
The basic outline of the gift-wrapping method is as follows: rst nd some initial facet of P = conv(S)and the ridges that it contains. Note that a ridge r is the intersection of two facetsf and f0, i.e. we writer= (f, f0). A ridger is called open if only one of its incident
4.6. Facet enumeration 45
facets r = (f,·) is known. As long as there is an open ridge r, perform a gift-wrapping step to discover the other facetf0 and determine the ridges thatf0 contains.
With this method we build the facet graph GP = (F, R) of the polytopeP. The nodes
f ∈F represent the facets ofP and the edges r∈R with r= (f, f0) represent the ridges
connecting two facets. In the context of the gift-wrapping framework we have to deal with three problems (cf. [Sei97]):
(1) how to compute the ridges of the new facetf0, (2) how to maintain the set of open ridges,
(3) how to perform an individual gift-wrapping step. Algorithm 4.1 Finding the convex hull with a BDD
ConvexHullBDD(S)
1: BDD = BuildBDD(S)
2: f1 = FindFirstFacet(S) 3: F ={f1}
4: R = FindRidges(f1)
5: while (∃ open ridger= (f,·)∈R) {
6: f0 = FindNewFacet(f,r, BDD)
7: F =F∪ {f0}
8: R=R∪ FindRidges(f0) }
9: returnF
Our algorithm 4.1 incorporates the BDD structure in a gift-wrapping approach. We start in step 1 with an empty BDD. For every p ∈ S we build a BDD which represents p by its path. In analogy to section 3.2.1 we then build the synthesis of the BDDs with the pairwise or-operator. For the nally resulting BDD,PBDD = conv(S) holds. The time
and space complexity for building the BDDs is naturally bounded by O(|S|d).
In step 2 we have to nd the rst facet f1 of P to start with. Facets are represented
by their normalvector and their right hand side as aTx ≤ b. Be S
c the translation of
the set S in such a way that 0 ∈int(conv(Sc)). Sc can be computed using the center of
conv(S) (we showed in section 4.3.1 how to determine the center ofPBDD). Any vertex of
the polar set Sc∗ of Sc can be used as the normalvector of the rst facet. Such a vertex
can be computed in polynomial time in |S|and d. Note that it is sucient to know the normalvectorasince we can compute the right hand sideband all 0/1 vertices that lie on the facet by optimizing over PBDD according to the linear objective functiona. In section
4.2 we showed, that this reduces to a shortest path problem on the BDD. The value b is given as the optimal value and the shortest paths correspond to the 0/1 points that are tight at the facet.
Be Sr the set of 0/1 points that lie on a ridge r. Since a BDD implicitly represents
0/1 points in a lexicographical order, Sr is lexicographically sorted. Then the ridge r is
uniquely dened by the rst d−1 0/1 points that are anely independent. This fact
Given a facetf we need to know all of its ridges in the steps 4 and 8. We optimize over PBDDaccording to the normalvector off and get the setSf. Iff is simplicial, i.e.|Sf|=d,
alldridges can be enumerated directly. Otherwise we compute all normalvectorsarfor all
ridges off with a sub-algorithm in dimensiond−1(for this purpose we can recursively use
our gift-wrapping approach with a BDD or switch back to other known algorithms like e.g. lexicographical reverse search or double description method). For each normalvectorarwe
calculate Sr via optimization over PBDD. Solving a system of linear equations then gives
us the d−1 anely independent points that are the smallest regarding lexicographical
order in time O |Sr|2d
.
We keep the open ridges in an additional hash-set to answer the query in step 5. The number of open ridges is bounded by the total number of facets of P. Ber a ridge which has been found by FindRidges in step 8. If r is not contained in the hash-set we add it. Otherwise we delete r from the hash-set as we know both facets that are incident to it. Algorithm 4.2 Gift-wrapping with a BDD
FindNewFacet(f,r, BDD)
1: denea0 ∈Zd,b0∈
Z,p∈ {0,1}d andp0∈ {0,1}d
2: p= 0/1 point contained inf but not contained inr
3: a0 =- normalvector of f 4: (p0, b0) =ShortestPath(a0, BDD) 5: while (a0Tp6=b0) { 6: p=p0 7: a0 =ComputeNormalvector(r,p) 8: (p0, b0) =ShortestPath(a0, BDD) } 9: return (a0Tx≤b0)
The sub-routine FindNewFacet in step 6 is explained in detail in our algorithm 4.2. We use the fact that all d−1 points contained in the ridge r together with a 0/1 point p ∈ S which is not contained in r dene a hyperplane. We start with the given facet f and rotate it around the ridger until a new facet f0 is found. A new point p is found by optimizing overPBDDin timeO(|S|d). We have to rotate at most|S|times before we nd
a new facet (but in practice just a few rotations are needed). Computing a normalvector of the hyperplane dened byr andpis done via solving a system of linear equations. This is possible in O d2
since r is xed and we can do a precomputation once which costs
O d3
. So the overall runtime of algorithm 4.2 is O d3+|S|(|S|d+d2) .
If the polytope is simplicial, all steps of our algorithm 4.1 can be performed in time polynomial ind,|S|and |F|. So in that case our algorithm is output-sensitive.