Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department...

40
Advanced Seminar on Advanced Seminar on Graph Drawing – Planar Graph Drawing – Planar Orientations Orientations Olga Maksin Victor Makarenkov Department of Computer Science . Ben-Gurion University of the Negev .

Transcript of Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department...

Page 1: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Advanced Seminar on Advanced Seminar on Graph Drawing – Planar Graph Drawing – Planar OrientationsOrientationsOlga MaksinVictor Makarenkov

Department of Computer Science.

Ben-Gurion University of the Negev.

Page 2: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ContentsContentsDominance DrawingsUndirected Planar GraphsPlanar Orthogonal DrawingsPlanar Straight Line DrawingsReal-World Example

Page 3: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Dominance Drawings - Dominance Drawings - MotivationMotivationDraw a nice planar st-graphs

with:◦Linear time complexity◦Small number of bends◦Small area◦Presentation of symmetries

Page 4: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Dominance drawing A dominance drawing of a

digraph G is a drawing Γ of G such that:

Dominance drawing is upward.

u

v

iffX(u) <= X(v)

Y(u) <= Y(v)

Page 5: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

LemmaLemmaAny straight line dominance

drawing Γ of a reduced planar st-graph G is planar.

Proof (sketched) :◦Assume the negation -> K3,3 ->

contradiction.

Page 6: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Dominance straight line Dominance straight line Input : Reduced planar st-graph

G=(V,E)Output : Straight line dominance

drawing Γ of G

3 Stages:◦Preprocessing – Data structures◦Preliminary Layout◦Compaction

Page 7: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

PreprocessingPreprocessing

sk

w

q

a

b

t

• For each v • list of outgoing edges (clockwise)

•Next (e), Pred (e)

• firstout(v)• lastout(v)• firstin(v)• lastin(v)

• For each e = <u,v>

• head(e) = v

firstout(s) = <s,w>Lastin(t) = <q,t>Next(<s,w>)=<s,k>

Page 8: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Preliminary LayoutPreliminary Layout

sk

w

q

a

b

t

0,0

4,1 6,6

2,33,5

1,4

5,2

Page 9: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

0,0

1

2

3

4

5

6

1 2 3 4 5 6s

k

w

q

a

b

t

X

Y

Preliminary Layout contPreliminary Layout cont..

Page 10: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

CompactionCompaction

0,0

1

2

3

4

5

6

1 2 3 4 5 6s

k

w

q

a

b

t

X

Y

If Y(u) > Y(v) or(Firstout(u) = lastout(u) and firstin(v) = lastin(v))Then x(v) = x(u) + 1Else x(v) = x(u)

Two ordered lists by X and Y coordinate

Page 11: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Compaction contCompaction cont..

0,0

1

2

3

4

5

6

1 2 3 4 5 6s

k

w

q

a

b t

X

Y

If X(u) > X(v) or(Firstout(u) = lastout(u) and firstin(v) = lastin(v))Then y(v) = y(u) + 1Else y(v) = y(u)

Page 12: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Compaction conclusionCompaction conclusion..

s

k

w

q

a

b

t

s

k

q

a

b twCompaction

Page 13: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ExampleExample

Page 14: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Algorithm AnalysisAlgorithm AnalysisTheorem 4.9. Let G be a

reduced planar st-graph with n vertices. Algorithm Dominance-Straight-Line constructs in O(n) time a planar straight line dominance grid drawing Γ of G with O(n2) area.

Page 15: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Display of symmetriesDisplay of symmetriesTheorem 4.10. Let G be a reduced

planar st-graph. And Γ be the corresponding straight line drawing constructed by algorithm dominance-straight-line. We have :◦Simply isomorphic components of G

have drawings in Γ that are congruent up to a translation.

◦Axially isomorphic components of G have drawings in Γ that are congruent up to a translation and reflection.

Page 16: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Display of symmetries Display of symmetries cont.cont.Rotationally isomorphic components

of G have drawings in Γ that are congruent up to a translation and 180o rotation.

Page 17: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Minimum area dominance Minimum area dominance drawingsdrawings

EL set of edges {<u,v>} such that <u,v> is the rightmost incoming edge of v and leftmost outgoing of u.

ER – vice versa.EH – {<u,v>} the only outgoing edge of

u and the only incoming of v. EH is intersection of EL and ER

Area = (n -1 – (mL - mH)) * (n -1-(mR - mH))Minimum area : EH is empty

Page 18: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Minimum area dominance Minimum area dominance drawingsdrawingsCompute mL and mR in

preprocessing phaseIf Y(u) > Y(v) or(Firstout(u) = lastout(u) and firstin(v) =

lastin(v) and mL <= mR (mL > mR for x))Then x(v) = x(u) + 1Else x(v) = x(u)

