Flow and Orthogonal - PowerPoint PPT Presentation

About This Presentation
Title:

Flow and Orthogonal

Description:

Chapter 5. Flow and Orthogonal. Drawings. Nimrod Milo and Ilan Orlov. 1. Final Example: ... For each internal face of a planar orthogonal drawing. The sum of ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 52
Provided by: csBg
Category:

less

Transcript and Presenter's Notes

Title: Flow and Orthogonal


1
Chapter 5
Flow and Orthogonal Drawings
Nimrod Milo and Ilan Orlov
2
Final Example
3
Goal
Efficiently drawing of orthogonal graphs
4
Quality of a draw
Minimal number of bends
9 bends
6 bends
5
Every edge considered as two directed edges !!!
Notations
G Orthogonal graph
G Original graph
6
Lemma 1
In a planner orthogonal drawing, the sum of the
measures around a vertex is equal to 2?
7
Lemma 2.1
For each internal face of a planar orthogonal
drawing. The sum of the measures of the
vertex-angels and bend-angles inside f is equal
to ?(p-2) where p is the number of such angels.
8
Lemma 2.2
For each external face of a planar orthogonal
drawing. The sum of the measures of the
vertex-angels and bend-angles inside f is equal
to ?(p2) where p is the number of such angels
9
Notations
a(f) number of vertex-angles in f
Counterclockwise edge with respect to face f
f - face
D(f) - Counterclockwise edge inside the face f
10
Notations
a(u?v) ??/2 The angle at vertex u formed by edge
(u?v) and the next counterclockwise around u
11
Notations
ß(u?v) number of bends along (u?v) With the
?/2 angle on the left hand side.
12
Notations
a ?
ß ?
13
a
1
4
ß
0
4
14
(No Transcript)
15
(No Transcript)
16
Flow Network Model
A flow network N for a digraph G(V,E) defined
such that
  • Each source v has a production s(v).
  • Each sink u has a consume rate s(u).
  • Total production total consumption
  • For each edge (u,v) in E
  • ?(u,v) a lower bound of flow
  • µ(u,v) - Capacity of flow
  • ?(u,v) Cost per unit of flow
  • A flow ? (? IN ? IN) in Network N defined such
    that
  • for each (u,v) in E
  • ?(u,v) ?(u,v) µ(u,v)
  • The Cost of flow ? ??(u,v) ?(u,v)
  • The objective is a Minimum cost of flow

17
Building network from graph
  • One unit of flow ?/2
  • The nodes of N are the vertices and faces of G
  • A vertex-node v in V(N) produced flow s(v)4
  • A face-node f in V(N) consumes flow
  • s (f) 2a (f) 4 if f is internal face
  • s (f) 2a (f) 4 if f is external face

18
Building network from graph
  • For each directed edge (u,v) in E with faces f,
    g on its left and right respectively we define
    to edges in E(N)
  • For edge (u,f) ?(u,f) 1, µ(u,f) 4 and
    ?(u,f)0 (figure a)
  • For edge (f,g) ?(f,g) 0, µ(f,g) 8 and
    ?(f,g )1 (figure b)

19
Building network from graph (Contd.)
Lemma 3 Let G an embedded planar graph with n
vertices. The flow Network N built from G has
O(n) nodes and edges, And can be built in O(n)
time.
Theorem 1 Let G an embedded planar graph and N
be the flow Network built from G. for the edge
(u,v), let (u,f) and (f,g) be the associated
edges in N
  • ?(u,f) a(u,v)
  • ?(f,g) ß(u,v)

20
Orthogonalize (algorithm 5.1)
Input planar Graph G with n vertices (Maximum
degree of 4)
Output orthogonal represntation of G with
minimum number of bends
Time Complexity O(n²log n) Space Complexity
O(n)
  • The algorithm
  • Construct the flow Network N from G
  • Compute Flow of minimum cost for N.
  • Compute the Orthogonal representation of G
    associated with the minimum cost flow.

