Solving a Nesting Problem using the Collision Free Region

Size: px
Start display at page:

Download "Solving a Nesting Problem using the Collision Free Region"

Transcription

1 Solving a Nesting Problem using the Collision Free Region Master Thesis August 31 th, 2016 Irene Reijntjes Supervisor: dr. ir. C.A.J. Hurkens

2 Abstract This report investigates an irregular shape packing problem, or alternatively a nesting problem. An irregular object is given, which could contain defects. Per object, a set of items is given that consists of at most two different item shapes in different orientations. The goal is to place as many items as possible inside the object, where the items are not allowed to overlap and the defects need to be avoided. This problem is approached by defining a region for every item that corresponds to feasible placements. A few different optimization techniques are applied and compared. These include a bottom-left heuristic and a combination with a branch and bound method. i

3 Acknowledgments The final months of my master, I worked enthusiastically on this project. I would like to thank my supervisor Cor Hurkens for introducing me to Jos van Esch and the project he was working on. Jos introduced me to multiple people and companies that were all working together on this. This gave me great insights in the world of business and how people from different backgrounds can all work together on one project. Furthermore, I would like to thank CQM, and in particular Geert Teeuwen, Judith van Rijswick and Jan van Doremalen for welcoming me with open arms and supporting me during this project. Without your help, I would have never been able to obtain the results presented in this report. I found the brainstorm sessions we had, also with Cor Hurkens, very useful and eye-opening. During the project I was not always confident on whether I would manage to find good results. This increased the satisfaction when I finally did pull it off. ii

4 Contents 1 Introduction Cutting and Packing Problems Nesting Problem Previous Work Data Management Items Convex hull Object Boundary Polygons Defects Inner-Fit Polygon Minkowski difference Algorithm Finding the extreme vertices Finding the intersection points Implementation No-Fit Polygon Minkowski sum Algorithm Collision Free Region Initial CFR CFR algorithm Optimization Algorithm Preprocessing Greedy heuristics Greedy Bottom-Left Heuristic (GBL) Counting Bottom-Left Heuristic (CBL) Branch and Bound Heuristics Bottom-Left and Top-Right (BLTR) Counting Branch and Bound Algorithm (CBNB) Results and Conclusion Results iii

5 7.2 Conclusion Discussion and Recommendations Discussion Recommendations and future work iv

6 Chapter 1 Introduction In this chapter we will give a short introduction to the irregular shape packing problem. Section 1.1 will provide an introduction to the variety of cutting and packing problems. A systematic organization of these problems will be presented. Then, in section 1.2, an introduction will be given to the specific type of problem that is considered in this report. Finally, in section 1.3 previous applied methods for nesting problems are described. In chapter 2, some concepts required for later computations are explained. In chapter 3 it is explained what the inner-fit polygon is and how this concept can be used in the nesting problem. The no-fit polygon is described in chapter 4. Its use in the nesting problem is also explained. Chapter 5 combines the inner-fit polygon and no-fit polygon into the collision free region, which directly corresponds to legal item placements. A few algorithms that will lead to feasible placements using the CFR are given in chapter 6. The results of these algorithms applied to the same input set are given in chapter 7. Finally, chapter 8 discusses the results of the proposed methods and provides recommendations that could improve the algorithms and lead to better solution. 1.1 Cutting and Packing Problems C&P (cutting and packing) problems is a collective name for various problems, that essentially have the same structure but appear under different names in the literature. A few examples of C&P problems include cutting stock, trim loss, bin packing, vehicle loading, nesting and scheduling problems. All these problems have two properties in common. ˆ The input data consists of two groups whose elements define geometric bodies of fixed shapes: the stock, which will be referred to as object from now on; the list of small items, which will be referred to as items. 1

7 ˆ A cutting or packing problem realizes patterns that are geometric combinations of items assigned to objects. This means that every C&P problem consists of two sets of input data: objects and items. While the objectives may be different, the items should always be placed inside the objects without overlapping one another. There is a great variety of C&P problems, each of which with a slightly different objective function. To be able to categorize these problems, a typology has been developed. This is a systematic organization of problems into homogeneous categories on the basis of a given characterizing criteria. It was first described by Dyckhoff [1], and was later improved by Wäscher [2]. The dimension and objective of a C&P problem will be the first property by which the categorization takes place. We distinguish between 1-, 2-, 3- and n-dimensional problems, where n > 3. A 1-dimensional problem would be for example the cutting of bars of certain length (objects), in smaller pieces of given length (items). Cutting out certain patterns (items) from a piece of textile or leather (object) is a 2-dimensional problem. An example of a 3-dimensional problem is vehicle loading, where for instance boxes (items) need to be transported in containers (objects). For the objective function, there is a subdivision into two situations: output maximization and input minimization. In the first situation, a set of small items has to be assigned to a given set of large objects. However, the set of objects is not sufficient for the assignment of all items. Therefore, a subset of items needs to be assigned to the object while maximizing the value. This value is often a measurement for the unused object. An example of a problem with this kind of objective is the knapsack problem. In this situation the object is a knapsack of certain weight capacity, and the items are boxes with a certain value and weight. The goal is to pack as many items as possible without exceeding the capacity of the knapsack and maximize the value of the items packed. In the second situation, the set of objects is sufficient, so all small items can be placed. The goal is now to assign these to a subset of the objects and maximize the value. The bin packing problem is an example of such a problem. We are given items of fixed dimension and objects, the bins, of fixed size. The goal is to find the smallest number of bins necessary so that all items are assigned to a bin. The division into basic categories continues with the next criterion which is the assortment of the items. There are three different cases distinguished: identical items, weakly heterogeneous assortment and strongly heterogeneous assortment. The first category applies when all items are of the same shape and size. The second applies when the items can be grouped into relatively few classes, for which the items are identical with respect to shape and size. Items with identical shape and size but different orientation are considered different kinds of items. Finally, the third category applies when only few items are of the same shape and size. This includes the situation where every item is allowed in any possible orientation. Furthermore, we make a distinction between regular and irregular items. Regular items include rectangles, boxes, circles and balls. 2

8 1.2 Nesting Problem The problem dealt with in this report is 2 dimensional. We are given a set of objects and a set of items. There is a certain demand for every type of item that needs to be met, and it is not required that every object is used. This implies that the objective of the problem is to minimize the input. Namely, there are more objects than necessary for the required items. The next categorization step is the assortment of items. The items are not identical so they form a heterogeneous set. Per object, no more than two types of items may be placed, with a number of allowed orientations. The items form a weakly heterogeneous set. The basic problem type corresponding to these characteristics is the cutting stock problem (CSP). The CSP deals with cutting standardsized objects into pieces of specified size, while minimizing the material wasted. The problem type can be further refined by analyzing the characteristics of the objects, these are not standard-sized. The objects are irregular and can be non-homogeneous. Regular objects are for instance rectangles and circles. An object can be non-homogeneous, because it could contain defects. This can occur in natural products such as leather. Due to these features, the problem is categorized as an irregular cutting stock problem, which is often referred to as the nesting problem. This report concerns a special case of the nesting problem where the objects are available one by one. For every object there is only a subset of items available that are allowed to be placed. This subset contains at most two different types of items. By a different type, we mean an item with a different shape. Items that have the same shape but a different orientation are considered as the same type of item. Per item, approximately 20 different orientations are allowed. In the remainder of this report, we will therefore talk about one object being the input together with a set of items that is allowed to be placed in this specific object. The CSP has been proved to be NP-hard in the strong sense by Garey and Johnson [3]. As a result, solution methodologies utilize heuristics. 1.3 Previous Work A defining characteristic of nesting problems is the requirement to develop powerful geometric tools to handle the wide variety and complexity of shapes that need to be packed. The question that needs to be answered is: Given a position on the object of two items, do they overlap, touch or are they separated?. This question is easily answered for us humans, but turns out to be the first struggle when implementing heuristic algorithms. Over the past years, researchers have proposed a variety of methods, each with their own advantages and disadvantages. Not only the speed is important, but also the complexity of the implementation. The most common approaches are the raster method, direct trigonometry, the no-fit polygon and the phi-function. [4] ˆ Raster Method The raster method approach divides the object into discrete areas. This reduces the geometric information to a grid represented by a matrix. Initially all raster boxes are empty, which corresponds to the zero matrix. 3

