Permuting Polygons
      Thomas Henderson

      Under the direction of
        Dr. Paul Latiolais

         Second reader
          Dr. Bin Jiang
types of
polygons
a polygon is simple if it
         does not self-intersect.




simple
a polygon is simple if it
         does not self-intersect.




simple
               not simple
a polygon is simple if it
         does not self-intersect.




simple                           really not
                                 simple
               not simple
a polygon is convex if, given two points in the polygon, the
line segment joining them is also in the polygon.
a polygon is convex if, given two points in the polygon, the
line segment joining them is also in the polygon.




        convex
a polygon is convex if, given two points in the polygon, the
line segment joining them is also in the polygon.




        convex
a polygon is convex if, given two points in the polygon, the
line segment joining them is also in the polygon.




        convex
a polygon is convex if, given two points in the polygon, the
line segment joining them is also in the polygon.




                                        not convex
        convex
a polygon is star-shaped if all points in the
polygon can be seen from some point in the
polygon's interior.
a polygon is star-shaped if all points in the
polygon can be seen from some point in the
polygon's interior.




                     k
a polygon is star-shaped if all points in the
polygon can be seen from some point in the
polygon's interior.




                     k
a polygon is star-shaped if all points in the
polygon can be seen from some point in the
polygon's interior.




                     k             k is in the
                                   kernel of the
                                   polygon.
this polygon is NOT star-shaped.
this polygon is NOT star-shaped.
this polygon is NOT star-shaped.
this polygon is NOT star-shaped.
the kernel is empty.
a polygon can be oriented by adding a
direction to every edge.
a polygon can be oriented by adding a
consistent direction to every edge.
a polygon can be oriented by adding a
consistent direction to every edge.




      the polygon is oriented (clockwise).
edge swaps
let P be a clockwise-oriented,
star-shaped polygon.

let a and b be edges of P which
are adjacent, and which form a
left-hand turn.

let k be a point in the kernel of P.
• the new polygon contains
  the old one
• the new polygon contains
  the old one
• the new polygon contains
  the old one
• the new polygon contains
  the old one
• the new polygon contains
  the old one
• the new kernel contains
  the old one
• the new polygon contains
  the old one
• the new kernel contains
  the old one
• the new polygon is star-
  shaped
convexification
Problem: Given a star-
shaped polygon, can you
make it a
convex polygon by
swapping edges?
Problem: Given a star-
shaped polygon, can you
make it a
convex polygon by
swapping edges?
          no, seriously: can you?
Instructions:

• Make a star-shaped polygon.
• Turn it into a convex polygon.
  You may ONLY swap adjacent
  edges!
Instructions:

• Make a star-shaped polygon.
• Turn it into a convex polygon.
  You may ONLY swap adjacent
  edges!




      go!
The Convexification Algorithm
The Convexification Algorithm
 Traverse the polygon in the
 direction it is oriented. When you
 come to a turn:

 • if the turn is a RHT, do nothing
   and continue
 • if the turn is a LHT, swap the
   edges and continue
Theorem: The Convexification
Algorithm will convexify any
star-shaped polygon.
The Idea of the Proof:
Show that any two edges
of any star-shaped
polygon will be swapped
at most once.
let P be a clockwise-oriented, star-shaped
polygon.

let a and b be edges of P which are adjacent.

let k be a point in the kernel of P.

let L be a line through k, and parallel to a.
Case 1: a and b form a RHT
Case 1: a and b form a RHT
Case 1: a and b form a RHT




   ZERO
   SWAPS
Case 2: a and b form a LHT
Case 2: a and b form a LHT
Case 2: a and b form a LHT
ONE SWAP
?
?? ? ? ?
  ?
?
?? ? ? ?
  ?
           impossible!
if a encounters any
RHTs along the way,
it stops.
if a encounters any
     RHTs along the way,
     it stops.



what if there are ONLY LHTs?
contradiction!
contradiction!
(the polygon was
assumed to be star-
shaped)
analysis of
algorithms
What is the worst possible
behavior of the Convexification
Algorithm?
What is the worst possible
behavior of the Convexification
Algorithm?
Suppose P has n sides. If the
       algorithm must swap every side
       with every other side, the number
       of swaps is


(n - 1) + (n - 2) + ... + 2 + 1

    = n(n - 1)/2

    = n2 /2 - n/2
Suppose P has n sides. If the
       algorithm must swap every side
       with every other side, the number
       of swaps is


(n - 1) + (n - 2) + ... + 2 + 1

    = n(n - 1)/2                      2

    = n2 /2 - n/2
                                  O(n )
2
(n - 3) + (n - 4) + ... + 2 + 1

   = (n - 3)(n - 2)/2

   = 1/2n2 - 5/2n + 3




                                     2
                                  O(n )
Permuting Polygons