21
Compacting of Orthogonal Representation
  • Goal
  • Assign integer length to the segments
  • No crossing, no overlaps
  • Minimum area, fast algorithm
  • our case
  • area O((nb)2) b no. bends
  • time O((nb))

First, assume rectangular faces !!
22
Rectangular faces
  • Each internal face has the shape of a rectangle
  • in the orthogonal representation H
  • H has at most 4 bends, placed at the corner of
    the external face.
  • Edge of G edge of the H, excepts possibly for
    eight segments on the external face

23
Tidy-Rectangle-Compact algorithm
24
(No Transcript)
25
For each edge set Minimum flow 1 Cost 1
26
Run algorithm for finding flow with minimal cost
flow 1
flow 2
flow 3
27
Setting edge length Flow on the
corresponding edge in the flow network
28
(No Transcript)
29
(No Transcript)
30
For each edge set Minimum flow 1 Cost 1
31
flow 1
flow 2
flow 3
32
Setting edge length Flow on the
corresponding edge in the flow network
33
Combining the new vertical and horizontal lengths
Running time O(n7/4 logn)
34
Running time O(n7/4 logn)
35
Different compaction algorithm
  • Linear time
  • Minimizes the height, width, area of the drawing
  • Does not guarantee the minimum total edge length

36
Different compaction algorithm
1. Replacing bends with fictitious vertices
2. Orienting the horizontal edges from left to
right
3. Contracting maximal paths of vertical edges to
a vertex
37
compaction algorithm based on s-t-graph
compaction algorithm
We get a planer s-t-graph.
Denote it as Hhor.
Using same process we get Hver.
Assign unit weights to the edges to both
s-t-graphs edges
38
Compute optimal weighted topological numbering X
and Y As in previous lesson
39
Running time O(n)
40
General orthogonal representations
  1. Add an isolated vertex

2. Insert a vertex along an edge
H
3. Add an edge
H
G ? H ? H ? Hcompact? Hcompact_without_extra
edges/vertices
41
Final Theorem 5.4
Given an embedded planar graph G with n vertices
of degree at most 4, and an orthogonal
representation H of G with b bends, a planar
orthogonal drawing of G with integer coordinates
and area O( (nb)2 ) can be constructed in O(nb)
time.
42
Optimal-Orthogonal (algorithm 5.4)
Input planar Graph G with n vertices (Maximum
degree of 4)
Output planar orthogonal grid drawing D of G
with area O(n²) and minimum number of bends
Time Complexity O(n²log n) Space Complexity
O(n)
  • The algorithm
  • H ? Orthogononalize on graph G.
  • Refine H into an orthogonal representation H
    with rectengular faces.
  • D ? Fast-Orthogonal-Compact(H)
  • D ? D while ignoring all the fictious edges and
    vertices.

43
Constrains
  • We can easily modify algorithm 5.4 to include two
    types of constrains
  • Vertex-angle constrains by setting the lower /
    upper bound of a(u,v)
  • Bend Constrains by setting the lower / upper
    bound of ß(u,v)

44
Minimizing number of bends Locally
45
Minimizing number of bends Locally
For a face-angle or a vertex angle we
Define p/2 inflex p - flat 3p/2 - reflex
For a given orthogonal representation G we define
a curve C as an Elementary Transformation If the
curve C intersect G only in inflex, flat or
reflex angles.
For each vertex traversed by Curve C the
transformation subtract p/2 from the angle C
enters, and adds p/2 to the angle where C exit.
46
For a Curve C we define flat(C),inflex(C),reflex(C
) as the number of flat, inflex and reflex
angles in C respectively
?(C) flat(C) inflex(C) reflex(C)
47
Theorem 5.6 an Orthogonal representation G has
the minimum Numbers of bend iff for every cycle
C in G ?(C) 0
The proof of Theorem 5.6 is based on looking in
the flow network Corresponding with G and flow
in the cycle C. the result is that the flow
cant be a negative number.
48
Elementary Transformation
49
Elementary Transformation
50
Elementary Transformation
51
Elementary Transformations example
Write a Comment
User Comments (0)
About PowerShow.com