9 The placement of an item inside the object sets value 1 to the raster boxes that are covered by the item. Even if the item only covers a small part of the raster box, it is set to be occupied. This leads to inaccuracies, especially for irregular items. To increase accuracy, the size of the raster boxes can be decreased, but this leads to higher computation times. ˆ Direct Trigonometry This method deals with irregular shapes in a better way, since it does not approximate the items, but uses the items themselves. The immediate drawback is that the computational effort is very high. Every time the position of an item is changed, it needs to be tested for overlap with all items that have already been placed again. ˆ No-fit Polygon The no-fit polygon is a region representing the possible translation vectors that can be applied to a polygon such that the polygon does not overlap other (already placed) polygons. It is chosen to use this concept for the overlap detection in this report. Its precise definition and implementation are described in chapter 4. ˆ Phi-functions The phi-function is a mathematical expression that represents the mutual positions of two objects. When the phi-function is normalized, its value is the Euclidean distance between the two items. This property helps us move items in such a way that they touch one another. This happens precisely when their normalized phi-function is equal to 0. The lack of an algorithmic process for generating the phi-functions for arbitrary shapes, is the likely the reason that it has not been broadly applied. The no-fit polygon has become an increasingly popular option since it is more efficient than direct trigonometry, while maintaining the accuracy of this former method since the true items are used. For this reason, it was chosen to use the no-fit polygon in this report over the other available options. 4

10 Chapter 2 Data Management In this chapter the available data and the representation is described. Both the object and all items are required as input, which are all represented by polygons. In turn, a polygon is described by a list of vertices in counterclockwise order. In section 2.1, the further specification of the items will be described. It will be explained in section how the convex hull of a polygon can be obtained efficiently. This algorithm applies to the object as well. Then, in section 2.2, the specifications of the object polygon are given. Finally, in section 2.2.1, it will be explained what boundary polygons are, and how they can be obtained from a polygon and its convex hull. 2.1 Items The item polygons, in contrast to the object polygon, can be freely moved in the plane. The location of an item is entirely defined by the location of its reference point. The reference point of a polygon is defined to be the lower left corner of the axis-aligned minimum bounding box around the polygon. This is equivalent to (x r, y r ), where x r is the smallest x-coordinate occurring in the polygon and y r is the smallest y-coordinate occurring in the polygon. An example of a polygon with corresponding reference point is given in Figure 2.1. The item polygons are provided as polygons with reference point (0, 0). The polygon can then easily be placed with its reference point on any position (x, y) by simply applying the translation (x, y) to all vertices. In general, if the reference point would be (x r, y r ), and the item needs to be placed with its reference point on (x p, y p ), then the translation (x p x r, y p y r ) needs to applied. It is clear that this translation vector is easily obtained when (x r, y r ) = (0, 0), which is why this situation is preferred. When referring to Figure 2.1: An example of a polygon with reference point. 5

