Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 1 Schematization of Networks Rida Sadek

2 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 3 Overview Introduction Algorithm sketch Definitions and concepts needed Details of each part of the algorithm When does the algorithm fails?

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

5 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 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 7 Algorithm Sketch 1) Extract connections from original map and ORDER them top to bottom in a list. 2) Remove connections from original map but keep endpoints. 3) 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 desired shape and below the previously placed connections

8 8 Terminology  A path is a continuous mapping c: [0,1]  R 2  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 {c 1, …, c m } 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 P M the set of endpoints {c(0), c(1) | c Є M}

9 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 10 Definitions and Concepts Equivalence: (formally) Given a set of points P, two paths c and c’ with the same endpoints are equivalent in (R 2 \ P) if and only if there exists a continuous function F : [0,1] x [0,1]  R 2 \ 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 = {c 1,…,c m } and M’ = {c’ 1,…,c’ m } are equivalent maps iff for some renumbering of the paths in M’, paths c i and c’ i are equivalent in (R 2 \P M )U {c i (0), c i (1)} for all paths c i Є M

11 11 Definitions and Concepts Above-Below relation among paths:  Let c be a path. A point p Є R 2 with p not on c is above (below) c if for every equivalent path c’ in R 2 \ {p} the intersection of l p - (respectively l p + ) and c’ is nonempty. A path c i is above c j if c i (0) or c i (1) (one of the endpoints) is above c j, or if c j (0) or c j (1) is below c i.

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

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

14 14 Canonical Sequence(contd) Let P be a set of points Let l p - and l p + 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 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 l p + or l p - that appear in the canonical sequence of c with respect to {p}.   a point p is below a path c iff l p + appear in the canonical sequence of c with respect to {p}.

16 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 R 2 \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 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 b iff there are points (x,y a ) Є a and (x,y b ) Є b with y a >y b.

18 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 19 Above-Below Relations in Monotone Maps (contd) Let M = {c 1,…,c m } and M’={c’ 1,…,c’ m } be two monotone maps such that the paths c i and c’ i have the same endpoints. Then, the maps M and M’ are equivalent if and only if they define the same above-below relation.

20 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 c i and c’ i are not equivalent in R 2 \P M U {c i (0), c i (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 c i and c’ i  AND for any path c j that has p as an endpoint  The above-below relation between c j and c i is different than the above-below relation between c’ j and c’ i.

21 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 22 Rectified maps Definition: A set of paths M’ = {c’ 1,…,c’ m } is a rectification of a map M = {c 1,…,c m } 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 c i and c j have the same above-below relation as c’ i and c’ j.

23 23 How we rectify M? Decompose each path c i into monotone pieces {c i 1 ;…; c i ki } and the result is M mono = {c 1 1,…,c 1 k1,…,c m 1,…,c m km } M mono 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 24 Construction of the rectified map Let c i j be a piece with left endpoint (p x,p y ), right endpoint (q x, q y ), and rank r. Make the horizontal segment h i j = [px, qx] * r in the rectified map. Path c’ i joins h i 1, …, h i k by 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 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 M mono has O(n) complexity.  O(nlogn) time in total.

26 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’ i in (R 2 \P M ) U {c’ i (0), c’ i (1)}  |rcp(c’ i )| ≤ |c’ i |;  if c’ i and c’ j don'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 to c’ i in (R 2 \P M ) U {c’ i (0), c’ i (1)} can have.

27 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) c i and c j 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 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 29 Computing order using a rectified map (contd) Proof:  Recall: An endpoint pЄP M of several paths in M is mapped into several endpoints p’ЄP M’ 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 P M’ \{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 30 Computing order using a rectified map (contd) Proof (contd):  This means that IF replace each occurrence of l p + with l p’ + (same for l p - ) in the canonical seq of c i with respect to P M \{c i (0),c i (1)} THEN we get the canonical sequence of c’ i with respect to P M’ \{c’i(0),c’i(1)}  NOW: IF M admit a monotone equivalent map THEN the canonical seq of each path c i Є M don’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 to c’ i in (R 2 \P M ) U {c’ i (0), c’ i (1)} can have” we conclude that rcp(c’ i ) is x-monotone.   N is monotone.

31 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 32 Recall The sketch of the algorithm was: 1) Extract connections from original map and ORDER them top to bottom in a list. (DONE) 2) Remove connections from original map but keep endpoints. 3) Place connections one by one leaving as much space as possible for later AND each newly placed connection must be of the desired shape and below the previously placed connections (LEFT to do)

33 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 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 L 2 shortest.

35 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 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 L 2 shortest then:  Use HDH path when vertical distance between the endpoints is smaller than the horizontal distance  Otherwise use VDV.

37 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 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 39 Questions?


Download ppt "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."

Similar presentations


Ads by Google