21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

298 R. Lev<strong>in</strong>, I. Newman, and G. Haber<br />

v ∈V do:<br />

7. foreach t<br />

a. if D(v) > 0 then<br />

i. L ← L ∪{<br />

v,<br />

t'<br />

} , b(<br />

v,<br />

t'<br />

) ← D(<br />

v),<br />

c(<br />

v,<br />

t'<br />

) ← D(<br />

v)<br />

b. if D(v) < 0 then<br />

8. V '← V ∪ { s',<br />

t'}<br />

9. E'← E ∪ Er<br />

∪ L ∪ t',<br />

s'<br />

i. L ← L∪<br />

{ s',<br />

v } , b(<br />

s',<br />

v ) ←−D(<br />

v),<br />

c(<br />

s',<br />

v ) ←−D(<br />

v)<br />

Note that <strong>in</strong> the f<strong>in</strong>al phase of the construction we add an edge from t to s to create<br />

a circulation problem rather than a flow problem.<br />

Any solution to the circulation problem is a flow function for each edge <strong>in</strong> E'. For<br />

each edge <strong>in</strong> the orig<strong>in</strong>al graph, e = v,<br />

u ∈ E we then calculate the fixup vector,<br />

Δ(e) as follows:<br />

⎧ f ( v,<br />

u)<br />

Δ(<br />

) = ⎨<br />

⎩−<br />

f ( u,<br />

v)<br />

f ( v,<br />

u)<br />

≥ 0⎫<br />

⎬<br />

f ( u,<br />

v)<br />

< 0⎭<br />

e . By mapp<strong>in</strong>g back the edges<br />

which were derived from the vertices when we applied the vertex transformation (the<br />

vertex splitt<strong>in</strong>g at the beg<strong>in</strong>n<strong>in</strong>g of this section) we can determ<strong>in</strong>e the values of Δ(v)<br />

for each v <strong>in</strong> V as well.<br />

4.2 Complexity of the Algorithm<br />

Goldberg & Tarjan [5], present an algorithm for the circulation problem.<br />

Theoretically the worst runn<strong>in</strong>g time of this algorithm is:<br />

2 2 ( V E ⋅ m<strong>in</strong>(<br />

log(<br />

V ⋅C<br />

) , E ⋅ ( V ) )<br />

O ⋅ log<br />

(4)<br />

Note that C is the maximum absolute value of an arc cost. Despite this frighten<strong>in</strong>g<br />

worst case complexity we found that <strong>in</strong> practice the algorithm performed very well on<br />

the benchmarks from SPEC<strong>in</strong>t which we used for our analysis, and the algorithm's<br />

runtime was not an issue worth address<strong>in</strong>g when we applied it <strong>in</strong> procedure<br />

granularity (thus apply<strong>in</strong>g it on control flow graphs derived from procedures). Even as<br />

some of the control flow graphs which correspond to procedures from SPEC<strong>in</strong>t<br />

benchmarks conta<strong>in</strong>ed thousands of vertices and edges.<br />

5 Estimat<strong>in</strong>g Vertex and Edge Frequencies<br />

After gather<strong>in</strong>g many experimental results and study<strong>in</strong>g several cost coefficient<br />

functions we choose to def<strong>in</strong>e the cost coefficient function for the vertices and edges<br />

as follows:<br />

k'(<br />

Δ(<br />

o)<br />

)<br />

cp ( o)<br />

=<br />

, k ( ( o)<br />

)<br />

ln(<br />

w(<br />

o)<br />

+ 2)<br />

⎧Δ(<br />

o)<br />

≥ 0<br />

= ⎨<br />

⎩Δ(<br />

o)<br />

< 0<br />

+<br />

o<br />

Δ −<br />

ko<br />

k<br />

⎫<br />

⎬<br />

⎭<br />

' (5)

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

Saved successfully!

Ooh no, something went wrong!