• 沒有找到結果。

Flow Formulation for Bend-minimization

在文檔中 圖的接觸表示法 (頁 51-57)

Orthogonally Convex Drawings

Corollary 3.2. For any subdivision of a triconnected plane 3-graph G, the minimum number of bends needed to construct an orthogonally convex drawing is at most one

3.6 Flow Formulation for Bend-minimization

In this section, we tailor the planar min-cost flow formulation originally designed for orthogonal drawing [41] to coping with orthogonal convexity. Our strategy is con-siderably different to most of the previous approaches using flow networks to design graph drawing algorithms. Instead of finding a desired drawing directly by applying min-cost flow, our flow network solves the problem indirectly in the sense that it adds a minimum number of new 2-vertices to the input graph to satisfy Theorem 3.5. A bend-minimized drawing can then be constructed using Theorem 3.4.

To make our subsequent discussion clear, we use arc and node instead of edge and vertex, respectively, in describing a flow network. A min-cost flow network is a directed multi-graph N = (W, A) associated with four functions: lower bounds λ : A→Z≥0, capacities µ : A→Z≥0 ∪ {∞}, costs c : A→Z≥0, demands b : W→Z. A map f : A→Z≥0 is a flow if the following constraints are met:

∀v ∈ W, b(v) +

(u,v)∈A

f (u, v)−

(v,u)∈A

f (v, u) = 0, ∀a ∈ A, λ(a) ≤ f(a) ≤ µ(a)

The cost of a flow f is c(f ) =a∈Af (a)×c(a). We first describe the flow network NG = (WG, AG) associated with a biconnected plane 3-graph G in which each flow in NGcorresponds to an orthogonal drawing of G:

• WG= WV ∪ WF, where WV and WF are the vertex set and face set (including the

outer face) of G, respectively, Furthermore,∀uv ∈ WV, b(uv) = 2 if degG(v) = 3; b(uv) = 0 if degG(v) = 2. ∀uF ∈ WF, b(uF) = −4 if F is an inner face;

b(uF) = 4 if F is the outer face.

• AG= AV ∪ AF, where

– AV = {(uv, uF), (uF, uv)|deg(v) = 2} ∪ {(uv, uF)|deg(v) = 3}, where v ∈ V (G), F ∈ face(G), v incident to F . ∀a ∈ AV, λ(a) = 0, µ(a) = 1, and c(a) = 0.

– AF = {(uF, uH)|F, H ∈ face(G), and F adjacent to H} is a multi-set of arcs between faces, and the number of (uF, uH) in AF equals the number of shared edges in contours of F and H. We use (uF, uH)e to indicate the specific arc that corresponds to the shared edge e. ∀a ∈ AF, λ(a) = 0, µ(a) =∞, and c(a) = 1.

Although our definition of NG is slightly different from the original one given in [41], the validity of NG is apparent as the following explains. Every flow f in NG corresponds to an orthogonal drawing D(G), and vice versa, such that

• f (uv, uF)−f(uF, uv) =−1, 0, 1 means v is a concave corner, non-corner, convex corner in D(F ), respectively,

• f (uF, uH)e is the number of bends on e that are concave corners in D(F ) and convex corners in D(H), and

• the total number of bends in D(G) equals c(f ).

The reader is referred to Fig. 3.10 for an illustration of flow network NG: The up-left picture is the graph G, the right one is the flow network, and the down-left one is a bend-minimized orthogonal drawing. Every bi-directed arc represents two arcs with opposite direction. The flow f representing the drawing is defined as follows: f (F0, F1) = 2, f (F0, F2) = f (F0, F3) = f (x, F2) = f (x, F3) = f (y, F1) = f (y, F3) = f (z, F1) =

x

Figure 3.10: Illustration of the flow network NG.

f (z, F2) = f (u, F2) = f (u, F3) = 1, and f (a) = 0 for the remaining arcs a. The cost of f is 4.

The following fact is an immediate consequence of the above discussion. It estab-lishes a correspondence from "the difference between the numbers of convex corners and concave corners in a portion of a contour of a face" to "the amount of flow passing through it".

Fact 3.4. Let S1 (resp., S2) be any subset of edges (resp., vertices) along the contour of a face F . For any e ∈ S1, we write Fe to denote the face incident to e other than F . For a flow f in NG and its corresponding orthogonal drawing D, we must have

e∈S1[f (uFe, uF)e− f(uF, uFe)e] +v∈S2[f (uv, uF)− f(uF, uv)] equaling the differ-ence between the numbers of convex corners and concave corners in the portion S1∪S2

of D(F ).

We have the following lemma, which reduces the existence of a no-bend orthog-onally convex drawing to the existence of a no-bend orthogonal drawing plus some constraints about numbers of convex corners and concave corners in some paths. This lemma together with the above fact lay down the foundation for us to find bend-minimized orthogonally convex drawings based on a modification to the above flow network NG. Lemma 3.4. A biconnected plane 3-graph G admits a no-bend orthogonally convex

drawing iff there is a no-bend orthogonal drawing (not necessarily orthogonally con-vex) such that

(1) for every critical path P along a contour path of 2-legged cycle C, #cc(P(x⌢y))

> #cv(P(x⌢y)) in FC,P, and

(2) for every P in SG, #cc(P(x⌢y))≤ 3 + #cv(P(x⌢y)) in the outer face,

where P has endpoints x and y, and #cv(·) and #cc(·) represent the numbers of convex and concave corners, respectively.