11 the placement of an item on a certain position inside the object, we will always mean the placement of the items reference point at this certain position. Another advantage of defining the item polygons with the origin as reference will become clear in section Convex hull For various algorithms that will be explained later on in chapters 3 and 4, the convex hull of the object and item polygons is required. The convex hull of a polygon is the smallest convex set that contains the polygon. A convex set is a set with the property that all points that are on a line segment between two points that are contained in the set, are also contained in the set. A fast algorithm for such a computation has been developed by Melkman, and described in [5]. The input for this algorithm needs to be a simple polygon. This is a polygon with no self-intersecting edges. The object and item polygons are simple and so this algorithm can be applied. The algorithm computes the convex hull of a polygon with n vertices in O(n) time. It starts with three vertices v 0, v 1 and v 2 that form a counterclockwise triangle. In other words, the edge from v 1 to v 2 is a left turn with respect to the edge from v 0 to v 1. These vertices are stored in a deque D, which consists of all vertices that are in the convex hull so far. The first and the last element of a deque, the bottom and top, are the same. In this case D[bot]=D[top]=v 2, D[bot+2]=D[top 1]= v 1 and D[bot+1]=D[top 2]= v 0. This situation is sketched in Figure 2.2. Now the next vertex in the polygon, v 3, is considered. It needs to be checked whether it is contained in the current polygon that is described by the vertices in the deque. This can be done by finding its location with respect to the bottom two vertices of the deque and the top two Figure 2.2: Adding next vertex v 3 to the current convex hull described by the vertices in the deque. vertices of the deque. If both the path D[bot], D[bot+1], v 3 and the path D[top 1], D[top], v 3 make a left turn, then v 3 is already contained in the convex hull described by the deque and we can continue with v 4. To determine whether the edges make a left or right turn, we use the function given in equation (2.1). turn = (x 1 x 0 )(y 2 y 0 ) (x 2 x 0 )(y 1 y 0 ), (2.1) where v 0 = (x 0, y 0 ), v 1 = (x 1, y 1 ) and v 2 = (x 2, y 2 ). There are three possible options for the result: { > 0 if the segment v 1, v 2, v 3 makes a left turn; turn 0 if the segment v 1, v 2, v 3 makes a right turn or is straigt. This is an efficient method for finding the turn of two line segments with respect to one another, without having to compute the exact angle they make. 6

12 If v 3 does not make a left turn with both the top and the bottom of the deque, the vertex needs to be added to the deque on both ends, after possible removal of vertices from the top and bottom. The bottom of the deque is considered first. If D[bot], D[bot+1], v 3 is a right turn, D[bot] needs to be erased and the new D[bot] is D[bot+1]. Now, it needs to be checked again whether the edges make a left turn. This is repeated until the bottom three vertices make a left turn. In the example shown in Figure 2.2, the path v 2, v 0, v 3 makes a right turn, implying that the bottom vertex is removed. Now D[bot]=v 0 and D[bot+1]=v 1. This implies that D[bot], D[bot+1], v 3 is equal to v 0, v 1, v 3. The corresponding edges make a left turn indeed, and hence D[bot]=v 3, D[bot+1]=v 0 and D[bot+2]=v 1. Now it needs to be checked whether the top vertices form a left turn. If D[top 1], D[top], v 3 is a left turn, we are done and we put D[top]=v 3. If it is a right turn, D[top] is erased and the new D[top]=D[top 1]. This is repeated until the three current vertices make a left turn. In the situation shown in Figure 2.2, the top vertices form a left turn so we can simply add v 3 as D[top]. This yields the following final deque from bottom to top: v 3, v 0, v 1, v 2, v 3. This process is repeated until every vertex of the input polygon is visited exactly once. It is checked whether it needs to be added and if it does, it will be added twice, while other vertices in the deque could be removed once. Therefore, the running of this algorithm to compute the convex hull of a simple polygon is O(n), where n is the number of vertices of the input polygon. 2.2 Object The object polygon has a certain fixed location in the plane, so it cannot be moved or translated. This polygon is therefore not required to have its reference point on the origin. The coordinates of the vertices directly correspond to the location in the plane. The convex hull of the object is useful, which can be computed using the algorithm presented in section Boundary Polygons Working with the convex hull instead of the true polygon has the disadvantage that it could be the case that is not accurate enough for computations. This happens especially when the difference between the actual object polygon and its convex hull is large. It could result in the incorrect placement of items. If an item is contained in the convex hull of the object, this does not imply that the item is also contained in the object polygon itself. We can work around this issue, by storing the boundary polygons. How these boundary polygons can be used in the nesting algorithm will become clear in chapter 5. Consider a polygon A and its convex hull CH(A). Then the set of boundary polygons will be represented by A = A \ CH(A). In Figure 2.3 an example of an irregular polygon is shown. Its convex hull is bounded by the blue line and the set of boundary polygons consists of all polygons filled with red. 7

13 These boundary polygons can be obtained from A and CH(A). Let w 1,..., w n be the vertices of polygon CH(A). Then the vertices of polygon A are w 1, v 1,1,..., v 1,k1, w 2, v 2,1,..., v 2,k2, w 3,..., w n, v n,1,..., v n,kn. Here k i is the number of vertices of polygon A between vertex w i and w i+1. It could be the case that there is no boundary polygon between two successive vertices of CH(A). In that case k i = 0, which corresponds to the situation where two successive vertices of A are both in CH(A). The boundary polygon A i, between w i and w i+1 is given by the vertices w i, v i,1,..., v i,ki, w i+1. The set of boundary polygons for A is A = {A 1,..., A n }. Here A n is the boundary polygon between w n and w Defects In certain applications, for instance leather cutting, the object may contain defects, or lower quality regions. These need to Figure 2.3: Example of an irregular polygon with its convex hull and set of boundary polygons. be avoided when placing the items inside the object. How this can be dealt with in the algorithm, will be explained in chapter 4. The defects are given by either polygons or lines, depending on whether the defect is a hole or a crack. Lower quality regions can be defined by a polygon as well. 8

14 Chapter 3 Inner-Fit Polygon In this chapter, the use of the IFP (Inner-Fit Polygon) will be explained. The IFP is a polygon describing the possible translation vectors for the placement of items inside an object. Since the items are located in such a way that their reference point is the origin, these translation vectors directly indicate the placement of the item. Whenever an item is placed with its reference point inside or on the boundary of the IFP, it is located inside the object or touching its boundary. This is illustrated in Figure 3.1, where the items are placed with their reference point on the boundary of the IFP, resulting in the items touching the boundary of the object. Note that instead if the actual object, its convex hull is used. (a) (b) (c) (d) Figure 3.1: Examples of the IFP: the region in blue is the inner-fit polygon for the items with the convex hull of the objects. The bottom-left corner of the grey box corresponds to the reference point. 9

15 This is an important concept for a nesting problem. If the IFP can be determined, it is not necessary to check for intersection between an item and the object. Since these geometric checks can be both difficult and time consuming, the use of the IFP is is preferred. In section 3.1, the relation between the Minkowski difference and the IFP is described. In section 3.2 the algorithm to compute the IFP will be described. 3.1 Minkowski difference The IFP of two polygons can be calculated using the Minkowski difference. Definition 3.1 (Minkowski Difference). A B = b B A b, (3.1) where A b = {a + b a A} represents the set A translated by b B. We are interested in the placement of an item B, into an object A, where both A and B are polygons. We claim that the IFP of B into A is given by A ( B). To show that this claim holds, the following theorem needs to be proved. Theorem 3.2. x A ( B) B x A Proof. ( ): Let x A ( B). Then, by definition x {a + b a A}. b B This indicates that x {a + b a A}, b B implying that b B, â A such that x = â + b. Rewriting this expression yields b + x = â which is equivalent to b + x = â, for b B. Note that b + x B x and â A. Since for all elements of polygon B an such an element in polygon A needs to exist, we indeed showed that B x A. ( ): Let B x A. This is equivalent to {b + x b B A}. So every element of the form b + x with b B is an element of A. This indicates that x A b for b B, which is equivalent to x A + b for b B. For all b B, a A such that x = a + b. So x {a + b a A}, b B which is equivalent to x A ( B). In Figure 3.2 an example of the Minkowski difference of two polygons is depicted. Every edge of polygon A is translated by every vertex of polygon B. This results in n new (overlapping) polygons, where n is the number of vertices of B. The intersection of these polygons is the Minkowski difference A B. 10

16 The Minkowski difference represents the feasible set of translation vectors which can be applied to B such that it is contained in polygon A. When the applied translation vector is on one of the edges of the Minkowski difference, then the two polygons touch one another. Due to the fact that the item polygons are located such that their reference point is the origin, the Minkowski difference polygon is placed inside the object polygon, so that it is directly translates into possible placements for polygon B. Figure 3.2: The Minkowski difference of polygons A and B: the intersection of translated line segments of A by vertices of B. As proven in Theorem 3.2, the IFP is related to the Minkowski difference in the sense that IFP AB = A ( B). Hence, the IFP of A and B can be computed using the Minkowski difference. Notice that the input needs to be provided in the correct way. Namely, B is required as input and not B. The first step, before being able to implement the Minkowski difference algorithm, is to determine B from B. Every vertex v i = (x i, y i ) of B is replaced by v i = ( x i, y i ), which results in the mirrored polygon. In order to be consistent, this polygon is translated in such a way that the reference point is the origin. To do so, from the original polygon, the largest x-coordinate, x max, and the largest y-coordinate, y max, are selected. Every vertex of the mirrored polygon is translated by (x max, y max ) to obtain the new polygon of which the origin is its reference point. We will describe an algorithm to compute the Minkowski difference for convex polygons. In fact, it is irrelevant whether polygon B is convex. Namely A ( B) = A ( CH(B)). This is due to the fact that a vertex in a cavity of polygon B cannot be an extreme vertex for any edge of A. From here on, polygon CH(B) will be referred to as B. How to deal with the non-convexity of polygon A will be explained in chapter 5. The algorithm presented in section 3.2 follows the approach provided in [6]. 3.2 Algorithm Firstly, the global structure of the algorithm will be described. Afterwards, the steps will be explained in detail. Input for the algorithm consists of two polygons A and B, where both polygons are convex. These are represented by a list of their vertices, which have to be in counterclockwise ordering. The starting vertex is the vertex with the largest x-coordinate. If there are multiple vertices with that same largest x-coordinate, then the vertex of these with the largest y coordinate is the starting point. Let polygon A consist of the vertices a 0,..., a m 1 with edge a i from a i mod m to a (i+1) mod m, and polygon B consist of the vertices b 0,..., b n 1 with edge bj from b j mod n to b (j+1) mod n. For the remainder of this report mod n will be omitted. 11

17 The algorithm consist of two main steps: 1. For every edge of A, find the corresponding extreme vertex of polygon B. Move all edges a i of A by their corresponding vertex b j of B. New line segments c i = a i b j are obtained; 2. Find the intersection points of the line segments in order to construct the resulting polygon. The steps in the above enumeration will be explained in detail in the sections and respectively Finding the extreme vertices The first step in the algorithm is to find the vertex from B that is the extreme vertex in the outer normal direction n i of a i. This vertex will correspond to the vertex of polygon B that will touch the edge a i, if it is moved as far as possible in the direction n i. This vertex can be found by looking at the direction of the edges of polygon A and B with respect to one another. The correct edge is the first edge of B that is not making a right turn relative to the current edge of A. The relative direction of edge a i = (a i, a i+1 ) and edge b i = (b i, b i+1 ) is computed by det( a i, b j ) = a i b i a i+1 b i+1 = a ib i+1 a i+1 b i. (3.2) There are three possible options for the direction: < 0 if b j is to the right with resprect to a i det( a i, b j ) > 0 if b j is to the left with resprect to a i = 0 if b j is parallel to a i Vertex b j is the extreme point for edge a i if and only if b j is the first edge of polygon B not making a right turn compared with a i. Equivalently, if it is the first edge of polygon B for which det( a i, b j ) 0. The starting point for both polygons is the point with the largest x-coordinate. For the first edge of these polygons, there are two options. Either edge b 0 is the correct edge, or it is not. If it is the correct edge, vertex b 0 is the extreme vertex of a 0. A new edge c 0 is defined by c 0 = a 0 b 0 = (a 0 b 0, a 1 b 0 ) and we continue with a 1. If it was not the correct edge, we continue with b 1. We keep doing this, until the correct edge is found. If an edge of B is visited and is not the matching edge for the current edge a i, it cannot be the matching edge of any other edge from A that has not been visited yet. This follows from the convexity of the polygons and the fact that the vertices are traversed in counterclockwise ordering, starting with the rightmost points. If an edge from B is skipped, we move to the next edge. This edge is always a left turn compared to the previous visited edge, implying that one of the next edges has to provide the correct extreme vertex. Once an edge from polygon B is skipped, it does not have to be revisited, since it is impossible for it to be an extreme vertex for any other edge of polygon A. This process is repeated until there is a matching vertex from polygon B for 12

18 every edge from polygon A. The algorithm loops over all edges of polygon A and all edges of polygon B once. This gives rise to a computational complexity of O(m + n), where m is the number of vertices of polygon A and n is the number of vertices of polygon B Finding the intersection points We have now obtained m oriented line segments c 0,..., c m 1 that can be used to obtain the IFP. The IFP is the set of points that is left from, or on all the line segments c i. Not all line segments will be in the IFP, as can be seen in Figure 3.3. The correct IFP can be determined by finding intersection points between the line segments. The method described below follows the implementation presented in chapter 7.2 from [7]. Consider two line segments v = (a, b) and w = (c, d). Define det(a, b) = x a y b y a x b. Let det1 = det(b a, c d), then det1 = 0 if and only if the two line segments are parallel. If det1 is non-zero, there can be an intersection point. In order to find the intersection point if there is one, two other determinants need to be computed. Define t = det(c a, c d) and u = det(b a, c a) and t u det1 let t = det1 and u =. There is an intersection point between the two line segments if and only if 0 t, u 1. If this condition holds, the intersection point is give by p = a (1 t ) + b t. The pseudocode for this algorithm is given in algorithm 1. The output consists of a Boolean variable together with a point. If there is an intersection point, the function returns the value true, together with the intersection point. If there is no intersection point, the function returns false and a dummy point. 3.3 Implementation Figure 3.3: An example of the translated line segments from which the IFP is obtained. Although the algorithm consists of two different steps, it is possible to cover both these steps in the same iteration loop. This is done by storing the matching vertex of polygon B together with the corresponding edge of polygon A. For every vertex of polygon B we store a list of translated edges of polygon A that match with this vertex. The first list that is found, is added to a list that could eventually describe the IFP. As soon as a second list is found, the intersection point between these lists is determined if there is one. Assume that there is a list of vertices a i,..., a j 1 corresponding to vertex b i, and a list of vertices a j,..., a k corresponding to vertex b j. Here, b j is not necessarily the direct successor of b i, since not all vertices of polygon B are extreme vertices. Every time a path of line segments for a vector from B is found, we will determine whether there is an intersection point with a previous path of line segment. Let the list that has already been processed be B1 and the current list to be processed be B2. We start looking for an intersection point between the last edge b 1 of the first 13

19 Algorithm 1 Find the intersection point between two line segments if it exists 1: function findintersectionpoint( v, w) Input: Two line segments v = (a, b) and w = (c, d). Output: A Boolean variable indicating whether there is an intersection point. If there is one, it is returned, if there is no, a dummy point is returned 2: det1 det(b a, c d) 3: if det1 is nonzero then 4: t det(c a,c d) det1 5: u det(b a,c a) det1 6: if 0 t, u 1 then 7: result a (1 t) + b t 8: return (true, result) 9: else 10: return (f alse, a) 11: end if 12: else 13: return (f alse, a) 14: end if 15: end function list B1 and the first edge b 2 of the last list B2. These two line segments will be tested for intersection using the function 1. If there is no intersection point between these segments, one of the two needs to be removed. Which of the two line segments, will be decided by investigating the direction of the second edge with respect to the first. Let b 1 = (v 1, v 2 ) and b 2 = (w 1, w 2 ). Let e 1 = (v 1, w 1 ) and e 2 = (v 1, w 2 ). Now, we compute d 1 = det( b 1, e 1 ) and d 2 = det( b 1, e 2 ) using the function presented in equation (3.2). We make a distinction between six different outcome scenarios: 1. d 1 = 0 2. d 2 = 0 3. d 1 d 2 < 0 i.e. the signs are different (a) d 1 < 0, d 2 > 0 (b) d 1 > 0, d 2 < 0 4. d 1 d 2 > 0 i.e. the signs are the same (a) d 1 > 0, d 2 > 0 (b) d 1 < 0, d 2 < 0 For case 1, a possible situation is depicted in Figure 3.4a. The edges of interest are s 5 from B1 and t 1 from B2. The starting point of t 1, w 1, is on the line extending s 5. By convexity, the endpoint of t 1, w 2, is left of this line. Since no intersection point was found between the line segments s 5 and t 1, w 1 is located either after v 6 or before v 5. If the former is the case, there will be no intersection between the paths. Therefore, it does not matter which of the two segments will be erased. If the latter is the case, edge t 1 could be the edge providing for the intersection. Imagine for example that w 2 would not be present. Then the 14

20 intersection point will be caused by the line segment from w 1 to w 3 and the segment from v 3 to v 4. This indicates that s 5 should be removed, since this segment cannot cause an intersection point between the two paths. (a) (b) Figure 3.4: Visualization of situations that could occur for respectively case 1 and case 2. For case 2, a possible situation is depicted in Figure 3.4b. The edges of interest are s 5 from B1 and t 1 from B2. The endpoint of t 1, w 2, is on the line extending s 5. It follows by convexity that the starting point of t 1, w 1, is right of this line. Since no intersection point was found between the line segments s 5 and t 1, w 2 is located either after v 6 or before v 5. If the former is the case, there can be no intersection between the two paths, so it is irrelevant which edge is removed. If the latter is the case, edge t 1 cannot be causing an intersection point since all other edges of path B1 are left of the extended line from s 5. Therefore, edge t 1 is erased in this situation. If case 3 applies, there is another subdivision into two options. Option 3a, implying that the starting point of b 2 is to the right of b 1 while the endpoint of b 2 is to the left. In this situation b 1 has to be removed. The other option is case 3b. This corresponds to the starting point of b 2 being left of b 1 while the endpoint is right. This cannot occur in the setting we have, so whenever the signs of d 1 and d 2 are different, we can erase b 1. Lastly, we have case 4, which applies if d 1 and d 2 have the same sign. It is again split up into two options. Either case 4a applies, indicating that b 2 is completely to the left of b 1. Or case 4b applies, meaning that b 2 is completely to the right of b 1. In the problem setting we have here, the former case can not occur. Hence, whenever d 1 and d 2 have the same sign, b 2 is to the right of b 1 leading to the decision to erase b2. Summarizing, there are two options: ˆ b 1 is erased, this occurs for case 1 and for case 3; ˆ b 2 is erased, this occurs for case 2 and for case 4. The pseudocode for the algorithm that decides which of the line segments needs to be erased is presented in algorithm 2. 15

21 Algorithm 2 Determine the location of two non-intersecting line segments with respect to one another to decide which one to erase. 1: function findlocation( v, w) Input: Two line segments v = (a, b) and w = (c, d). Output: A Boolean variable indicating which line segments needs to be removed. 2: arc v 3: arc1 c a 4: arc2 d a 5: dir1 det(arc, arc1) 6: dir2 det(arc, arc2) 7: if det1 = 0 then 8: location f alse 9: else if det2 = 0 then 10: location true 11: else if det1 det2 < 0 then 12: location f alse 13: else 14: location true 15: end if 16: return location 17: end function To further clarify this procedure, two paths are displayed in Figure 3.5, where the goal is to find the intersection point. Here B1 is the directed path from vertex v 1 to vertex v 6, and B2 is the directed path form vertex w 1 to w 5. Notice that these edges are translated edges from the convex polygon A by their corresponding extreme vertex from polygon B. This implies that every edge within the path makes a left turn with respect to its predecessor edge. Since the edges that form B2 are traversed after the edges from B1, the first edge of B2 makes a left turn with respect to the last edge of B1. This fact helps us decide which of the edges to erase if no intersection point is found between the two. In Figure 3.5a, the edges of interest are s 5 from path B1 and t 1 from B2. The extended line from segment s 5 is drawn to visualize the location of t 1 with respect to s 5. It can be seen that both w 1 and w 2 are on the same side (right) of the line. This corresponds to situation 4 leading to the removal of edge t 1. In Figure 3.5b this edge is removed and the new edge of interest for path B2 is t 2. Now, w 2 is on the other side of the line compared to w 3. Now case 3 applies and hence, s 5 will be removed. The new situation is depicted in Figure 3.5c with edges of interest s 4 and t 2. The extended line from s 4 is drawn and it can be seen that both w 2 and w 3 are on the same side of this line. Here, edge t 2 is removed since the situation that applies is case 4. In Figure 3.5d the edge of interest for path B2 is t 3. Its starting point w 3 is to the right of the line extending s 4 and its endpoint w 4 is to the left of this same line. This implies that case 3 applies which leads to the removal of s 4. This removal induces the situation shown in Figure 3.5e. The edges of interest are s 3 and t 3. These line segments give rise to an intersection point which ends the procedure. In the list where B1 is stored, the last element is erased (in this example this corresponds 16

22 to v 4 ). Then the intersection point is added, followed by all vertices of B2 except the first (in this case w 3 ). As soon as the list is added we move back to the procedure explained section This process will be repeated until all edges of polygon A and all vertices of polygon B have been visited. It could occur that there is no intersection point between two paths. The function that is trying to find the intersection between the paths, will terminate whenever one of the paths is empty. Depending on which of the paths became empty, the algorithm should proceed with either one of them. If B1 is empty, this implies that B2 is left of B1, indicating that B1 cannot be part of the IFP. So, B2 is now saved as the current IFP and the process continues by finding the next list of translated line segments. If on the other hand B2 is empty, this list can simply be skipped since it is to the right compared to B1 and therefore cannot be part of the IFP. Due to the convexity we are certain to find an IFP when all paths are processed. When the last edge of polygon A is reached, the IFP needs to be closed. This is done by finding an intersection point between the front and the back of the list of IFP vertices that we have. If there is no intersection point between the first and the last line segment, either one of them is erased, depending on the location. This is repeated until an intersection point is found. Again, due to convexity, there will be an intersection point. Hence, we have constructed the IFP for two convex polygons in an efficient manner. 17

23 Algorithm 3 Computing the IFP for two convex polygons. 1: function MinkowskiDifference(A,B ) Input: Two convex polygons A and B starting with the rightmost vertex Output: The inner-fit polygon of A and B, computed using IFP=A B 2: Initialize vertexa, vertexb, arca and arcb as the first elements 3: while not all arcs of polygon A are traversed do 4: direction det(arca, arcb) 5: if direction 0 then 6: The starting point of arcb is the extreme vertex for arca 7: arcc (arcaf rom vertexb, arcat o vertexb) 8: add arcc to list of vertexb and go to next arca and vertexa 9: else 10: The correct extreme vertex is not found 11: B2 list corresponding to vertexb 12: if this is the first list found then 13: add it to list of possibleif P 14: else 15: while B2 has not been added do 16: B1 possibleif P 17: b1 last arc of B1, b2 first arc of B2 18: (bool, point) findintersectionpoint(b1, b2) 19: while no intersection do 20: boollocation findlocation(b1, b2) 21: erase b1 or b2 depending on boollocation 22: if B1 is empty then 23: possibleif P B2 24: addedb2 true 25: end if 26: if B2 is empty then 27: addedb2 true 28: end if 29: end while 30: there is an intersection point 31: add point and remaining vertices of B2 to possibleif P 32: addedb2 true 33: end while 34: end if 35: end if 36: go to the next arcb and vertexb 37: end while 38: find intersection between first and last line segments to obtain IFP 39: return IFP 40: end function 18

24 (a) Extend line segment s 5 to visualize the location of t 1 with respect to s 5. (b) Edge t 1 is removed, new edge of interest for B2 is t 2. Investigate its location with respect to s 5. (c) Edge s 5 is removed, new edge of interest for B1 is s 4. (d) Investigate the location of t 2 with respect to s 4. (e) Edge t 2 is removed, new edge of interest for B2 is t 3. Investigate its location with respect to s 4. (f) Edge s 4 is removed, intersection point is found between s 3 and t 3. Figure 3.5: Determining the intersection point between line segments by repeatedly erasing an edge if no intersection point is found. 19

25 Chapter 4 No-Fit Polygon In this chapter, the NFP (No-Fit Polygon) will be explained. The NFP is a polygon describing the feasible locations for two polygons such that they do not overlap. Whenever an item is placed with its reference point on the boundary or outside the NFP, it can be concluded that the two polygons do not overlap. So the NFP will help us placing the items close to one another without overlap. An example is shown in Figure 4.1. Here, the black polygon is fixed and another polygon is placed without overlapping the black polygon if its reference point is located outside or on the NFP, which is the red polygon. If the concept of the NFP is used, it is not necessary to perform geometric checks to determine overlap. The NFP of two convex polygons can be constructed efficiently. In section 4.1, the relation between the Minkowski sum and the NFP is described. In section 4.2 the algorithm to compute the NFP will be described. (a) (b) (c) (d) Figure 4.1: Examples of the NFP: the item in black is the fixed item and the items in blue are the free items. The no-fit polygon of the two is shown in red. The bottom-left corner of the grey boxes corresponds to the reference point. 20

26 For the NFP of polygon B that moves freely around polygon A, we use the notation NFP AB. If polygon B is placed on the boundary of NFP AB, the polygons A and B are touching. If it is placed in the interior of NFP AB, the polygons overlap. And if the polygon is placed on on the exterior of NFP AB, then there is no overlap between the polygons. 4.1 Minkowski sum Just as the IFP is equivalent to the Minkowski difference, the NFP is equivalent to the Minkowski sum. Definition 4.1 (Minkowski Sum). A B = b B A b, (4.1) where A b = {a + b a A} represents the set A translated by b. Say that we would like to place two items A and B without overlap. Here, A is the fixed polygon which has been placed already and B is the free polygon, which can be moved around. We claim that the NFP of A and B is given by A ( B). To show that this claim holds, the following theorem is proved. Theorem 4.2. x A ( B) A B x Proof. ( ): Let x A ( B). Then, by definition x {a + b a A}. b B This indicates that b B such that x = a b, a A. Thus, a = b + x, indicating that both a A and a B x. This implies that A B x. ( ): Let y A B x, so we have y A and y B x. This means that b B such that y = b + x. From this, it follows that x = y b = y + ( b) = y + b. Since b B we know that b = b B. Hence, y + b A ( B) so x A ( B). In Figure 4.2 an example of the Minkowski sum of two polygons is depicted. Every edge of polygon A is translated by every vertex of polygon B. This results in n new (overlapping) polygons, where n is the number of vertices of B. The union of these polygons if the Minkowski sum A B. The Minkowski sum represents the set of translation vectors which, when applied to the free polygon B, result in polygons A and B overlapping. Figure 4.2: The Minkowski sum of polygons A and B: the union of translated line segments of A by vertices of B. 21

27 Hence, the set of feasible translation vector consists of all translation vector except the ones contained in the Minkowski sum polygon. This polygon can be translated in such a way the the polygon directly represent the set of unfeasible placements positions of polygon B. This happens automatically when the reference point of polygon B is the origin. As proven in Theorem 4.2, the NFP is related to the Minkowski sum in the sense that NFP AB = A ( B). Hence, the NFP of A and B can be computed using the Minkowski sum. Notice that the input needs to be provided in a correct way. Just as for the IFP, the input needed is B instead of B. However, B itself is needed to determine the location of the NFP with respect to the fixed polygon A. The reversion of B to B will take place in the algorithm itself so that both polygons can be used for calculations. Since a lot of the translated vertices will be in the interior of the NFP, it is unnecessary to compute the additions of all vertices. Because it is also very time consuming, there has been a lot of research to find better and faster methods for the NFP construction. In the case that both polygons are convex, which will be assumed for now, there is an easy method running in O(m + n) time, where m and n are the number of vertices for polygon A and polygon B respectively. 4.2 Algorithm We use the same notation as before for the polygons A, B and their vertices and edges. Polygon A is the fixed polygon and is located with its reference point on the origin. Then polygon B, the free polygon moves around polygon A where the path of its reference point describes the NFP. This path can be constructed by simply putting the edges of polygon A and B = B in increasing slope order. The first step is to find the correct location of the NFP with respect to fixed polygon A. This is done by placing polygon B in a position where it touches polygon A. Let vertex p B y min be the vertex of B with smallest y-coordinate (if there are more than one, the vertex among these with the smallest x-coordinate). Furthermore, let vertex p A y max be the vertex of A with largest y-coordinate (if there are more than one, the vertex among these with the largest x-coordinate). By letting these two vertices, p A y max and p B y min touch one another, we have found a feasible placement where polygons A and B are touching and not overlapping. The reference point of polygon B is added to the list of NFP vertices. From here on we can start adding arcs to the NFP. The list of edges for polygon A is ordered so that the polygon is traversed in the counterclockwise direction and the first edge is the one with starting point p A y max. Since NFP AB is computed by A B, we need the edges of polygon B. Polygon B is constructed by mirroring all vertices (and translating the polygon such that the reference point is the origin). For the NFP construction we only need the edges of the polygon and are not interested in its precise location. Therefore, this translation is not necessary. The edges of polygon B are ordered such that the first edge is the one with starting point p B y max. 22

An improved method for calculating the no-fit polygon

An improved method for calculating the no-fit polygon Computers & Operations Research 33(2006) 1521 1539 www.elsevier.com/locate/cor An improved method for calculating the no-fit polygon Hamish T. Dean, Yiliu Tu, John F. Raffensperger 200 Armagh Street, P.O.

More information

3 No-Wait Job Shops with Variable Processing Times

3 No-Wait Job Shops with Variable Processing Times 3 No-Wait Job Shops with Variable Processing Times In this chapter we assume that, on top of the classical no-wait job shop setting, we are given a set of processing times for each operation. We may select

More information

Line segment intersection. Family of intersection problems

Line segment intersection. Family of intersection problems CG Lecture 2 Line segment intersection Intersecting two line segments Line sweep algorithm Convex polygon intersection Boolean operations on polygons Subdivision overlay algorithm 1 Family of intersection

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

Computational Geometry

Computational Geometry Lecture 1: Introduction and convex hulls Geometry: points, lines,... Geometric objects Geometric relations Combinatorial complexity Computational geometry Plane (two-dimensional), R 2 Space (three-dimensional),

More information

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Below are some notes and sketches of correct answers for the first homework exam. We have also included the most common mistakes that were

More information

Monotone Paths in Geometric Triangulations

Monotone Paths in Geometric Triangulations Monotone Paths in Geometric Triangulations Adrian Dumitrescu Ritankar Mandal Csaba D. Tóth November 19, 2017 Abstract (I) We prove that the (maximum) number of monotone paths in a geometric triangulation

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points.

Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points. Math 3181 Dr. Franz Rothe Name: All3181\3181_spr13t1.tex 1 Solution of Test I Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points. Definition

More information

Interleaving Schemes on Circulant Graphs with Two Offsets

Interleaving Schemes on Circulant Graphs with Two Offsets Interleaving Schemes on Circulant raphs with Two Offsets Aleksandrs Slivkins Department of Computer Science Cornell University Ithaca, NY 14853 slivkins@cs.cornell.edu Jehoshua Bruck Department of Electrical

More information

γ 2 γ 3 γ 1 R 2 (b) a bounded Yin set (a) an unbounded Yin set

γ 2 γ 3 γ 1 R 2 (b) a bounded Yin set (a) an unbounded Yin set γ 1 γ 3 γ γ 3 γ γ 1 R (a) an unbounded Yin set (b) a bounded Yin set Fig..1: Jordan curve representation of a connected Yin set M R. A shaded region represents M and the dashed curves its boundary M that

More information

Computational Geometry Algorithmische Geometrie

Computational Geometry Algorithmische Geometrie Algorithmische Geometrie Panos Giannopoulos Wolfgang Mulzer Lena Schlipf AG TI SS 2013 !! Register in Campus Management!! Outline What you need to know (before taking this course) What is the course about?

More information

However, this is not always true! For example, this fails if both A and B are closed and unbounded (find an example).

However, this is not always true! For example, this fails if both A and B are closed and unbounded (find an example). 98 CHAPTER 3. PROPERTIES OF CONVEX SETS: A GLIMPSE 3.2 Separation Theorems It seems intuitively rather obvious that if A and B are two nonempty disjoint convex sets in A 2, then there is a line, H, separating

More information

Approximation Algorithms for Geometric Intersection Graphs

Approximation Algorithms for Geometric Intersection Graphs Approximation Algorithms for Geometric Intersection Graphs Subhas C. Nandy (nandysc@isical.ac.in) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India. Outline

More information

ON WEIGHTED RECTANGLE PACKING WITH LARGE RESOURCES*

ON WEIGHTED RECTANGLE PACKING WITH LARGE RESOURCES* ON WEIGHTED RECTANGLE PACKING WITH LARGE RESOURCES* Aleksei V. Fishkin, 1 Olga Gerber, 1 Klaus Jansen 1 1 University of Kiel Olshausenstr. 40, 24118 Kiel, Germany {avf,oge,kj}@informatik.uni-kiel.de Abstract

More information

Pebble Sets in Convex Polygons

Pebble Sets in Convex Polygons 2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

General properties of staircase and convex dual feasible functions

General properties of staircase and convex dual feasible functions General properties of staircase and convex dual feasible functions JÜRGEN RIETZ, CLÁUDIO ALVES, J. M. VALÉRIO de CARVALHO Centro de Investigação Algoritmi da Universidade do Minho, Escola de Engenharia

More information

Framework for Design of Dynamic Programming Algorithms

Framework for Design of Dynamic Programming Algorithms CSE 441T/541T Advanced Algorithms September 22, 2010 Framework for Design of Dynamic Programming Algorithms Dynamic programming algorithms for combinatorial optimization generalize the strategy we studied

More information

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI February 7, 009 Second Round Three Hours (1) An equilateral triangle is inscribed in a circle which is circumscribed by a square. This square is inscribed in

More information

General Methods and Search Algorithms

General Methods and Search Algorithms DM811 HEURISTICS AND LOCAL SEARCH ALGORITHMS FOR COMBINATORIAL OPTIMZATION Lecture 3 General Methods and Search Algorithms Marco Chiarandini 2 Methods and Algorithms A Method is a general framework for

More information

MISCELLANEOUS SHAPES

MISCELLANEOUS SHAPES MISCELLANEOUS SHAPES 4.1. INTRODUCTION Five generic shapes of polygons have been usefully distinguished in the literature: convex, orthogonal, star, spiral, and monotone. 1 Convex polygons obviously do

More information

1 Appendix to notes 2, on Hyperbolic geometry:

1 Appendix to notes 2, on Hyperbolic geometry: 1230, notes 3 1 Appendix to notes 2, on Hyperbolic geometry: The axioms of hyperbolic geometry are axioms 1-4 of Euclid, plus an alternative to axiom 5: Axiom 5-h: Given a line l and a point p not on l,

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined

More information

On the Minimum Number of Convex Quadrilaterals in Point Sets of Given Numbers of Points

On the Minimum Number of Convex Quadrilaterals in Point Sets of Given Numbers of Points On the Minimum Number of Convex Quadrilaterals in Point Sets of Given Numbers of Points Hu Yuzhong Chen Luping Zhu Hui Ling Xiaofeng (Supervisor) Abstract Consider the following problem. Given n, k N,

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality Planar Graphs In the first half of this book, we consider mostly planar graphs and their geometric representations, mostly in the plane. We start with a survey of basic results on planar graphs. This chapter

More information

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls 1/60 Geometric Algorithms Lecture 1: Introduction Convex Hulls Geometric algorithms scope 2/60 Geometry algorithms (practice): Study of geometric problems that arise in various applications and how algorithms

More information

2017 SOLUTIONS (PRELIMINARY VERSION)

2017 SOLUTIONS (PRELIMINARY VERSION) SIMON MARAIS MATHEMATICS COMPETITION 07 SOLUTIONS (PRELIMINARY VERSION) This document will be updated to include alternative solutions provided by contestants, after the competition has been mared. Problem

More information

Triangulation and Convex Hull. 8th November 2018

Triangulation and Convex Hull. 8th November 2018 Triangulation and Convex Hull 8th November 2018 Agenda 1. Triangulation. No book, the slides are the curriculum 2. Finding the convex hull. Textbook, 8.6.2 2 Triangulation and terrain models Here we have

More information

The Art Gallery Problem: An Overview and Extension to Chromatic Coloring and Mobile Guards

The Art Gallery Problem: An Overview and Extension to Chromatic Coloring and Mobile Guards The Art Gallery Problem: An Overview and Extension to Chromatic Coloring and Mobile Guards Nicole Chesnokov May 16, 2018 Contents 1 Introduction 2 2 The Art Gallery Problem 3 2.1 Proof..................................

More information

The Geometry of Carpentry and Joinery

The Geometry of Carpentry and Joinery The Geometry of Carpentry and Joinery Pat Morin and Jason Morrison School of Computer Science, Carleton University, 115 Colonel By Drive Ottawa, Ontario, CANADA K1S 5B6 Abstract In this paper we propose

More information

The Geodesic Integral on Medial Graphs

The Geodesic Integral on Medial Graphs The Geodesic Integral on Medial Graphs Kolya Malkin August 013 We define the geodesic integral defined on paths in the duals of medial graphs on surfaces and use it to study lens elimination and connection

More information

Symmetric Product Graphs

Symmetric Product Graphs Rochester Institute of Technology RIT Scholar Works Theses Thesis/Dissertation Collections 5-20-2015 Symmetric Product Graphs Evan Witz Follow this and additional works at: http://scholarworks.rit.edu/theses

More information

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube Kavish Gandhi April 4, 2015 Abstract A geodesic in the hypercube is the shortest possible path between two vertices. Leader and Long

More information

Intersection of an Oriented Box and a Cone

Intersection of an Oriented Box and a Cone Intersection of an Oriented Box and a Cone David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International

More information

The Helly Number of the Prime-coordinate Point Set

The Helly Number of the Prime-coordinate Point Set The Helly Number of the Prime-coordinate Point Set By KEVIN BARRETT SUMMERS SENIOR THESIS Submitted in partial satisfaction of the requirements for Highest Honors for the degree of BACHELOR OF SCIENCE

More information

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Art Gallery Problems and Polygon Triangulation EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified

More information

Triangulation by Ear Clipping

Triangulation by Ear Clipping Triangulation by Ear Clipping David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To

More information

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0). CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find

