22.11.2014 Views

The Weighted All-Pairs-Shortest-Path-Length Problem on Two ...

The Weighted All-Pairs-Shortest-Path-Length Problem on Two ...

The Weighted All-Pairs-Shortest-Path-Length Problem on Two ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>The</str<strong>on</strong>g> 25th Workshop <strong>on</strong> Combinatorial Mathematics and Computati<strong>on</strong> <str<strong>on</strong>g>The</str<strong>on</strong>g>ory<br />

respectively. By this notati<strong>on</strong>, G(r) is just the<br />

original input graph G. In another, each n<strong>on</strong>-leaf<br />

node u of T is associated with a label lb(u). Assume<br />

that q and f are the children of u. If G(u) = G(q) •<br />

G(f), then lb(u) = S and u is called a S-node.<br />

Otherwise, it implies that G(u) = G(q) + G(f). In this<br />

case, lb(u) = P and u is called a P-node. Fig. 4 shows<br />

a TTSP graph G and a corresp<strong>on</strong>ding parsing tree T.<br />

In [19], the authors investigated literatures <strong>on</strong><br />

TTSP graphs for some problems, such as the<br />

minimum feedback vertex problem and the<br />

maximum independent set. Meanwhile, in [8], the<br />

authors shown that APSPL problem <strong>on</strong> planar<br />

graphs with n<strong>on</strong>negative edge-weights can be<br />

2<br />

solved in O( n ) time. But the time-complexity so<strong>on</strong><br />

increases to O(<br />

n<br />

7<br />

3<br />

log( nL)<br />

) if negative<br />

edge-weights are allowed, where L is the absolute<br />

value of the most negative edge-weight. <str<strong>on</strong>g>The</str<strong>on</strong>g> class of<br />

TTSP graphs is an important subclass of planar<br />

graphs. This paper will establish a meaningful<br />

improvement: the WAPSPL problem <strong>on</strong> TTSP<br />

2<br />

graphs can be solved in O( n ) time.<br />

2<br />

3. An O( n )-Time Algorithm<br />

It is so trivial to solve our problem when the input<br />

graph c<strong>on</strong>sists <strong>on</strong>ly a single edge. <str<strong>on</strong>g>The</str<strong>on</strong>g>refore, we<br />

assume that the input graph G c<strong>on</strong>sists of at least two<br />

edges hereafter. To go <strong>on</strong> our discussi<strong>on</strong>, the<br />

following definiti<strong>on</strong>s are introduced firstly.<br />

Definiti<strong>on</strong> 1: For any node z of T(r), the nodes in the<br />

path from z to the root r, except z itself, are called the<br />

ancestors of z.<br />

Definiti<strong>on</strong> 2: For any two distinct vertices<br />

v<br />

j<br />

and<br />

of G(r), the lowest comm<strong>on</strong> ancestor of and<br />

v<br />

j<br />

, denoted as LCA({ vi<br />

, v<br />

j<br />

}) is defined as<br />

follows: (1) If ( vi<br />

, v<br />

j<br />

) is an edge of G(r), then it<br />

implies that ( vi<br />

, v<br />

j<br />

) corresp<strong>on</strong>ds to some leaf node<br />

z and LCA({ vi<br />

, v<br />

j<br />

}) is defined to be z itself. (2) If<br />

( v , v ) is not an edge of G(r), then there must<br />

i<br />

j<br />

exist two leaf nodes p and q such that<br />

v i<br />

vi<br />

is the <strong>on</strong>e<br />

vertex of the edge corresp<strong>on</strong>ding to p and is the<br />

<strong>on</strong>e vertex of the edge corresp<strong>on</strong>ding to q. In this<br />

situati<strong>on</strong>, LCA({ vi<br />

, v<br />

j<br />

}) is defined to be the node<br />

u farthest from r such that u is a ancestor of both p<br />

and q.<br />

v i<br />

v j<br />

S<br />

<br />

(v 1, v 3)<br />

S<br />

<br />

v 1<br />

P<br />

<br />

v 2<br />

(v 6, v 7) (v 1, v 4)<br />

v 3<br />

v 4<br />

S<br />

<br />

P<br />

<br />

(v 7, v 8)<br />

S<br />

<br />

v 6<br />

v 5<br />

v 8<br />

v 7<br />

(v 1, v 2)<br />

S<br />

<br />

(v 4, v 7) (v 2, v 5)<br />

S<br />

<br />

(v 5, v 8)<br />

P<br />

<br />

(v 3, v 6)<br />

Remarks:<br />

For each n<strong>on</strong>-leaf node u, denotes the terminals of G(u).<br />

Figure 4: A TTSP graph G and its corresp<strong>on</strong>ding<br />

parsing tree T.<br />

Definiti<strong>on</strong> 3: Suppose that u is a P-node of T(r). u is<br />

called a bottom P-node if all nodes of T(u) are either<br />

S-nodes or leaf nodes, except u itself. Otherwise, u is<br />

called a n<strong>on</strong>-bottom P-node. In additi<strong>on</strong>, u is called a<br />

top P-node if the ancestors of u in T(r) are all<br />

S-nodes. If u is not a top P-node, then u is called a<br />

n<strong>on</strong>-top P-node. By this definiti<strong>on</strong>, u can be a top<br />

P-node and a bottom P-node at the same time.<br />

Definiti<strong>on</strong> 4: For any bottom P-node u of T(r),<br />

pair_set(u) is defined as {{ vi<br />

, v<br />

j<br />

} | vi<br />

, v<br />

j<br />

∈<br />

V(G(u))}<br />

Definiti<strong>on</strong> 5: For any n<strong>on</strong>-bottom P-node u of T(r),<br />

pair_set(u) is defined as {{ vi<br />

, v<br />

j<br />

} | vi<br />

, v<br />

j<br />

∈<br />

V(G(u))} – ∪<br />

pair_set( v)<br />

.<br />

for all P-node<br />

v≠u<br />

of T ( u)<br />

Definiti<strong>on</strong> 6: For each n<strong>on</strong>-top P-node u, the lowest<br />

P-node ancestor of u, denoted as LPNA(u) is the<br />

P-node f satisfying the following c<strong>on</strong>diti<strong>on</strong>s: (1) f is<br />

nearest to u, and (2) f is in the path from u to the root<br />

r.<br />

Definiti<strong>on</strong> 7: For each n<strong>on</strong>-leaf node z of T(r), let q<br />

and f be the left child and the right child of z,<br />

respectively. Define left_descendants(z) = {x | x is a<br />

node in T(q).} and right_descendants(z) = {x | x is a<br />

node in T(f).}<br />

<str<strong>on</strong>g>The</str<strong>on</strong>g> following lemma can be easily established.<br />

Lemma 1: For any two distinct vertices vi<br />

, v<br />

j<br />

of<br />

G(r), there exists at most <strong>on</strong>e P-node u such that<br />

(v 2, v 8)<br />

-356-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!