Page 19: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Minimum area contMinimum area cont..Theorem 4.12. Let G be a

reduced planar st-graph with n vertices. A minimum area Dominance-Straight-Line grid drawing of G can be constructed in O(n) time.

Note: Symmetry not guaranteed.

Page 20: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

General planar st-graphsGeneral planar st-graphsInput : Planar st-graph G=(V,E)Output : Polyline dominance

drawing Γ of G◦Construct reduced G’◦Run Algorithm Dominance-straight-

line◦Remove dummies

Page 21: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

General planar st-graphs General planar st-graphs contcont..

Adding a dummy vertex:

At least n-1 edges are not transitive => at most 2n – 5 dummies => 2n-5 bends.

Recall at most 3n-6 edges in planar graph.

sk

w

q

a

b

t

X

Page 22: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Dominance Drawings - Dominance Drawings - SummarySummaryΓ is planar , upward, grid,

dominance, polyline.Γ has O(n2) area.Γ has at most 2n-5 bends. Every

edge at most one bend.Γ presents symmetric and

isomorphic components.

Page 23: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ContentsContentsDominance DrawingsUndirected Planar GraphsPlanar Orthogonal DrawingsPlanar Straight Line DrawingsReal-World Example

Page 24: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Extension - Undirected Planar Extension - Undirected Planar GraphsGraphs

TessellationVisibilityUpward polyline drawings

O(n) time , O(n2) area , 2n-5 bends for planar polyline.

Page 25: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

The extensionThe extensionConstruct a planar embedding of G.Make it biconnected (dummy edges).Let s and t be 2 vertices on external face.St-numberingOrient edges according to st-numbering.

s t1

2

3

4

Page 26: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ContentsContentsDominance DrawingsUndirected Planar GraphsPlanar Orthogonal DrawingsPlanar Straight Line DrawingsReal-World Example

Page 27: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Planar Orthogonal DrawingsGraphs with degree less than or

equal to four.Uses visibility representations as

an intermediate construction.At most 2 bends for each edge

(except two edges for s and t with four bends each). Total: 2n+4

O(n) time , O(n2) area

Page 28: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Orthogonal-from-VisibilityOrthogonal-from-VisibilityInput : biconnected planar graph

G=(V,E) with n vertices of degree at most 4.

Output : planar orthogonal grid drawing of G.◦Construct planar embedding -> planar

st -graph◦Create paths◦Run Constrained-Visibility ◦Construct a planar orthogonal grid

drawing

Page 29: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Create paths◦n – 2 directed paths associated to

vertices distinct from s, t

◦Unify paths sharing edges

Orthogonal-from-VisibilityOrthogonal-from-Visibilitycontcont..

wv

wv

Page 30: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Orthogonal-from-VisibilityOrthogonal-from-Visibilitycontcont..Run Constrained –Visibility with

respect to ∏ nonintersecting paths.

Prespecified edges vertically alligned.

For 2 edges on same path, the edge segments have same x coordinate.

Page 31: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Orthogonal-from-VisibilityOrthogonal-from-Visibilitycont.cont.

Construct a planar orthogonal grid drawing:◦For each v: draw at the intersection of vertex

segment with the edge segments of its path◦For s (t): intersection of its segment with

edge segment of median outgoing (incoming).

Page 32: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Orthogonal-from-VisibilityOrthogonal-from-Visibilitycont.cont.For each e=(u,v): orthogonal chain through

the following points :Placement of u Intersection of Γ(u) and Γ(e) Intersection Γ(e) and Γ(v)Placement of v

Γ(u)

Γ(v)

Γ(e)

Page 33: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ExampleExample

Page 34: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ContentsContentsDominance DrawingsUndirected Planar GraphsPlanar Orthogonal DrawingsPlanar Straight Line DrawingsReal-World Example

Page 35: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Planar straight linePlanar straight lineEvery planar graph admits a

straight line drawing.Existence is not the same as nice

one. Until 1988 vertices exponentially close together (in minimum unit of distance).

So no visualization can be made.

Page 36: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Planar straight linePlanar straight lineTheorem 4.17. Every n-vertex

planar graph has a planar straight line grid drawing with O(n2) area.

Page 37: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

Planar straight linePlanar straight lineHow ?

◦Orientation◦One vertex at a time◦Partial order on vertices, edges and

faces.

Page 38: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

ContentsContentsDominance DrawingsUndirected Planar GraphsPlanar Orthogonal DrawingsPlanar Straight Line DrawingsReal-World Example

Page 39: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

UMLUML

Page 40: Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.

USE exampleUSE exampleForce directed methods