More information

Computational Geometry

Computational Geometry Lecture 12: Lecture 12: Motivation: Terrains by interpolation To build a model of the terrain surface, we can start with a number of sample points where we know the height. Lecture 12: Motivation: Terrains

More information

COMPUTING CONSTRAINED DELAUNAY

COMPUTING CONSTRAINED DELAUNAY COMPUTING CONSTRAINED DELAUNAY TRIANGULATIONS IN THE PLANE By Samuel Peterson, University of Minnesota Undergraduate The Goal The Problem The Algorithms The Implementation Applications Acknowledgments

More information

On Multi-Stack Boundary Labeling Problems

On Multi-Stack Boundary Labeling Problems On Multi-Stack Boundary Labeling Problems MICHAEL A. BEKOS 1, MICHAEL KAUFMANN 2, KATERINA POTIKA 1, ANTONIOS SYMVONIS 1 1 National Technical University of Athens School of Applied Mathematical & Physical

More information

Simple Graph. General Graph

Simple Graph. General Graph Graph Theory A graph is a collection of points (also called vertices) and lines (also called edges), with each edge ending at a vertex In general, it is allowed for more than one edge to have the same

More information

Acute Triangulations of Polygons

Acute Triangulations of Polygons Europ. J. Combinatorics (2002) 23, 45 55 doi:10.1006/eujc.2001.0531 Available online at http://www.idealibrary.com on Acute Triangulations of Polygons H. MAEHARA We prove that every n-gon can be triangulated

