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

Preview:

Citation preview

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.

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

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

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

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)

LemmaLemmaAny straight line dominance

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

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

contradiction.

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

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>

Preliminary LayoutPreliminary Layout

sk

w

q

a

b

t

0,0

4,1 6,6

2,33,5

1,4

5,2

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..

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

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)

Compaction conclusionCompaction conclusion..

s

k

w

q

a

b

t

s

k

q

a

b twCompaction

ExampleExample

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.

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.

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.

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

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)

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.

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

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

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.

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

Extension - Undirected Planar Extension - Undirected Planar GraphsGraphs

TessellationVisibilityUpward polyline drawings

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

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

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

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

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

Create paths◦n – 2 directed paths associated to

vertices distinct from s, t

◦Unify paths sharing edges

Orthogonal-from-VisibilityOrthogonal-from-Visibilitycontcont..

wv

wv

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.

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).

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)

ExampleExample

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

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.

Planar straight linePlanar straight lineTheorem 4.17. Every n-vertex

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

Planar straight linePlanar straight lineHow ?

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

faces.

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

UMLUML

USE exampleUSE exampleForce directed methods

Recommended