99
Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs 1 Tamara Mchedlidze · Darren Strash Computational Geometry Lecture INSTITUT F ¨ UR THEORETISCHE INFORMATIK · FAKULT ¨ AT F ¨ UR INFORMATIK Applications of WSPD & Visibility Graphs 25.01.2016

Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs1

Tamara Mchedlidze · Darren Strash

Computational Geometry Lecture

INSTITUT FUR THEORETISCHE INFORMATIK · FAKULTAT FUR INFORMATIK

Applications of WSPD & Visibility Graphs

25.01.2016

Page 2: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs2

Recall: Well-Separated Pair Decomposition

Def: A pair of disjoint point sets A and B in Rd is calleds-well separated for some s > 0, if A and B can eachbe covered by a ball of radius r whose distance is atleast sr.

≥ sr

r

rA

B

A′

B′

r′

r′≥ sr′

Page 3: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs2

Recall: Well-Separated Pair Decomposition

Def: A pair of disjoint point sets A and B in Rd is calleds-well separated for some s > 0, if A and B can eachbe covered by a ball of radius r whose distance is atleast sr.

Def: For a point set P and some s > 0 an s-well separatedpair decomposition (s-WSPD) is a set of pairsA1, B1, . . . , Am, Bm with

Ai, Bi ⊂ P for all iAi ∩Bi = ∅ for all i⋃m

i=1 Ai ⊗Bi = P ⊗ PAi, Bi s-well separated for all i

Page 4: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs2

Recall: Well-Separated Pair Decomposition

Def: A pair of disjoint point sets A and B in Rd is calleds-well separated for some s > 0, if A and B can eachbe covered by a ball of radius r whose distance is atleast sr.

Def: For a point set P and some s > 0 an s-well separatedpair decomposition (s-WSPD) is a set of pairsA1, B1, . . . , Am, Bm with

Ai, Bi ⊂ P for all iAi ∩Bi = ∅ for all i⋃m

i=1 Ai ⊗Bi = P ⊗ PAi, Bi s-well separated for all i

Thm 3: Given a point set P in Rd and s ≥ 1 we can constructan s-WSPD with O(sdn) pairs in timeO(n log n + sdn).

Page 5: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs3

Further Applications of WSPD

Page 6: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs4

Euclidean MST

Problem:Given a point set P find a minimum spanning tree(MST) in the Euclidean graph EG(P ).

Page 7: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs4

Euclidean MST

Problem:Given a point set P find a minimum spanning tree(MST) in the Euclidean graph EG(P ).

Prim: MST in a graph G = (V,E) can becomputed in O(|E|+ |V | log |V |) time.

Page 8: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs4

Euclidean MST

Problem:Given a point set P find a minimum spanning tree(MST) in the Euclidean graph EG(P ).

Prim: MST in a graph G = (V,E) can becomputed in O(|E|+ |V | log |V |) time.

EG(P ) has Θ(n2) edges ⇒ running time O(n2) :-((1 + ε)-spanner for P has O(n/εd) edges⇒ running time O(n log n + n/εd) :-)

Page 9: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs4

Euclidean MST

Problem:Given a point set P find a minimum spanning tree(MST) in the Euclidean graph EG(P ).

Prim: MST in a graph G = (V,E) can becomputed in O(|E|+ |V | log |V |) time.

EG(P ) has Θ(n2) edges ⇒ running time O(n2) :-((1 + ε)-spanner for P has O(n/εd) edges⇒ running time O(n log n + n/εd) :-)

How good is the MST of a (1 + ε)-spanner?

Page 10: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs4

Euclidean MST

Problem:Given a point set P find a minimum spanning tree(MST) in the Euclidean graph EG(P ).

Prim: MST in a graph G = (V,E) can becomputed in O(|E|+ |V | log |V |) time.

EG(P ) has Θ(n2) edges ⇒ running time O(n2) :-((1 + ε)-spanner for P has O(n/εd) edges⇒ running time O(n log n + n/εd) :-)

How good is the MST of a (1 + ε)-spanner?

Thm 5: The MST obtained from a (1 + ε)-spanner of P is a(1 + ε)-approximation of the EMST of P .

Page 11: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs5

Diameter of P

Problem: Find the diameter of a point set P (i.e., the pairx, y ⊂ P with maximum distance).

Page 12: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs5

Diameter of P

