• Nem Talált Eredményt

First, we prove that theOdd Crossing Number Problem,odd-cr(G)≤ K, is in NP, and then we show that there is an NP-complete problem that can be reduced to it in polynomial time.

Fix a graphGwith vertex setV ={v1, v2, . . . , vn}and edge setE. Every drawing D of G can be represented by an |E2|-dimensional (0,1)-vector X¯D(G), in which each coordinate is assigned to an unordered pair of edges {e, f} ⊆ E, and is equal to 1 if and only if e and f cross an odd number of times. That is,

D(G) = (xD{e, f})e6=f;e,fE, where, for everye, f ∈E,

xD{e, f}=

( 0 if e and f cross an even number of times, 1 if e and f cross an odd number of times.

We say that two drawings ofG, D and D are equivalent if they are rep-resented by the same vector, i.e., if ¯XD(G) = ¯XD(G). An |E2|-dimensional (0,1)-vector ¯X is said to be realizable if there exists a drawing D of G such that ¯XD(G) = ¯X

Using an idea of Tutte [T70], it is not hard to describe the set of all realizable vectors of G. We need some further notation. For any v ∈ V, g ∈E, let

v,g = (y{e, f})e6=f;e,fE, where

y{e, f}=

1 if e=g and f is adjacent tov, orf =g and e is adjacent to v, 0 otherwise.

Let Φ denote the vector space over GF(2) generated by the vectors ¯Yv,g, i.e., Φ =Dv,g | v ∈V, g ∈EE

gen ⊂ {0,1}(|E|2).

Place the vertices v1, v2, . . . , vn on a circle in this clockwise order so that they form a regular n-gon, and connect vi and vj (i 6= j) by a straight-line

segment if and only ifvivj ∈E. This drawing is said to be theconvexdrawing of G, and is denoted by C.

For any 1 ≤i ≤n let di be the degree of vi and let ei1, ei2, . . . , eidi be the list of edges adjacent to vi, in clockwise in the convex drawing of G. Let σi :{1,2, . . . , di} → {1,2, . . . , di} be any permutation. Define

vii = (z{e, f})e6=f;e,fE, where

z{e, f}=

( 1 ife =eiα, f =eiβ and (α−β)(σi(α)−σi(β))<0, 0 otherwise.

v

γ p

g

Figure 4.9: The first redrawing operation.

Lemma 4.6.1. Let Φ denote the vector space over GF(2) generated by the vectors Y¯v,g, v ∈ V, g ∈ E, let X¯C(G) be the (0,1)-vector representing the convex drawing of G, and let

Γ =

( n X

i=1

vii | σi is any permutation {1,2, . . . , di} → {1,2, . . . , di}

)

.

Then the set of all realizable vectors of G is Ψ = ¯XC(G) + Γ + Φ, where the sum is taken mod 2.

Proof. LetD be any drawing ofG, letv ∈V, g ∈E. Consider the following two operations:

(i) Choose a simple smooth arc γ connecting any internal point p of g to v such that it does not pass through any vertex, is not tangent to any edge, and crosses every edge a finite number of times. Replace a small piece of g containingp by a path going aroundv and running extremely close toγ (see Fig. 4.9). The (0,1)-vector representing this new drawing is

E(G) = ¯XD(G) + ¯Yv,g (mod 2).

(ii) Letσi be the clockwise order of ei1, ei2, . . . , eidi as they emanate fromvi in drawingD. Change the clockwise order of edges as they emanate from vi to ei1, ei2, . . . , eidi in a small neighborhood ofvi. (See Fig. 4.10.) The (0,1)-vector representing this new drawing is

F(G) = ¯XD(G) + ¯Zvii (mod 2).

This shows that any vector in Ψ is realizable.

v

i

v

i

Figure 4.10: The second redrawing operation.

Next we prove that ¯XD(G) ∈ Ψ, for any drawing D of G. Using a topological transformation of the plane, if necessary, we can assume without

loss of generality that the vertices ofG,v1, v2, . . . , vn, form a regularn-gon, in this clockwise order. First, for every 1≤i≤n, in a small neighborhood ofvi, change the clockwise order of edges as they emanate from vi toei1, ei2, . . . , eidi such that in a very small neighborhood of vi, each egde vivj is represented by the corresponding part of the segment vivj.

Then, pick an edge g =vivj, and transform it into the straight-line seg-ment between vi and vj, by continuous deformation. Performing this opera-tion for all edges, one by one, we obtain C the convex drawing of G.

LetD denote the drawing after the first step. Then, X¯D(G) = ¯XD(G) +

Xn

i=1

vii (mod 2) for some permutations σ1, σ2, . . . , σn.

During the second step, the representation vector of the drawing changes whenever a deforming edgeghits a vertexv. LetE andF denote the drawing immediately before and after this event. Clearly,

F(G) = ¯XE(G) + ¯Yv,g (mod 2).

Finally, we obtain

C(G) = ¯XD(G) + ¯Y (mod 2), for some ¯Y ∈Φ, hence

D(G)∈X¯C(G) + ¯Y = Ψ. 2

Now we are in a position to prove that the Odd Crossing Number Problem is in NP. Suppose that odd-cr(G)≤K. Then, by Lemma 4.6.1, there is a realizable vector ¯Y ∈ Ψ such that all but at most K coordinates of ¯Y are 0. We can give the vector ¯Y in the form

Y¯ = ¯XC(G) +

Xn

i=1

vii+ X

vV,gE

α(v,g)v,g (mod 2),

whereα(v,g) ∈ {0,1}andσi :{1,2, . . . , di} → {1,2, . . . , di}are permutations.

Clearly, the correctness of this equation can be checked in polynomial time.

Thus, the Odd Crossing Number Problem is in NP.

The Optimal Linear Arrangement Problem is the following. We have a graph G = (V, E) and an integer K, is there a one to one function σ:V → {1,2, . . . ,|V|} such thatPuvE|σ(u)−σ(v)| ≤K?

Notice that the Odd Crossing Number Problem for simple graphs is equivalent to the same problem for multigraphs, i.e., when the graph G may have multiple (parallel) edges. Indeed, we can remove all multiplicities by introducing new vertices along the edges ofG. For any graph Gobtained fromG by subdividing one (or more) of its edges, we have

odd-cr(G) =odd-cr(G).

Lemma 4.6.2. The Optimal Linear Arrangement Problem can be reduced to the Odd Crossing Number Problem in polynomial time.

Proof. Suppose we are given an instance G = (V, E), K, and we want to decide if there exists a one-to one function σ:V → {1,2, . . . ,|V|} such that

P

uvE|σ(u)−σ(v)| ≤ K. Let V ={v1, v2, . . . , vn} and assume without loss of generality that G is connected. We construct a multigraph GK and a number K such that the answer to our Optimal Linear Arrangement Problem is affirmative if and only if odd-cr(GK)≤K.

LetGK = (V, E), where V =V1∪V2∪ {u, w}, E =E1 ∪E2 ∪E3, V1 ={ui | 1≤i≤n}, V2 ={wi | 1≤i≤n},

E1 ={|E|2 copies of uiwi | 1≤i≤n}, E2 ={uiwj | i < j and viwj ∈E},

E3 ={K2|E|2 copies of uw, uui, wwi, 1≤i≤n}, and let

K =|E|2(K− |E|) +|E|2−1.

Suppose first that there exists a bijection σ : V → {1,2, . . . ,|V|} such that PuvE|σ(u)−σ(v)| ≤K. We construct a drawing of G with at most K pairs of crossing edges. Place ui at (1, σ(vi)), wi at (0, σ(vi)),u at (2,0), and w at (−1,0). Represent all single edges by straight-line segments and all multiple edges by pairwise disjoint curves running very close to the cor-responding straight line segment. It is easy to see that the total number of crossing pairs of edges is at most

X

uvE

(|σ(u)−σ(v)| −1)|E|2+|E|2−1≤ |E|2(K− |E|) +|E|2−1 =K.

u

w

w w w w w

u u u u u

1 2 3 4 5

5 4 3 2 1

Figure 4.11: The multigraph GK.

Next, suppose that odd-cr(GK) ≤ K. We show, using some simple transformations, that there is another drawing of G generated by a function σ in the way described above, which has at mostK pairs of edges that cross an odd number of times. Consider a drawing of GK with at most K pairs of edges that cross an odd number of times.

(a) We can assume that any two parallel edges, e and f, are drawn very close to each other, so that they are openly disjoint, and any other edge crosses both of them the same number of times. Indeed, if eandf are drawn differently, then replacing either e by an arc running very close to f, or f by an arc running very close to e, we obtain a new drawing of G which has at most as many pairs of edges that cross an odd number of times as the original drawing.

(b) Any two edges e, f ∈ E1∪E3 must cross an even number of times.

Indeed, otherwise, by (a), we can assume that each of the at least |E|2 edges parallel (or identical) to e crosses each of the at least |E|2 edges parallel (or identical) tof an odd number of times. This implies that the number of edge pairs that cross an odd number of times is at least|E|4 > K, a contradiction.

(c) No edge of GK can cross any edge between u and w an odd number of times. Otherwise, by (a), the number of pairs of edges that cross an odd number of times would be at least K2|E|2> K, which is impossible.

(d) Lete be any edge between uand w, and let fi (resp. gi) be any edge whose endpoints areuand ui (resp. wand wi), 1≤i≤n. If for some i6=j, the edges (e, fi, fj) emanate from u in clockwise order, then (e, gi, gj) must emanate fromv in counter-clockwise order.

To see this, consider a cycleCformed byfi,e,gi, and any edge connecting ui and wi. The closed curve representing this cycle divides the plane into connected cells. As in the proof of Theorem 4.1.1, color these cells with black and white so that no two cells that share a boundary arc receive the same color. Let P be a path formed by fj, gj, and any edge between uj and wj. Suppose that in a small neighborhood of u, fj is in, say, the black region.

Then, in a small neighborhood of w, gj must also lie in the black region, because, by (b), every edge of P crosses (every edge of) C an even number of times.

(e) Suppose that e, f1, f2, . . . , fn emanate from u in the clockwise order e, fα(1), fα(2), . . . , fα(n). Then, by (d), e, g1, g2, . . . , gn must emanate from w in the reverse order e, gα(n), gα(n1), . . . , gα(1). Let σ(vi) =α1(i), 1≤i≤n.

We claim that for every uiwj ∈ E2, there are at least (|σ(vi)−σ(vj)| − 1)|E|2 edges in GK that cross uiwj an odd number of times. To see this, it is enough to show that for every r < s < t, if vα(r)vα(t) ∈ E, then the edge ert:=uα(r)wα(t) must cross the pathPs :=fα(s)∪eα(s)∪gα(s) an odd number of times, where eα(s) denotes any edge between uα(s) and wα(s). As before, color the cells determined by the closed curve Ps∪e with black and white.

It follows from (d) that if in a small neighborhood ofu,fα(r)∪ert∪gα(t) is in the black region, then in a small neighborhood ofwit is in the white region.

In view of (b) and (c), this implies that ert crosses at least one of the edges fα(s), eα(s), andgα(s) an odd number of times. In each case, we are done, and our claim is true.

Therefore, we have

X

uvE

(|σ(u)−σ(v)| −1)|E|2 ≤odd-cr(GK)≤K =|E|2(K− |E|) +|E|2−1, which implies that X

uvE

(|σ(u)−σ(v)| ≤K, as desired. 2

With Lemma 4.6.2, the proof of Theorem 4.1.6 (ii) is complete, be-cause the Optimal Linear Arrangement Problem is known to be NP-complete [GJS76].