10.07.2015 Views

A linear-time algorithm to compute geodesics in ... - Project Euclid

A linear-time algorithm to compute geodesics in ... - Project Euclid

A linear-time algorithm to compute geodesics in ... - Project Euclid

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

126 M. ELDERFigure 5. Level q, with3p − 1 = 11 edges on either side ofd 1,q ,d 2,q added.then ends with some word equal <strong>to</strong> a m for some power m. Sov = g x,q v ∗ wherev ∗ is of the form a m or PN. Note that |m| < 3p otherwise v is not geodesic.To <strong>compute</strong> v ∗ , we do the follow<strong>in</strong>g.Draw the l<strong>in</strong>e at level q with 3p−1 edges <strong>to</strong> the right and left of the po<strong>in</strong>t(s)d 1 ,d 2 . See Figure 5. Read a εq along the l<strong>in</strong>e from the po<strong>in</strong>t U, draw vertical tedge up, and cover the l<strong>in</strong>e with bricks as before. Label the po<strong>in</strong>ts on thenext level up as U, d 1,q+1 , (d 2,q+1 ). Do not discard the previous level as wedid before. This <strong>time</strong> we will s<strong>to</strong>re all levels from q <strong>to</strong> q + r.Aga<strong>in</strong> extend the l<strong>in</strong>e at level q +1 out by 3p − 1 edges on either side ofthese po<strong>in</strong>ts, read a δq+1 , and repeat.Note that we are s<strong>to</strong>r<strong>in</strong>g all these levels. Each level has a row of at most 7bricks, so the amount of space required <strong>to</strong> s<strong>to</strong>re these levels with three labelson each level is O(n log n) s<strong>in</strong>ce the labels take O(log n) space and the numberof levels is r ≤ n. Note also that we do not s<strong>to</strong>re each <strong>in</strong>dividual g i,j —wes<strong>to</strong>re g 1,q+r ,g 2,q+r only.At level q + r, fromthepo<strong>in</strong>tmarkedU, read a δq+r and mark the endpo<strong>in</strong>tby E r . As before, if v extends above this level, then it can go only a boundednumber of levels more, so draw these layers of bricks <strong>in</strong>, aligned with thepo<strong>in</strong>t E r . Soageodesic<strong>to</strong>E r will be one of a f<strong>in</strong>ite number of paths, asbefore. Choose a shortest path <strong>to</strong> E r ,appendt −r <strong>to</strong> it, and s<strong>to</strong>re it as v r .Note that l(v r ) ≤ n so we need O(n) space <strong>to</strong> s<strong>to</strong>re the word.Now the geodesic for u could be v r , or could be a path of the form v s =g x,q a ηq t ···ta ηq+s t −s with s

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

Saved successfully!

Ooh no, something went wrong!