Problem: Find the diameter of a point set P (i.e., the pairx, y ⊂ P with maximum distance).

brute-force testing all point pairs ⇒ running time O(n2) :-(test distances ||rep(u) rep(v)|| of all ws-pairs Pu, Pv⇒ running time O(n log n + sdn) :-)

Page 13: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs5

Diameter of P

Problem: Find the diameter of a point set P (i.e., the pairx, y ⊂ P with maximum distance).

brute-force testing all point pairs ⇒ running time O(n2) :-(test distances ||rep(u) rep(v)|| of all ws-pairs Pu, Pv⇒ running time O(n log n + sdn) :-)

How good is the computed diameter?

Page 14: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs5

Diameter of P

Problem: Find the diameter of a point set P (i.e., the pairx, y ⊂ P with maximum distance).

brute-force testing all point pairs ⇒ running time O(n2) :-(test distances ||rep(u) rep(v)|| of all ws-pairs Pu, Pv⇒ running time O(n log n + sdn) :-)

How good is the computed diameter?

Thm 6:The diameter obtained from an s-WSPD of P fors = 4/ε is a (1 + ε)-approximation of the diameter of P .

Page 15: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs6

Closest Pair of Points

Problem: Find the pair x, y ⊂ P with minimum distance.

18

Page 16: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs6

Closest Pair of Points

Problem: Find the pair x, y ⊂ P with minimum distance.

brute-force testing all point pairs⇒ running time O(n2) :-(test distances ||rep(u) rep(v)|| of all ws-pairs Pu, Pv⇒ running time O(n log n + sdn) :-)

18

Page 17: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs6

Closest Pair of Points

Problem: Find the pair x, y ⊂ P with minimum distance.

brute-force testing all point pairs⇒ running time O(n2) :-(test distances ||rep(u) rep(v)|| of all ws-pairs Pu, Pv⇒ running time O(n log n + sdn) :-)

Exercise: For s > 2 this actually yields the closest pair.

18

Page 18: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

Page 19: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

WSPD is useful whenever one can do without knowing all Θ(n2) exactdistances in a point set and approximate them instead. One example areforce-based layout algorithms in graph drawing, where pairwise repulsiveforces of n points need to be calculated.

Page 20: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

WSPD is useful whenever one can do without knowing all Θ(n2) exactdistances in a point set and approximate them instead. One example areforce-based layout algorithms in graph drawing, where pairwise repulsiveforces of n points need to be calculated.

Why approximate geometrically?

Page 21: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

WSPD is useful whenever one can do without knowing all Θ(n2) exactdistances in a point set and approximate them instead. One example areforce-based layout algorithms in graph drawing, where pairwise repulsiveforces of n points need to be calculated.

Why approximate geometrically?

On the one hand, this replaces slow computations by faster (but lessprecise) ones; on the other hand, often the input data are imprecise sothat approximate solutions can be sufficient depending on the application.

Page 22: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

WSPD is useful whenever one can do without knowing all Θ(n2) exactdistances in a point set and approximate them instead. One example areforce-based layout algorithms in graph drawing, where pairwise repulsiveforces of n points need to be calculated.

Can we achieve the same time bounds with exact computations?

Why approximate geometrically?

On the one hand, this replaces slow computations by faster (but lessprecise) ones; on the other hand, often the input data are imprecise sothat approximate solutions can be sufficient depending on the application.

Page 23: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs7

Discussion

What are further applications of the WSPD?

WSPD is useful whenever one can do without knowing all Θ(n2) exactdistances in a point set and approximate them instead. One example areforce-based layout algorithms in graph drawing, where pairwise repulsiveforces of n points need to be calculated.

Can we achieve the same time bounds with exact computations?

In R2 this is often true, but not in Rd for d > 2. (e.g. EMST, diameter)

Why approximate geometrically?

On the one hand, this replaces slow computations by faster (but lessprecise) ones; on the other hand, often the input data are imprecise sothat approximate solutions can be sufficient depending on the application.

Page 24: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs8

Organizational Information

Oral Exams:

Length: 30 minutesDates: Feb. 23, 24, 25; April 12, 13, 14Times: 9, 9:30, 10, 10:30, 11Doodle: Select all time slots that you have available!

Project presentations:

Next week on Feb. 1 and 3.

Please come to our offices and ask questions!

Page 25: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs9

Motion planning and Visibility Graphs

Page 26: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs10

Robot Motion Planning

