1 / 39

Schematization of Networks

Schematization of Networks. Rida Sadek. This talk discusses:. An algorithm that is studied in the following papers: S. Cabello, M. de Berg, and M. van Kreveld. Schematization of networks . Computational Geometry: Theory and Applications 30: 223–238 (2005). Overview. Introduction

edric
Download Presentation

Schematization of Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Schematization of Networks Rida Sadek

  2. This talk discusses: • An algorithm that is studied in the following papers: • S. Cabello, M. de Berg, and M. van Kreveld. Schematization of networks. Computational Geometry: Theory and Applications 30: 223–238 (2005).

  3. Overview • Introduction • Algorithm sketch • Definitions and concepts needed • Details of each part of the algorithm • When does the algorithm fails?

  4. Introduction • We have: railroad or highway map (a network map) • We want: A schematized version of that map • Nodes and connections to be displayed in a highly simplified form. • Preserve the approximate layout of the map  Preserve recognizability for readers.

  5. Introduction • Simplification is achieved by displaying the paths as a 2-link or 3-link paths AND links are restricted to certain orientations • Preserving recognizability is achieved by having the output map EQUIVALENT to the input map.

  6. Algorithm Input and Output • Input: A planar embedding of a graph consisting of polygonal paths between specified points called endpoints. • Output: Another planar embedding where all endpoints have the same positions AND every path is either a 2-link or 3-link path where links are restricted to certain orientations.

  7. Algorithm Sketch • Extract connections from original map and ORDER them top to bottom in a list. • Remove connections from original map but keep endpoints. • Place connections: • one by one from top to bottom leaving as much space as possible for later • Each newly placed connection must be of the desiredshape and below the previously placed connections

  8. Terminology • A path is a continuous mapping c: [0,1]  R2 • Let |c| denotes the complexity of the path c  the number of edges it has. • A (polygonal) map M is a set of simple polygonal paths {c1, …, cm} such that two paths do not intersect except at shared endpoints. • A monotone map is a map where all paths are x-monotone. • We denote by PM the set of endpoints {c(0), c(1) | c Є M}

  9. Definitions and Concepts • Equivalence: (intuitively) 2 maps are equivalent if all paths can be transformed from one map to the other in a continuous way, fixing the endpoints and without crossing any “important points”. • Important points of a path c are the endpoints of the other paths. • Algorithm can be adapted to take additional “important points”. • In terms of the algorithm, the algorithm should keep the face structure on both embeddings (input and output)  The cyclic order of paths around endpoints is maintained.

  10. Definitions and Concepts • Equivalence: (formally) Given a set of points P, two paths c and c’ with the same endpoints are equivalent in (R2 \ P) if and only if there exists a continuous function F : [0,1] x [0,1]  R2 \ P (minus P because the deformation of the path should not cross any point in P) such that: • F(0,t) = c(t) and F(1,t) = c’(t), for all t Є [0,1] (the first path is c, the final path is c’), • F(s,0) = c(0) = c’(0) and F(s,1) = c(1) = c’(1), for all sЄ[0,1] (the endpoints are fixed). • Two maps M = {c1,…,cm} and M’ = {c’1,…,c’m} are equivalent maps iff for some renumbering of the paths in M’, paths ci and c’i are equivalent in (R2\PM)U {ci(0), ci(1)} for all paths ciЄ M

  11. Definitions and Concepts • Above-Below relation among paths: • Let c be a path. • A point p ЄR2with p not on c is above (below) c if for every equivalent path c’ in R2 \ {p} the intersection of lp- (respectively lp+) and c’ is nonempty. • A path ci is above cj if ci(0) or ci(1) (one of the endpoints) is above cj, or if cj(0) or cj(1) is below ci.

  12. Definitions and Concepts • Lemma 1: The above-below relation among paths is an invariant between equivalent maps • Proof: • For any point p inR2, equivalent paths in R2\{p} have the same relation with respect to the point p. • Let M and M’ be equivalent maps. • And for every ci Є M, let c’iЄ M’ be its corresponding path. • Since ci and c’i are equivalent in (R2 \ PM) U {ci(0), ci(1)} (with respect to the endpoints of the paths without their own.) •  for any endpoint pЄ (PM \ {ci(0), ci(1)}) ci and c’i are also equivalent with respect to p. •  Any endpoint other than the endpoints of ci have the same above-below relationship with ci and c’i.  the Lemma.

  13. Canonical Sequence • It is the “thing” that will help us to algorithmically compute the above-below relation and equivalence among paths.

  14. Canonical Sequence(contd) • Let P be a set of points • Let lp- and lp+ be the vertical rays for all points pЄP • For a given path c: • Start walking from c(0) • Write the sequence of rays that are being crossed • Stop walking at c(1) • Repeatedly remove adjacent rays that are identical • Result is the canonical sequence of path c with respect to the set of points P

  15. Canonical Sequence (contd) • If P is only one point p Then: • Any path c’ equivalent to c with respect to P has to cross the rays lp+ or lp- that appear in the canonical sequence of c with respect to {p}. •  a point p is below a path c iff lp+ appear in the canonical sequence of c with respect to {p}.

  16. Canonical Sequence (contd) • Lemma 2: Two paths with the same endpoints have the same canonical sequence with respect to P if and only if they are equivalent in R2\P. • Proof: This Lemma is proofed using the concept of universal cover in a paper titled “Testing Homotopy (equivalence in our terms) for Paths in the Plane”.

  17. Above-Below Relations in Monotone Maps • The same definition we gave before using the monotonicity becomes: • x-monotone path a is above x-monotone path biff there are points (x,ya) Єa and (x,yb) Єb with ya>yb.

  18. Above-Below Relations in Monotone Maps (contd) • Facts for a monotone map M: • The above-below relation among paths is acyclic. • If a is above b and b above c then c is below a and below b AND can’t be above a nor b. • If M has complexity n, then a total order extending the above-below relation can be computed in O(nlogn) • Note also that: • If a given map M do not admit a partial order among its paths then no monotone map can be equivalent to M.

  19. Above-Below Relations in Monotone Maps (contd) • Let M = {c1,… ,cm} and M’={c’1,…,c’m} be two monotone maps such that the paths ci and c’i have the same endpoints. Then, the maps M and M’ are equivalent if and only ifthey define the same above-below relation.

  20. Above-Below Relations in Monotone Maps (contd) • Proof: • We have already proven the first implication when we said that the above-below relation among paths is an invariant between equivalent maps. • To prove the other implication we will show that if M and M’ are not equivalent then they define a different above-below relation. • If ci and c’i are not equivalent in R2\PM U {ci(0), ci(1)} • Then there is a point p in the regions between the 2 paths in question • These regions are well defined because the paths are x-monotone. •  p has a different above-below relation with ci and c’i • AND for any path cj that has p as an endpoint • The above-below relation between cj and ci is different than the above-below relation between c’j and c’i.

  21. Computing the Order in a map • This is done in 3 steps: • Convert the map into a rectified map. • Transform the rectified map into a map with x-monotone pieces. • Compute the order on that map.

  22. Rectified maps • Definition: A set of paths M’ = {c’1,…,c’m} is a rectification of a map M = {c1,… ,cm} if: • M’ is a map (its paths only intersect in common endpoints); • the complexity of map M’ is linear in the complexity of map M; • paths c’i are made of axis-aligned segments; • paths ci and cj have the same above-below relation as c’i and c’j .

  23. How we rectify M? • Decompose each path ci into monotone pieces {ci1;…; ciki} and the result is Mmono = {c11,…,c1k1,…,cm1,…,cmkm} • Mmono has complexity O(n). •  we can compute a total order extending the partial order in O(nlogn) (as we have seen before in the facts of the monotone map). This will lead to a rank r for each piece.

  24. Construction of the rectified map • Let cij be a piece with left endpoint (px,py), right endpoint (qx, qy), and rank r. • Make the horizontal segment hij= [px, qx] * r in the rectified map. • Path c’i joins hi1, … , hikby connecting the endpoints of every two consecutive horizontal segments by a vertical segment • M’ is the collection of these paths {c’1,…,c’m} • Note that an endpoint sharing several paths will be mapped into several points above each other vertically BECAUSE same x but different rank r.

  25. Time analysis for computation of M’ • As per a previous fact that states: If M is monotone and has complexity n, then a total order extending the above-below relation (or any partial relation) can be computed in O(nlogn) • The work done after that take actually O(n) time since each step takes O(1) time and Mmono has O(n) complexity. •  O(nlogn) time in total.

  26. Computing order using a rectified map • In a paper titled “Testing Homotopy (equivalence in our terms) for Paths in the Plane” an algorithm called rcp (rectified canonical path) is presented. • rcp transforms the path c’i Є M’ (the rectified map) into another path rcp(c’i) with the following properties: • rcp(c’i) is equivalent to c’iin (R2\PM) U {c’i(0), c’i(1)} • |rcp(c’i)| ≤ |c’i|; • if c’iand c’jdon't intersect, then rcp(c’i) and rcp(c’j) do not intersect either; • rcp(c’i) has the minimum possible number of x-monotone pieces that any path equivalent toc’iin (R2\PM) U {c’i(0), c’i(1)} can have.

  27. Computing order using a rectified map (contd) • Use rcp to get a map N = {rcp(c’1),…,rcp(c’m)} • N has the following properties: • It is a map with complexity O(n): • M’ has complexity linear to M (by definition) • |rcp(c’i)| ≤ |c’i| • N can be constructed in O(nlogn) • To make M’ we take O(nlogn) • To make N we take O(|M’|log|M’|) and since |M’| is O(n) •  O(nlogn) • N has the same above-below relation among its paths as M • rcp(c’i) is equivalent to c’i (by properties of rcp) • ci and cj have the same above-below relation as c’i and c’j (by definition of rectified maps) •  N has the same above-below relation as M

  28. Computing order using a rectified map (contd) • Claim: N is monotone if and only if M admits an equivalent monotone map. • Only going to proof that if M admit an equivalent monotone map then N is monotone • The other implication will not be proven • After proving the Claim we can conclude that we can decide in O(nlogn) time whether an equivalent monotone map exists for M.

  29. Computing order using a rectified map (contd) • Proof: • Recall: An endpoint pЄPM of several paths in M is mapped into several endpoints p’ЄPM’ in M’ • By construction, no segment of M’ can pass between 2 points of p’ •  When considering the canonical sequence of a path c’i with respect to PM’\{c’i(0),c’i(1)} we can treat the set of these p’ points as one point. Let that point be also called p’.

  30. Computing order using a rectified map (contd) • Proof (contd): • This means that • IF replace each occurrence of lp+ with lp’+(same for lp-) in the canonical seq of ci with respect to PM\{ci(0),ci(1)} THEN we get the canonical sequence of c’i with respect to PM’\{c’i(0),c’i(1)} • NOW: • IF M admit a monotone equivalent map THEN the canonical seq of each path ci ЄMdon’t contain 2 rays emanating from the same point (otherwise there would be a turn point which contradicts the monotone hypotheses) •  Canonical seq c’i don’t contain 2 rays emanating from the same point. • By the last property of rcp “rcp(c’i) has the minimum possible number of x-monotone pieces that any path equivalent toc’i in (R2\PM ) U {c’i(0), c’i(1)} can have” we conclude that rcp(c’i) is x-monotone. •  N is monotone.

  31. Computing order using a rectified map (contd) • Finally: • Since the order among paths in M is the same as the order among paths in N • And Since if M admit a monotone equivalent map then N is monotone. • And Since we can compute a total order extending the partial order (above-below) among paths of N in O(nlogn) time (because N is monotone) • THEREFORE we can compute in O(nlogn) time a total order extending the partial order (above-below) among paths of M.

  32. Recall • The sketch of the algorithm was: • Extract connections from original map and ORDER them top to bottom in a list. (DONE) • Remove connections from original map but keep endpoints. • Place connections one by one leaving as much space as possible for later AND each newly placed connection must be of the desiredshape and below the previously placed connections (LEFT to do)

  33. Placing paths in the schematic map • Place paths one by one in the computed order • Place each path as high as possible. A minimum vertical separation distance can be specified. • Each path is either a 2-link or a 3-link path where each link has a certain direction. • The idea of the algorithm can be applied to any type of schematic connection (variations of 2-link or 3-link).

  34. Placing paths in the schematic map (contd) • We are going to describe the placement algorithm for the case of 3-link {HDH,VDV} paths that are L2 shortest.

  35. Placing paths in the schematic map (contd) • Idea: • Incrementally place paths from top to bottom respecting the order. • Maintain the lower envelope of the already-placed paths in a balanced binary search tree sorted on x-coordinate. • To add a path: • Search with the left and right endpoints and collect the part of the lower envelope in between. • Determine the topmost placement of the new path, with or without a minimum separation distance. • The new path will replace the pieces of the lower envelope we collected • In the tree this is basically: deleting the leaves we collected and inserting up to 3 leaves (a leaf for each link).

  36. Placing paths in the schematic map (contd) • In the case of {HDH, VDV}-paths, to decide which kind of path to use, we make use of the endpoints of the path. • Since the path has to be L2 shortest then: • Use HDH path when vertical distance between the endpoints is smaller than the horizontal distance • Otherwise use VDV.

  37. Placing paths in the schematic map (contd) • Time analysis: • Searching with the left and right endpoints in the tree takes O(logn) time. • Updating the tree involves • Deletion of k leaves (where k in the number of pieces the new path is below) • Insertion of O(1) leaves (at most 3). • This takes O((k+1)logn) time • Since in total O(n) leaves are inserted and each leave is deleted at most once  Total time of placing the schematic paths takes O(nlogn) time.

  38. When does the algorithm fails? • It fails in 2 different ways: • When computing the order: • It can happen that the connections cannot be ordered. • When placing the connections: • It can happen that we cannot place the next connection due to the schematic connection chosen • When placing the next path, if an endpoint happens to be above the part of lower envelope we searched for.

  39. Questions?

More Related