More information

Restricted-Orientation Convexity in Higher-Dimensional Spaces

Restricted-Orientation Convexity in Higher-Dimensional Spaces Restricted-Orientation Convexity in Higher-Dimensional Spaces ABSTRACT Eugene Fink Derick Wood University of Waterloo, Waterloo, Ont, Canada N2L3G1 {efink, dwood}@violetwaterlooedu A restricted-oriented

More information

Scan Scheduling Specification and Analysis

Scan Scheduling Specification and Analysis Scan Scheduling Specification and Analysis Bruno Dutertre System Design Laboratory SRI International Menlo Park, CA 94025 May 24, 2000 This work was partially funded by DARPA/AFRL under BAE System subcontract

More information

G 6i try. On the Number of Minimal 1-Steiner Trees* Discrete Comput Geom 12:29-34 (1994)

G 6i try. On the Number of Minimal 1-Steiner Trees* Discrete Comput Geom 12:29-34 (1994) Discrete Comput Geom 12:29-34 (1994) G 6i try 9 1994 Springer-Verlag New York Inc. On the Number of Minimal 1-Steiner Trees* B. Aronov, 1 M. Bern, 2 and D. Eppstein 3 Computer Science Department, Polytechnic

More information

Estimating the Free Region of a Sensor Node

Estimating the Free Region of a Sensor Node Estimating the Free Region of a Sensor Node Laxmi Gewali, Navin Rongratana, Jan B. Pedersen School of Computer Science, University of Nevada 4505 Maryland Parkway Las Vegas, NV, 89154, USA Abstract We