Problem:Given a (point) robot at position pstart in a area withpolygonal obstacles, find a shortest path to pgoalavoiding obstacles.

Page 27: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs10

Robot Motion Planning

?

Problem:Given a (point) robot at position pstart in a area withpolygonal obstacles, find a shortest path to pgoalavoiding obstacles.

Page 28: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs10

Robot Motion Planning

?

Problem:Given a (point) robot at position pstart in a area withpolygonal obstacles, find a shortest path to pgoalavoiding obstacles.

Ideas?

Page 29: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-1

First Idea: Shortest Paths in Graphs

pgoalpstart

Page 30: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-2

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

pstart

Page 31: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-3

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

pstart

Page 32: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-4

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

pstart

Page 33: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-5

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

pstart

Page 34: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-6

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

Locate start and goal

pstart

Page 35: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-7

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

Locate start and goal

pstart

Shortest path with Dijkstra in G

Page 36: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-8

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

Locate start and goal

pstart

Shortest path with Dijkstra in G

Running time?

Page 37: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-9

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

Locate start and goal

pstart

Shortest path with Dijkstra in Gnot the shortest path!not the shortest path!

Page 38: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs11-10

First Idea: Shortest Paths in Graphs

pgoal

First compute trapezoidal map

Remove segments in obstacles

Nodes in trapezoids and vertical line segments

Euclidean weighted “dual graph” G with nodes on vertical segments

Locate start and goal

pstart

Shortest path with Dijkstra in Gnot the shortest path!not the shortest path!

Page 39: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in S

Page 40: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 41: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 42: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 43: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 44: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 45: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 46: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 47: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 48: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 49: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 50: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 51: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 52: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 53: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 54: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs12

Shortest Paths in Polygonal Areas

s

t

Proof sketch:

Lemma 1: For a set S of disjoint open polygons in R2 and twopoints s and t not in Seach shortest st-path in R2 \

⋃S is a polygonal

path whose internal vertices are vertices of S.

Page 55: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Given a set S of disjoint open polygons...

Page 56: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Given a set S of disjoint open polygons...

...with point set V (S).

Page 57: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Def.: Then Gvis(S) = (V (S), Evis(S)) is the visibility graph of S withEvis(S) = uv | u, v ∈ V (S) and u sees v und w(uv) = |uv|.

Given a set S of disjoint open polygons...

...with point set V (S).

Page 58: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Def.: Then Gvis(S) = (V (S), Evis(S)) is the visibility graph of S withEvis(S) = uv | u, v ∈ V (S) and u sees v und w(uv) = |uv|.

Given a set S of disjoint open polygons...

...with point set V (S).

Where u sees v :⇔ uv ∩⋃S = ∅

Page 59: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Def.: Then Gvis(S) = (V (S), Evis(S)) is the visibility graph of S withEvis(S) = uv | u, v ∈ V (S) and u sees v und w(uv) = |uv|.

Given a set S of disjoint open polygons...

...with point set V (S).

Where u sees v :⇔ uv ∩⋃S = ∅

Define S? = S ∪ s, t and Gvis(S?) analogously.

s

t

Page 60: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs13

Visibility Graph

Def.: Then Gvis(S) = (V (S), Evis(S)) is the visibility graph of S withEvis(S) = uv | u, v ∈ V (S) and u sees v und w(uv) = |uv|.

Given a set S of disjoint open polygons...

...with point set V (S).

Where u sees v :⇔ uv ∩⋃S = ∅

Define S? = S ∪ s, t and Gvis(S?) analogously.

s

t

Lemma 1⇒ A shortest st-path in R2 avoiding obstacles in S is equivalent

to a shortest st-path in Gvis(S?).

Page 61: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs14

Algorithm

ShortestPath(S, s, t)

Input: Obstacles S, points s, t ∈ R2 \⋃S

Output: Shortest collision-free st-path in S1 Gvis ← VisibilityGraph(S ∪ s, t)2 foreach uv ∈ Evis do w(uv)← |uv|3 return Dijkstra(Gvis, w, s, t)

Page 62: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs14

Algorithm

ShortestPath(S, s, t)

Input: Obstacles S, points s, t ∈ R2 \⋃S

Output: Shortest collision-free st-path in S1 Gvis ← VisibilityGraph(S ∪ s, t)2 foreach uv ∈ Evis do w(uv)← |uv|3 return Dijkstra(Gvis, w, s, t)