Permuting Polygons

  • 1.
    Permuting Polygons Thomas Henderson Under the direction of Dr. Paul Latiolais Second reader Dr. Bin Jiang
  • 2.
  • 3.
    a polygon issimple if it does not self-intersect. simple
  • 4.
    a polygon issimple if it does not self-intersect. simple not simple
  • 5.
    a polygon issimple if it does not self-intersect. simple really not simple not simple
  • 6.
    a polygon isconvex if, given two points in the polygon, the line segment joining them is also in the polygon.
  • 7.
    a polygon isconvex if, given two points in the polygon, the line segment joining them is also in the polygon. convex
  • 8.
    a polygon isconvex if, given two points in the polygon, the line segment joining them is also in the polygon. convex
  • 9.
    a polygon isconvex if, given two points in the polygon, the line segment joining them is also in the polygon. convex
  • 10.
    a polygon isconvex if, given two points in the polygon, the line segment joining them is also in the polygon. not convex convex
  • 11.
    a polygon isstar-shaped if all points in the polygon can be seen from some point in the polygon's interior.
  • 12.
    a polygon isstar-shaped if all points in the polygon can be seen from some point in the polygon's interior. k
  • 13.
    a polygon isstar-shaped if all points in the polygon can be seen from some point in the polygon's interior. k
  • 14.
    a polygon isstar-shaped if all points in the polygon can be seen from some point in the polygon's interior. k k is in the kernel of the polygon.
  • 15.
    this polygon isNOT star-shaped.
  • 16.
    this polygon isNOT star-shaped.
  • 17.
    this polygon isNOT star-shaped.
  • 18.
    this polygon isNOT star-shaped. the kernel is empty.
  • 19.
    a polygon canbe oriented by adding a direction to every edge.
  • 20.
    a polygon canbe oriented by adding a consistent direction to every edge.
  • 21.
    a polygon canbe oriented by adding a consistent direction to every edge. the polygon is oriented (clockwise).
  • 22.
  • 26.
    let P bea clockwise-oriented, star-shaped polygon. let a and b be edges of P which are adjacent, and which form a left-hand turn. let k be a point in the kernel of P.
  • 31.
    • the newpolygon contains the old one
  • 32.
    • the newpolygon contains the old one
  • 33.
    • the newpolygon contains the old one
  • 34.
    • the newpolygon contains the old one
  • 35.
    • the newpolygon contains the old one • the new kernel contains the old one
  • 36.
    • the newpolygon contains the old one • the new kernel contains the old one • the new polygon is star- shaped
  • 37.
  • 38.
    Problem: Given astar- shaped polygon, can you make it a convex polygon by swapping edges?
  • 39.
    Problem: Given astar- shaped polygon, can you make it a convex polygon by swapping edges? no, seriously: can you?
  • 40.
    Instructions: • Make astar-shaped polygon. • Turn it into a convex polygon. You may ONLY swap adjacent edges!
  • 41.
    Instructions: • Make astar-shaped polygon. • Turn it into a convex polygon. You may ONLY swap adjacent edges! go!
  • 44.
  • 45.
    The Convexification Algorithm Traverse the polygon in the direction it is oriented. When you come to a turn: • if the turn is a RHT, do nothing and continue • if the turn is a LHT, swap the edges and continue
  • 46.
    Theorem: The Convexification Algorithmwill convexify any star-shaped polygon.
  • 47.
    The Idea ofthe Proof: Show that any two edges of any star-shaped polygon will be swapped at most once.
  • 48.
    let P bea clockwise-oriented, star-shaped polygon. let a and b be edges of P which are adjacent. let k be a point in the kernel of P. let L be a line through k, and parallel to a.
  • 49.
    Case 1: aand b form a RHT
  • 50.
    Case 1: aand b form a RHT
  • 51.
    Case 1: aand b form a RHT ZERO SWAPS
  • 52.
    Case 2: aand b form a LHT
  • 53.
    Case 2: aand b form a LHT
  • 54.
    Case 2: aand b form a LHT
  • 55.
  • 56.
  • 57.
    ? ?? ? ?? ? impossible!
  • 63.
    if a encountersany RHTs along the way, it stops.
  • 64.
    if a encountersany RHTs along the way, it stops. what if there are ONLY LHTs?
  • 67.
  • 68.
  • 69.
  • 70.
    What is theworst possible behavior of the Convexification Algorithm?
  • 72.
    What is theworst possible behavior of the Convexification Algorithm?
  • 73.
    Suppose P hasn sides. If the algorithm must swap every side with every other side, the number of swaps is (n - 1) + (n - 2) + ... + 2 + 1 = n(n - 1)/2 = n2 /2 - n/2
  • 74.
    Suppose P hasn sides. If the algorithm must swap every side with every other side, the number of swaps is (n - 1) + (n - 2) + ... + 2 + 1 = n(n - 1)/2 2 = n2 /2 - n/2 O(n )
  • 76.
  • 77.
    (n - 3)+ (n - 4) + ... + 2 + 1 = (n - 3)(n - 2)/2 = 1/2n2 - 5/2n + 3 2 O(n )