More information

Exploring Domains of Approximation in R 2 : Expository Essay

Exploring Domains of Approximation in R 2 : Expository Essay Exploring Domains of Approximation in R 2 : Expository Essay Nicolay Postarnakevich August 12, 2013 1 Introduction In this paper I explore the concept of the Domains of Best Approximations. These structures

More information

Discrete Mathematics Lecture 4. Harper Langston New York University

Discrete Mathematics Lecture 4. Harper Langston New York University Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a

More information

arxiv: v2 [cs.cg] 3 May 2015

arxiv: v2 [cs.cg] 3 May 2015 Contact Representations of Graphs in 3D Md. Jawaherul Alam, William Evans, Stephen G. Kobourov, Sergey Pupyrev, Jackson Toeniskoetter, and Torsten Ueckerdt 3 arxiv:50.00304v [cs.cg] 3 May 05 Department

More information

Partitioning Orthogonal Polygons by Extension of All Edges Incident to Reflex Vertices: lower and upper bounds on the number of pieces

Partitioning Orthogonal Polygons by Extension of All Edges Incident to Reflex Vertices: lower and upper bounds on the number of pieces Partitioning Orthogonal Polygons by Extension of All Edges Incident to Reflex Vertices: lower and upper bounds on the number of pieces António Leslie Bajuelos 1, Ana Paula Tomás and Fábio Marques 3 1 Dept.