n = |V (S)|,m = |Evis(S)|

?O(m)

O(n log n + m)

Page 63: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs14

Algorithm

ShortestPath(S, s, t)

Input: Obstacles S, points s, t ∈ R2 \⋃S

Output: Shortest collision-free st-path in S1 Gvis ← VisibilityGraph(S ∪ s, t)2 foreach uv ∈ Evis do w(uv)← |uv|3 return Dijkstra(Gvis, w, s, t)

n = |V (S)|,m = |Evis(S)|

?O(m)

O(n log n + m)

Thm 1: A shortest st-path in an area with polygonal obstacleswith n edges can be computed in O(n2 log n) time.

O(n2 log n)

O(n2 log n)

Page 64: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs15

Computing a Visibility Graph

VisibilityGraph(S)

Input: Set of disjoint polygons SOutput: Visibility graph Gvis(S)

1 E ← ∅2 foreach v ∈ V (S) do3 W ← VisibleVertices(v, S)4 E ← E ∪ vw | w ∈W5 return (V (S), E)

Page 65: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-1

Computing Visible Nodes

VisibleVertices(p, S)p

Page 66: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-2

Computing Visible Nodes

VisibleVertices(p, S)p

Page 67: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-3

Computing Visible Nodes

VisibleVertices(p, S)p

Page 68: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-4

Computing Visible Nodes

VisibleVertices(p, S)p

Problem: Given p and S,find in O(n log n) time allnodes that p sees in V (S)!

Page 69: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-5

Computing Visible Nodes

VisibleVertices(p, S)pr ← p + (k, 0) | k ∈ R+

0 r

Page 70: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-6

Computing Visible Nodes

VisibleVertices(p, S)p

e1

e2

e3

e4

e6

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

e5

Page 71: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-7

Computing Visible Nodes

VisibleVertices(p, S)p

e4

e1

e2

e3

e5

e1 e2 e3 e4

e5 e6

e1

e2

e3

e4

e6

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

T

Page 72: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-8

Computing Visible Nodes

VisibleVertices(p, S)p

e4

e1

e2

e3

e5

e1 e2 e3 e4

e5 e6

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

T

Page 73: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-9

Computing Visible Nodes

VisibleVertices(p, S)p

e4

e1

e2

e3

e5

e1 e2 e3 e4

e5 e6

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

v ≺ v′ :⇔∠v < ∠v′ or(∠v = ∠v′ and |pv| < |pv′|)

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

T

Page 74: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-10

Computing Visible Nodes

VisibleVertices(p, S)p

e4

e1

e2

e3

e5

e1 e2 e3 e4

e5 e6

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

v ≺ v′ :⇔∠v < ∠v′ or(∠v = ∠v′ and |pv| < |pv′|)

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

T

v

∠v

Page 75: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-11

Computing Visible Nodes

VisibleVertices(p, S)p

e4

e1

e2

e3

e5

e1 e2 e3 e4

e5 e6

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

v ≺ v′ :⇔∠v < ∠v′ or(∠v = ∠v′ and |pv| < |pv′|)

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

Sweep method with rotation

T

v

∠v

Page 76: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-12

Computing Visible Nodes

VisibleVertices(p, S)p

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

v

∠v

Page 77: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-13

Computing Visible Nodes

VisibleVertices(p, S)p

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

W ← ∅for i = 1 to n do

if Visible(p, wi) thenW ←W ∪ wi

Add to T edges incident to wi: CW from −→pwi+

Remove from T edges incident to wi:CCW from −→pwi−

return W

v

∠v

Page 78: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-14

Computing Visible Nodes

VisibleVertices(p, S)p

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

W ← ∅for i = 1 to n do

if Visible(p, wi) thenW ←W ∪ wi

Add to T edges incident to wi: CW from −→pwi+

Remove from T edges incident to wi:CCW from −→pwi−

return W

pwi−→pwi

+

−→pwi−

v

∠v

Page 79: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs16-15

Computing Visible Nodes

VisibleVertices(p, S)p

e1

e2

e3

e4

e6

w1, . . . , wn ← sort V (S) incyclic order around p

r ← p + (k, 0) | k ∈ R+0 r

I ← e ∈ E(S) | e ∩ r 6= ∅

T ← balancedBinaryTree(I)e5

W ← ∅for i = 1 to n do

