Simplex “walk on the vertices of the feasible region” v = current vertex if  neighbor v’ of v with better objective then move to v’

Slides:



Advertisements
Similar presentations
EXAMPLE: X Y Z T 5 VERTICES 6 EDGES S Collection List Set ArrayList LinkedList SortedSet HashSet TreeSet.
Advertisements

Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Approximations of points and polygonal chains
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Jarvis March Graham Scan Chan’s Algorithm
C&O 355 Lecture 4 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
C&O 355 Mathematical Programming Fall 2010 Lecture 20 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
CS16: Introduction to Data Structures & Algorithms
Convex hull smallest convex set containing all the points.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
Dr. Scott Schaefer Clipping Lines. 2/94 Why Clip? We do not want to waste time drawing objects that are outside of viewing window (or clipping window)
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
How should we define corner points? Under any reasonable definition, point x should be considered a corner point x What is a corner point?
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Lecture 3: Reduce to known problem Convex Hull (section 33.3 of CLRS). Suppose we have a bunch of points in the plane, given by their x and y coordinates.
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
ADA: 16. CG Topics1 Objective o an examination of four important CG topics o just a taster of a very large research area Algorithm Design and Analysis.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Vertex Cover, Dominating set, Clique, Independent set
1 CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Reflexive -- First sentence of proof is: (1) Let x  Z (2) Let (x,x)  R. (3) Let (x,x)  I (4) Let x  R.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Fundamental Data Structures and Algorithms Aleks Nanevski April 22, 2004 Computational Geometry.
Algebra 1: Solving Equations with variables on BOTH sides.
Computational Geometry
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
C&O 355 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
C&O 355 Mathematical Programming Fall 2010 Lecture 4 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Computational Geometry (35/33) Line Segments and cross-product Segment intersection and Sweep Line Convex Hull and Graham’s Scan, Jarvis’s march Divide-and-Conquer.
Greatest Common Factor The Greatest Common Factor is the largest number that will divide into a group of numbers Examples: 1.6, , 55 GCF = 3 GCF.
1 Prune-and-Search Method 2012/10/30. A simple example: Binary search sorted sequence : (search 9) step 1  step 2  step 3  Binary search.
Linear Programming Problem. Definition A linear programming problem is the problem of optimizing (maximizing or minimizing) a linear function (a function.
CMPS 3130/6130 Computational Geometry Spring 2015
3.4 – Linear Programming. Ex. 1 Graph the system of inequalities. Name the coordinates of the vertices of the feasible region. Find the max & min values.
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.
Computational Geometry 2D Convex Hulls
A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
CLASSIFYING POLYGONS UNIT 1 LESSON 6. Classifying Polygons In geometry, a figure that lies in a plane is called a plane figure. A polygon is a closed.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
3.4 Linear Programming Objective:
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Computational Geometry
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
3. Polygon Triangulation
Introduction to Polygons
Vertex Cover, Dominating set, Clique, Independent set
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry Capter:1-2.1
Linear Programming CISC4080, Computer Algorithms CIS, Fordham Univ.
Polygon Triangulation
AMS 345/CSE 355 Computational Geometry
Geometry.
Convex Sets & Concave Sets
CISC5835, Algorithms for Big Data
Geometry.
Presentation transcript:

Simplex “walk on the vertices of the feasible region” v = current vertex if  neighbor v’ of v with better objective then move to v’

Simplex “walk on the vertices of the feasible region” vertex = feasible point defined by a collection of d inequalities neighbors = vertices sharing d-1 of the inequalities

Simplex v = current vertex if  neighbor v’ of v with better objective then move to v’ max c T x Ax  b x  0 assume v = (0,...,0) T  i such that c i > 0 iff v is not optimal

Simplex v = current vertex if  neighbor v’ of v with better objective then move to v’ max c T x Ax  b x  0 v’ = (0,..,x i,..,0) T Make x i as big as possible stopper: a j x = b j

Simplex v = current vertex if  neighbor v’ of v with better objective then move to v’ max c T x Ax  b x  0 v’ = (0,..,x i,..,0) T Make x i as big as possible stopper: a j x = b j x i ’ = b j – a j xSubstitute:

Simplex max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 Is (x,y)=(0,0) optimal?

Simplex max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 Let’s increase y as much as we can.

Simplex max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 substitute z=1-(y-x)

Simplex max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 substitute z=1-(y-x) z  0 y  x-z+1

Simplex max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 y  x-z+1 max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1

Simplex max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1 Is (x,z)=(0,0) optimal?

Simplex max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1 Let’s increase x as much as we can.

Simplex max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1 substitute w=1-(x-z)

Simplex max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1 substitute w=1-(x-z) w  0 x  1+z-w

Simplex max 3x-z+1 2x-z  3 z  0 z  1 x-z  1 x  0 z-x  1 x  1+z-w max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2

Simplex max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2 Is (z,w)=(0,0) optimal?

Simplex max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2 Let’s increase z as much as we can.

Simplex max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2 substitute u=1-(z-2w)

Simplex max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2 substitute u=1-(z-2w) u  0 z  1+2w-u

Simplex max 2z-3w+4 z-2w  1 z  0 z  1 w  0 w-z  1 w  2 z  1+2w-u max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2

Simplex max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2 Is (u,w)=(0,0) optimal?

Simplex max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2 Let’s increase w as much as we can.

Simplex max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2 substitute v=2-(2w-u)

Simplex max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2 substitute v=2-(2w-u) v  0 w  1+u/2-v/2

Simplex max w-2u+6 u  0 u-2w  1 2w-u  2 w  0 u-w  2 w  2 w  1+u/2-v/2 max 7-3u/2-v/2 u  0 v  3 v  0 v-u  2 u+v  6 u-v  2

Simplex max 7-3u/2-v/2 u  0 v  3 v  0 v-u  2 u+v  6 u-v  2 Is (u,v)=(0,0) optimal?

Simplex max 7-3u/2-v/2 u  0 v  3 v  0 v-u  2 u+v  6 u-v  2 Is (u,v)=(0,0) optimal? YES 7

Simplex (u,v)=(0,0) w  1+u/2-v/2 = 1 z  1+2w-u = 3 x  1+z-w = 3 y  x-z+1 = 1 (x,y)=(3,1)

Simplex (x,y)=(3,1) max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0 is an optimal solution

Simplex – geometric view (x,y)=(3,1) max 2x+y x+y  4 y-x  1 x-y  2 y  2 x  0 y  0

Getting the first point min c T x Ax=b x  0 min 1 T z A x + z = b x  0 z  0 wlog b  0

Points, lines point = (x,y) line = (x 1,y 1 ),(x 2,y 2 ) 2 points =

Line as a point and a vector point = (x,y) line = (x 1,y 1 ),(x 2 -x 1,y 2 -y 1 ) point and a vector = x 1 +t (x 2 -x 1 ),y 1 +t (y 2 -y 1 )

Is point on a line? point = (x,y) line = (x 1,y 1 ),(x 2,y 2 ) x=x 1 +t (x 2 -x 1 ) y=y 1 +t (y 2 -y 1 )

Is point on a line? point = (x,y) line = (x 1,y 1 ),(x 2,y 2 ) t (x 2 -x 1 )=x-x_1 t (y 2 -y 1 )=y-y_1 x 2 -x 1 x-x 1 y 2 -y 1 y-y 1 ( ) det

Is point on a line? point = (x,y) line = (x 1,y 1 ),(x 2,y 2 ) x 2 -x 1 x-x 1 y 2 -y 1 y-y 1 ( ) det is on if and only if = 0

Is point on a line? x 2 -x 1 x-x 1 y 2 -y 1 y-y 1 ( ) det =0 for x on the line >0 <0

Line segment line segment = (x 1,y 1 ),(x 2,y 2 ) x=x 1 +t (x 2 -x 1 ) y=y 1 +t (y 2 -y 1 ) t  [0,1]

Do two line segments intersect? a 1 =(x 1,y 1 ), a 2 =(x 2,y 2 ) a 3 =(x 3,y 3 ), a 4 = (x 4,y 4 ) a1a1 a2a2 a3a3 a4a4 L1L1 L2L2 a 1 and a 2 on different sides of L 2 a 3 and a 4 on different sides of L 1 or endpoint of a segment lies on the other segment

Many segments, do any 2 intersect? (a 1,b 1 ) (a 2,b 2 )... (a n,b n ) O(n 2 ) algorithm

Many segments, do any 2 intersect? O(n log n) algorithm assume no two points have the same x-coordinate no 3 segments intersect at one point

Sweep algorithm

sort points by the x-coordinate

Sweep algorithm events: insert segment delete segment

Sweep algorithm will find the left-most intersection point the lines are “neighbors on the sweep line”

Sweep algorithm sort the endpoints by x-coord  p 1,...,p 2n T  empty B-tree for i from 1 to 2n do if p i is the left point of a segment s INSERT s into T check if s intersects prev(s) or next(s) in T if p i is the right point of a segment s check if prev(s) interesects next(s) in T DELETE s from T

Area of a simple polygon (x 1,y 1 ) (x 3,y 3 ) (x 2,y 2 )

Area of a simple polygon (x 1,y 1 ),...,(x n,y n )

Area of a simple polygon (x 1,y 1 ),...,(x n,y n ) R=0 for i from 1 to n do R=R+(y i+1 +y i )*(x i+1 -x i ) return |R|/2 (x n+1,y n+1 )=(x 1,y 1 )

Convex hull smallest convex set containing all the points

Convex hull smallest convex set containing all the points

Jarvis march find the left-most point (assume no 3 points colinear) s

Jarvis march find the point that appears most to the right looking from s (assume no 3 points colinear) s

Jarvis march (assume no 3 points colinear) s p find the point that appears most to the right looking from p

Jarvis march (assume no 3 points colinear)

Jarvis march (assume no 3 points colinear)

Jarvis march (assume no 3 points colinear) s  point with smallest x-coord p  s repeat PRINT(p) q  point other than p for i from 1 to n do if i  p and point i to the right of line (p,q) then q  i p  q until p = s