More information

Abstract We proved in this paper that 14 triangles are necessary to triangulate a square with every angle no more than 72, answering an unsolved probl

Abstract We proved in this paper that 14 triangles are necessary to triangulate a square with every angle no more than 72, answering an unsolved probl Acute Triangulation of Rectangles Yibin Zhang Hangzhou Foreign Languages School Xiaoyang Sun Hangzhou Foreign Languages School Zhiyuan Fan Hangzhou Xuejun High School 1 Advisor Dongbo Lu Hangzhou Foreign

More information

2 Geometry Solutions

2 Geometry Solutions 2 Geometry Solutions jacques@ucsd.edu Here is give problems and solutions in increasing order of difficulty. 2.1 Easier problems Problem 1. What is the minimum number of hyperplanar slices to make a d-dimensional

More information

coding of various parts showing different features, the possibility of rotation or of hiding covering parts of the object's surface to gain an insight

coding of various parts showing different features, the possibility of rotation or of hiding covering parts of the object's surface to gain an insight Three-Dimensional Object Reconstruction from Layered Spatial Data Michael Dangl and Robert Sablatnig Vienna University of Technology, Institute of Computer Aided Automation, Pattern Recognition and Image

More information

The Full Survey on The Euclidean Steiner Tree Problem

The Full Survey on The Euclidean Steiner Tree Problem The Full Survey on The Euclidean Steiner Tree Problem Shikun Liu Abstract The Steiner Tree Problem is a famous and long-studied problem in combinatorial optimization. However, the best heuristics algorithm

More information

Translational Placement using Simulated Annealing and Collision Free Region with Parallel Processing

Translational Placement using Simulated Annealing and Collision Free Region with Parallel Processing Translational Placement using Simulated Annealing and Collision Free Region with Parallel Processing André Kubagawa Sato, Rogério Yugo Takimoto, Thiago de Castro Martins, Marcos de Sales Guerra Tsuzuki

More information

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Tutte s Theorem: How to draw a graph

Tutte s Theorem: How to draw a graph Spectral Graph Theory Lecture 15 Tutte s Theorem: How to draw a graph Daniel A. Spielman October 22, 2018 15.1 Overview We prove Tutte s theorem [Tut63], which shows how to use spring embeddings to obtain

More information

Straight-Line Drawings of 2-Outerplanar Graphs on Two Curves

Straight-Line Drawings of 2-Outerplanar Graphs on Two Curves Straight-Line Drawings of 2-Outerplanar Graphs on Two Curves (Extended Abstract) Emilio Di Giacomo and Walter Didimo Università di Perugia ({digiacomo,didimo}@diei.unipg.it). Abstract. We study how to

More information

Prime Time (Factors and Multiples)