if Visible(p, wi) thenW ←W ∪ wi

Add to T edges incident to wi: CW from −→pwi+

Remove from T edges incident to wi:CCW from −→pwi−

return W

pwi−→pwi

+

−→pwi−

v

∠v

Page 80: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs17

Visibility Case AnalysisVisible(p, wi)

if pwi intersects polygon of wi thenreturn false

if i = 1 or wi−1 6∈ pwi thene← edge of leftmost leaf of Tif e 6= nil and pwi ∩ e 6= ∅ then

return falseelse return true

elseif wi−1 is not visible then

return falseelse

e← find edge in T , that wi−1wi cuts; if e 6= nilthen return falseelse return true

pwi

Page 81: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs17

Visibility Case AnalysisVisible(p, wi)

if pwi intersects polygon of wi thenreturn false

if i = 1 or wi−1 6∈ pwi thene← edge of leftmost leaf of Tif e 6= nil and pwi ∩ e 6= ∅ then

return falseelse return true

elseif wi−1 is not visible then

return falseelse

e← find edge in T , that wi−1wi cuts; if e 6= nilthen return falseelse return true

pwi

pwi

wi−1

pwi

wi−1

Page 82: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs17

Visibility Case AnalysisVisible(p, wi)

if pwi intersects polygon of wi thenreturn false

if i = 1 or wi−1 6∈ pwi thene← edge of leftmost leaf of Tif e 6= nil and pwi ∩ e 6= ∅ then

return falseelse return true

elseif wi−1 is not visible then

return falseelse

e← find edge in T , that wi−1wi cuts; if e 6= nilthen return falseelse return true

pwi

pwi

wi−1

pwi

wi−1

p wi−1wi

e

Page 83: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs18

Summary

Thm 1: A shortest st-path in an area with polygonal obstacleswith n edges can be computed in O(n2 log n) time.

Page 84: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs18

Summary

Thm 1: A shortest st-path in an area with polygonal obstacleswith n edges can be computed in O(n2 log n) time.

Proof:Correctness follows directly from Lemma 1.

Page 85: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs18

Summary

Thm 1: A shortest st-path in an area with polygonal obstacleswith n edges can be computed in O(n2 log n) time.

Proof:Correctness follows directly from Lemma 1.

Running time:– VisibleVertices takes O(n log n) time per vertex – n callsto VisibleVertices

Page 86: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs18

Summary

Thm 1: A shortest st-path in an area with polygonal obstacleswith n edges can be computed in O(n2 log n) time.

Proof:Correctness follows directly from Lemma 1.

Running time:– VisibleVertices takes O(n log n) time per vertex – n callsto VisibleVertices

O(n2) with duality(see exercise or D. Mount [M12] Lect. 31)

Page 87: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

Page 88: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 89: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Roboter

Page 90: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 91: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 92: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 93: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 94: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 95: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Page 96: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Obstacle

Page 97: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Can we compute faster than O(n2 log n)? Obstacle

Page 98: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Can we compute faster than O(n2 log n)?

Yes, by use duality and a simultaneous rotation sweepfor all points in the dual. Computing the arrangement,is also in O(n2). Even though Gvis can have Ω(n2)edges, the visibility graph can be constructed

even faster with an output sensitive O(n log n + m)-time algorithm.

[Ghosh, Mount 1987]

Obstacle

Page 99: Applications of WSPD & Visibility Graphs Computational ... · Dr. Tamara Mchedlidze Dr. Darren Strash Computational Geometry Lecture Applications of WSPD & Visibility Graphs 2 Recall:

Dr. Tamara Mchedlidze · Dr. Darren Strash · Computational Geometry Lecture Applications of WSPD & Visibility Graphs19

Discussion

Robots are not single points...

For robots modelled by a convex polygon that cannot rotate, we canresize (grow) the polygons representing the obstacles(→ Minkowski Sums, Ch. 13 in [BCKO08]).

Can we compute faster than O(n2 log n)?

Yes, by use duality and a simultaneous rotation sweepfor all points in the dual. Computing the arrangement,is also in O(n2). Even though Gvis can have Ω(n2)edges, the visibility graph can be constructed

even faster with an output sensitive O(n log n + m)-time algorithm.

If you search only for one shortest Euclidean st-path, there is analgorithm with optimal O(n log n) time. [Hershberger, Suri 1999]

[Ghosh, Mount 1987]

Obstacle