Shortest path in a multiply-connected domain having curved ...
Shortest path in a multiply-connected domain having curved ...
Shortest path in a multiply-connected domain having curved ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
7 Appendix: Pseudocode of the algorithms<br />
Algorithm 1 GetP CT s(X,CurveList)<br />
1: Get all PCTs from X to members <strong>in</strong> CurveList<br />
2: Elim<strong>in</strong>ate PCTs that are not completely conta<strong>in</strong>ed <strong>in</strong> the MCD and store it <strong>in</strong> P CT List<br />
3: Elim<strong>in</strong>ate curves and PCTs us<strong>in</strong>g exterior and <strong>in</strong>terior region identification.<br />
4: return T angentList,CurveList<br />
Algorithm 2 GetBT s(T gtL<strong>in</strong>e,CurveList,P resentP ath,T erm<strong>in</strong>ationList)<br />
1: [SearchCurve,SearchP ar,Dir] = T gtL<strong>in</strong>e.[EndCurve, EndP ar, Dir]<br />
2: if T gtL<strong>in</strong>e not elim<strong>in</strong>ated accord<strong>in</strong>g to section 4.3 then<br />
3: if T gtL<strong>in</strong>e is merged with a processed tangent,P rocessedT angent then<br />
4: Add the subtree of <strong>path</strong>s under P rocessedT angent and update <strong>path</strong> lengths<br />
5: else<br />
6: NextInflection= Identify next <strong>in</strong>flection po<strong>in</strong>t<br />
7: for Each Curve <strong>in</strong> CurveList do<br />
8: BT List= Get all BTs between SearchCurve and Curve<br />
9: Identify BTs hav<strong>in</strong>g StartP ar between SearchP ar and NextInflection<br />
10: Elim<strong>in</strong>ate BTs that are not consistent with the direction Dir accord<strong>in</strong>g to lemma2<br />
11: Elim<strong>in</strong>ate BTs that are not completely conta<strong>in</strong>ed <strong>in</strong> the MCD<br />
12: end for<br />
13: (NextT gtList,CurveList) = Rema<strong>in</strong><strong>in</strong>g BTs and Curves after elim<strong>in</strong>ation us<strong>in</strong>g exterior<br />
and <strong>in</strong>terior region identification.<br />
14: for Each T gtL<strong>in</strong>e <strong>in</strong> NextT gtList do<br />
15: P resentP ath += Concave portion + T gtL<strong>in</strong>e<br />
16: T ermCheck = Check for term<strong>in</strong>ation with tangents from T erm<strong>in</strong>ationList<br />
17: if T ermCheck == false then<br />
18: (NextBT List, CurveList) = GetBT s(T gtL<strong>in</strong>e,CurveList,P resentP ath,<br />
T erm<strong>in</strong>ationList)<br />
19: else<br />
20: P resentP ath += Concave portion + Corres. tgt. <strong>in</strong> T erm<strong>in</strong>ationList<br />
21: Add P resentP ath to <strong>Shortest</strong>P athList<br />
22: end if<br />
23: end for<br />
24: end if<br />
25: end if<br />
18