Prime Time (Factors and Multiples) CONFIDENCE LEVEL: Prime Time Knowledge Map for 6 th Grade Math Prime Time (Factors and Multiples). A factor is a whole numbers that is multiplied by another whole number to get a product. (Ex: x 5 = ;

More information

AtCoder World Tour Finals 2019

AtCoder World Tour Finals 2019 AtCoder World Tour Finals 201 writer: rng 58 February 21st, 2018 A: Magic Suppose that the magician moved the treasure in the order y 1 y 2 y K+1. Here y i y i+1 for each i because it doesn t make sense

More information

Some Open Problems in Graph Theory and Computational Geometry

Some Open Problems in Graph Theory and Computational Geometry Some Open Problems in Graph Theory and Computational Geometry David Eppstein Univ. of California, Irvine Dept. of Information and Computer Science ICS 269, January 25, 2002 Two Models of Algorithms Research

More information

The National Strategies Secondary Mathematics exemplification: Y8, 9

The National Strategies Secondary Mathematics exemplification: Y8, 9 Mathematics exemplification: Y8, 9 183 As outcomes, Year 8 pupils should, for example: Understand a proof that the sum of the angles of a triangle is 180 and of a quadrilateral is 360, and that the exterior

More information

Straight-line Drawability of Embedded Graphs

Straight-line Drawability of Embedded Graphs Straight-line Drawability of Embedded Graphs Hiroshi Nagamochi Department of Applied Mathematics and Physics, Kyoto University, Yoshida Honmachi, Sakyo, Kyoto 606-8501, Japan. nag@amp.i.kyoto-u.ac.jp Abstract:

More information

Theoretical Computer Science

Theoretical Computer Science Theoretical Computer Science 408 (2008) 129 142 Contents lists available at ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs Drawing colored graphs on colored points

More information

The statement implies that any three intersection points of two distinct planes lie on a line.

The statement implies that any three intersection points of two distinct planes lie on a line. Math 3181 Dr. Franz Rothe February 23, 2015 All3181\3181_spr15ts1.tex 1 Solution of Test Name: Problem 1.1. The second part of Hilbert s Proposition 1 states: Any two different planes have either no point

More information

Basic Definitions and Concepts Complement to the Prologue and to Chapter 1, Respecting the Rules

Basic Definitions and Concepts Complement to the Prologue and to Chapter 1, Respecting the Rules Basic s and Concepts Complement to the Prologue and to Chapter 1, Respecting the Rules 1. CHAINS, CYCLES AND CONNECTIVITY Take out a sheet of paper, choose a few spots, and mark those spots with small

More information

layers in a raster model

layers in a raster model layers in a raster model Layer 1 Layer 2 layers in an vector-based model (1) Layer 2 Layer 1 layers in an vector-based model (2) raster versus vector data model Raster model Vector model Simple data structure

More information

Delaunay Triangulations. Presented by Glenn Eguchi Computational Geometry October 11, 2001

Delaunay Triangulations. Presented by Glenn Eguchi Computational Geometry October 11, 2001 Delaunay Triangulations Presented by Glenn Eguchi 6.838 Computational Geometry October 11, 2001 Motivation: Terrains Set of data points A R 2 Height ƒ(p) defined at each point p in A How can we most naturally

More information

2 Solution of Homework

2 Solution of Homework Math 3181 Name: Dr. Franz Rothe February 6, 2014 All3181\3181_spr14h2.tex Homework has to be turned in this handout. The homework can be done in groups up to three due February 11/12 2 Solution of Homework

More information

Lofting 3D Shapes. Abstract

Lofting 3D Shapes. Abstract Lofting 3D Shapes Robby Prescott Department of Computer Science University of Wisconsin Eau Claire Eau Claire, Wisconsin 54701 robprescott715@gmail.com Chris Johnson Department of Computer Science University

More information

Course Number: Course Title: Geometry

Course Number: Course Title: Geometry Course Number: 1206310 Course Title: Geometry RELATED GLOSSARY TERM DEFINITIONS (89) Altitude The perpendicular distance from the top of a geometric figure to its opposite side. Angle Two rays or two line

More information

Shippensburg Math & Computer Day 2013 Individual Math Contest Solutions

Shippensburg Math & Computer Day 2013 Individual Math Contest Solutions Shippensburg Math & Computer Day 2013 Individual Math Contest Solutions 1. Row n of Pascal s Triangle lists all the coefficients of the expansion of (1 + x) n. What is the smallest value of n for which

More information

And Now From a New Angle Special Angles and Postulates LEARNING GOALS

And Now From a New Angle Special Angles and Postulates LEARNING GOALS And Now From a New Angle Special Angles and Postulates LEARNING GOALS KEY TERMS. In this lesson, you will: Calculate the complement and supplement of an angle. Classify adjacent angles, linear pairs, and

More information

EULER S FORMULA AND THE FIVE COLOR THEOREM

EULER S FORMULA AND THE FIVE COLOR THEOREM EULER S FORMULA AND THE FIVE COLOR THEOREM MIN JAE SONG Abstract. In this paper, we will define the necessary concepts to formulate map coloring problems. Then, we will prove Euler s formula and apply

More information

Geometric Computations for Simulation

Geometric Computations for Simulation 1 Geometric Computations for Simulation David E. Johnson I. INTRODUCTION A static virtual world would be boring and unlikely to draw in a user enough to create a sense of immersion. Simulation allows things

More information

Improved Bounds for Intersecting Triangles and Halving Planes

Improved Bounds for Intersecting Triangles and Halving Planes Improved Bounds for Intersecting Triangles and Halving Planes David Eppstein Department of Information and Computer Science University of California, Irvine, CA 92717 Tech. Report 91-60 July 15, 1991 Abstract

More information

Curriki Geometry Glossary

Curriki Geometry Glossary Curriki Geometry Glossary The following terms are used throughout the Curriki Geometry projects and represent the core vocabulary and concepts that students should know to meet Common Core State Standards.

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

Inapproximability of the Perimeter Defense Problem

Inapproximability of the Perimeter Defense Problem Inapproximability of the Perimeter Defense Problem Evangelos Kranakis Danny Krizanc Lata Narayanan Kun Xu Abstract We model the problem of detecting intruders using a set of infrared beams by the perimeter

More information

arxiv: v3 [cs.cg] 16 Jan 2018

arxiv: v3 [cs.cg] 16 Jan 2018 Common Tangents of Two Disjoint Polygons in Linear Time and Constant Workspace arxiv:1601.01816v3 [cs.cg] 16 Jan 2018 MIKKEL ABRAHAMSEN, University of Copenhagen BARTOSZ WALCZAK, Jagiellonian University

More information

Arc-Flow Model for the Two-Dimensional Cutting Stock Problem

Arc-Flow Model for the Two-Dimensional Cutting Stock Problem Arc-Flow Model for the Two-Dimensional Cutting Stock Problem Rita Macedo Cláudio Alves J. M. Valério de Carvalho Centro de Investigação Algoritmi, Universidade do Minho Escola de Engenharia, Universidade

More information

Delaunay Triangulations

Delaunay Triangulations Delaunay Triangulations (slides mostly by Glenn Eguchi) Motivation: Terrains Set of data points A R 2 Height ƒ(p) defined at each point p in A How can we most naturally approximate height of points not

More information

arxiv: v1 [cs.cc] 30 Jun 2017

arxiv: v1 [cs.cc] 30 Jun 2017 Hamiltonicity is Hard in Thin or Polygonal Grid Graphs, but Easy in Thin Polygonal Grid Graphs Erik D. Demaine Mikhail Rudoy arxiv:1706.10046v1 [cs.cc] 30 Jun 2017 Abstract In 2007, Arkin et al. [3] initiated

More information

Central Europe Regional Contest 2016

Central Europe Regional Contest 2016 University of Zagreb Faculty of Electrical Engineering and Computing November 1820, 2016 A: Appearance Analysis.......... 1 B: Bipartite Blanket............. 2 C: Convex Contour............. D: Dancing

More information

A Hybrid Genetic Algorithms and Tabu Search for Solving an Irregular Shape Strip Packing Problem

A Hybrid Genetic Algorithms and Tabu Search for Solving an Irregular Shape Strip Packing Problem A Hybrid Genetic Algorithms and Tabu Search for Solving an Irregular Shape Strip Packing Problem Kittipong Ekkachai 1 and Pradondet Nilagupta 2 ABSTRACT This paper presents a packing algorithm to solve

More information

Minimum-Area Rectangle Containing a Set of Points

Minimum-Area Rectangle Containing a Set of Points Minimum-Area Rectangle Containing a Set of Points David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International

More information

Introduction to Geometry (Autumn Tertm 2012) Exercises 3. Section A. Figure 1

Introduction to Geometry (Autumn Tertm 2012) Exercises 3. Section A. Figure 1 Introduction to Geometry (utumn ertm 2012) Exercises 3 Section 1. Show that in Figure 1(i) below, = (Euclid III.35). p (i) (ii) Figure 1 (iii) 2. What is the angle-sum in a quadrilateral on the sphere,

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

More information

Tangencies between disjoint regions in the plane

Tangencies between disjoint regions in the plane June 16, 20 Problem Definition Two nonoverlapping Jordan regions in the plane are said to touch each other or to be tangent to each other if their boundaries have precisely one point in common and their

More information

Constructive procedures to solve 2-Dimensional Bin Packing Problems with Irregular Pieces and Guillotine Cuts

Constructive procedures to solve 2-Dimensional Bin Packing Problems with Irregular Pieces and Guillotine Cuts Constructive procedures to solve 2-Dimensional Bin Packing Problems with Irregular Pieces and Guillotine Cuts Antonio Martinez a, Ramon Alvarez-Valdes b, Julia Bennell a, Jose Manuel Tamarit b a University

More information

(Refer Slide Time: 00:02:00)

(Refer Slide Time: 00:02:00) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts

More information

ICS 161 Algorithms Winter 1998 Final Exam. 1: out of 15. 2: out of 15. 3: out of 20. 4: out of 15. 5: out of 20. 6: out of 15.

ICS 161 Algorithms Winter 1998 Final Exam. 1: out of 15. 2: out of 15. 3: out of 20. 4: out of 15. 5: out of 20. 6: out of 15. ICS 161 Algorithms Winter 1998 Final Exam Name: ID: 1: out of 15 2: out of 15 3: out of 20 4: out of 15 5: out of 20 6: out of 15 total: out of 100 1. Solve the following recurrences. (Just give the solutions;

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

EXTREME POINTS AND AFFINE EQUIVALENCE

EXTREME POINTS AND AFFINE EQUIVALENCE EXTREME POINTS AND AFFINE EQUIVALENCE The purpose of this note is to use the notions of extreme points and affine transformations which are studied in the file affine-convex.pdf to prove that certain standard

More information

Geometric Steiner Trees

Geometric Steiner Trees Geometric Steiner Trees From the book: Optimal Interconnection Trees in the Plane By Marcus Brazil and Martin Zachariasen Part 2: Global properties of Euclidean Steiner Trees and GeoSteiner Marcus Brazil

More information

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte My Favorite Problems, 4 Harold B Reiter University of North Carolina Charlotte This is the fourth of a series of columns about problems I am soliciting problems from the readers of M&I Quarterly I m looking

More information

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem Chapter 8 Voronoi Diagrams 8.1 Post Oce Problem Suppose there are n post oces p 1,... p n in a city. Someone who is located at a position q within the city would like to know which post oce is closest

More information