Proof. (⇐) It is easy to see that the two conditions imply the two conditions in Theo-rem 3.5 (In the first condition, concave corners of P(x⌢y) in FC,P must be 2-vertices;

and the second condition implies that there must be a concave corner in CO\ P(x⌢y), which must be a 2-vertex, too); hence, we conclude the "if" part of the lemma.

(⇒) Now, suppose G admits a no-bend orthogonally convex drawing. According to Lemma 3.1, the first condition is always satisfied for every no-bend orthogonally convex drawing. Therefore, it suffices to show that there exists a no-bend orthogonally convex drawing D(G) such that the second condition is satisfied. We show that if there is a path P contradicting the second condition, we can modify the drawing in a way that orthogonal convexity of each face is preserved. Let F be the face incident to P other than the outer face, and C be its contour.

x

F y

x

y F

x

y F

Figure 3.11: Illustration of the proof of Lemma 3.4.

Suppose the second condition of the lemma does not hold. Then, the number k =

#cv(P(x⌢y)) = #cc(P(x⌢y)) in F is more than 3. Note that a concave (resp., convex) corner of P(x⌢y) in the outer face must be convex (resp., concave) in F .

It is clear that k cannot be more than 5; otherwise there must be consecutive concave corners in C\P in F . If there is any concave corner v of P(x⌢y)in F , let w be its nearest corner vertex in P , which must be convex in F . We can make them both non-corner in F without introducing any consecutive concave corners. Therefore, we can assume there are exactly 4 or 5 convex corners of P(x⌢y)in F . If the number is 4, one of x and y must be non-corner in F , and if it is 5, then both x and y are non-corner in F ; otherwise there must be consecutive concave corners in C \ P in F . Note that x and y cannot be concave in F since they are of degree 3. Suppose x (or y) is non-corner in F , and let z be any convex corner of P(x⌢y)in F . We can make x (or y) convex in F and z non-corner in F without introducing any consecutive concave corners. Hence we can reduce the number k to be at most 3, which concludes the proof. (We actually prove a stronger result than the statement of lemma in the "only if" part, since the drawing constructed is orthogonally convex.) See Fig. 3.11 for a graphical illustration of removing additional convex corners.

In what follows, we show how to construct a flow network NG from NG in such a way that a flow of NG corresponds to an orthogonal drawing meeting the conditions stated in Lemma 3.4.

We use Fig. 3.12 as a graphical illustration of the procedure. Note that Fig. 3.12(1) shows a portion the a graph G with F0 the outer face, P1 = (x, y, z) and P2 = (z, w) the two paths in SG, and P3 = (x, y, z, w) a critical path; Fig. 3.12(2) shows its corre-sponding portion in NG.

Initially we set NG = NG.

∀P ∈ SG with endpoints x, y, let the outer face be F, and let SP,F denotes the set of faces bordering F along some edges in the path P .

– add a new node uP to W (NG ), and two arcs (uF, uP), (uP, uF) to A(NG ).

– set b(uP) = 0, λ(uF, uP) = λ(uP, uF) = 0, µ(uF, uP) = 3, µ(uP, uF) =

∞, and c(uF, uP) = c(uP, uF) = 0.

– redirect all the arcs in the current A(NG ) of the following forms: (uF, uv), (uv, uF), (uF, uF)e, (uF, uF)e for all v ∈ V (P ) \ {x, y}, F ∈ SP,F, e∈ E(P ) by replacing uF with uP.

See Fig. 3.12(3) for the modification to NGfor the two paths P1and P2in SG, in which the newly added arcs are drawn as dotted lines. In view of Fact 3.4, such a modification makes the orthogonal drawing corresponding to any flow f of NG in compliance with the condition 2 of Lemma 3.4 (view it as a no-bend drawing by treating all bends as 2-vertices).

∀ critical path P with endpoints x, y, C the 2-legged cycle for which P is its contour path, and S the set of faces in G(C) that border P ,

– add a new node uP to W (NG ), and a new arc (uFC,P, uP) to A(NG ).

– set b(uP) = 0, λ(uFC,P, uP) = 1, µ(uFC,P, uP) =∞, and c(uFC,P, uP) = 0.

– redirect all the arcs in the current A(NG) of the following forms: (uFC,P, uP), (uP, uFC,P), (uFC,P, uv), (uv, uFC,P), (uFC,P, uF)e, (uF, uFC,P)efor all P SG such that P ⊆ P , v ∈ V (P ) \ {x, y}, F ∈ S, e ∈ E(P ) by replacing uFC,P with uP.

See Fig. 3.12(4) for the modification to NGfor the critical path P3, in which the newly added arc is drawn as a dashed line. Similarly, due to Fact 3.4, condition 1 of Lemma 3.4 holds for any orthogonal drawing corresponding to a flow f in the modified network (view it as a no-bend drawing by treating all bends as 2-vertices).

Since critical paths are mutually edge-disjoint according to Lemma 3.2, and since every path in SG is either a subpath of a critical path or intersects no critical path, the construction process is valid and can be done in linear time, the planarity of NG is preserved, and the number of newly added arcs and nodes is linear in |V (G)|(= n).

Note that the maximum possible value of the minimum cost is also O(n). Therefore, an

F1 F2

Figure 3.12: Illustration of the construction of NG .

optimal solution of NG can be solved using the O(n1.5log3n) time algorithm for planar min-cost flow with cost O(n) described in [12].

Note that since we cannot make the flow uncapacitated, a more efficient algorithm of O(n1.5) complexity also described in [12] cannot be adapted.

We are in a position to prove the main theorem in this section.

在文檔中 圖的接觸表示法 (頁 51-57)