Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fractional Cascading CSE737 2002. What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal.

Similar presentations


Presentation on theme: "Fractional Cascading CSE737 2002. What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal."— Presentation transcript:

1 Fractional Cascading CSE737 2002

2 What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal time in linear space. [“Fractional Cascading”, Chazelle & Guibas, Algorithmica, 1986] An efficient strategy for solving the multiple look-up query problems. [“Yet Another Look at Fractional Cascading. B-graphs with Application to Point Location”, Yap & Zhu, CCCG, 2001] A technique to reduce the query time in the case of many 1-dimensional searches with the same range by using the result of one search to speed up other searches. [dBvKOS]

3 Iterative Searching Graph where vertices have lists associated.

4 Iterative Searching Graph where vertices have lists associated. 2, 44, 78, 234…

5 Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.

6 Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.

7 Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.

8 Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.

9 Example of Iterative Searching: Onion Find what layer a point lies on. a b c d e f

10 Example of Iterative Searching: Onion Find what layer a point lies on. a b c d e f d bf ace Associated graph (binary tree)

11 Example of Iterative Searching: Onion Find what layer a point lies on. a b c d e f d bf ace Search in the list associated to each vertex

12 Example of Iterative Searching: Onion Find what layer a point lies on. a b c d e f d bf ace Search in the list associated to each vertex

13 Example of Iterative Searching: Onion Find what layer a point lies on. a b c d e f d bf ace Query path along the graph

14 Some definitions [CG] (1 of 16) Catalog: an ordered collection of records with values, stored in non-decreasing order of the value. Values can be repeated inside a catalog, and a catalog contains at least values –  and . Range: an interval of the form [x,y], [x,+  ], [- ,y], specified by the two endpoints. For most problems this is [- , +  ], and can be dropped altogether. Catalog graph: an undirected and connected graph, with one catalog at each vertex and several ranges at each edge. Ranges are specified as pairs of values from the catalogs associated with the vertices joined by the associated edge.

15 Some definitions [CG] (2 of 2) Multiple lookup query: a pair (x,p), where x is the key value and p the search path such that value x falls within the range of all edges on the path p. vertex edge catalog value in catalog Example of a catalog graph:

16 Catalog a b c d e f d bf ace

17 Catalog b d bf ace

18 Catalog b b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 d bf ace records

19 Catalog b d bf ace b: b 1.key, b 2.key, b 3.key… Catalog b2b2 b3b3 b4b4 b5b5 b6b6 b1b1

20 Catalog b d bf ace b: b 1.key, b 2.key, b 3.key… Catalog b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 key

21 Catalog b d bf ace b: b 0.key, b 1.key… b 0.key Catalog (+ Range endpoints) b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 b1b1 b0b0

22 Usage Using these concepts, the iterative search problem can be reformulated as looking up a key in the catalogs associated with each vertex along the path. The goal is to construct a data structure such that: 1) Somehow each pair of neighboring catalogs is correlated so a search in one aids a search in the other. 2) The storage space is still linear.

23 More definitions [CG] (1 of 4) Augmented catalog: a catalog enlarged with additional records.

24 Augmented Catalog a b c d e f d bf ace

25 b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 b0b0 c0c0

26 b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 b0b0 c0c0

27 b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ b0b0 c0c0

28 b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ c6’c6’ b0b0 c0c0

29 b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ c6’c6’ b: b 1, b 2, c 3 ’, b 3 … Augmented Catalog b0b0 c0c0

30 More definitions [CG] (2 of 4) Augmented catalog: a catalog enlarged with additional records. Bridge: a record in an augmented catalog pointing to a record with the same value in a neighboring augmented catalog.

31 Bridge b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ c6’c6’ b0b0 c0c0

32 More definitions [CG] (3 of 4) Augmented catalog: a catalog enlarged with additional records. Bridge: a record in an augmented catalog pointing to a record with the same value in a neighboring augmented catalog. Gap: a pair of consecutive bridges associated with an edge. To ensure the time bound, gaps have sizes less than 6d-1, where d is the (locally bounded) degree of the graph.

33 Gap b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ c6’c6’ b0b0 c0c0

34 Gap b c d bf ace b2b2 b3b3 b4b4 b5b5 b6b6 b1b1 c1c1 c2c2 c3c3 c4c4 c5c5 c6c6 c7c7 c3’c3’ c6’c6’ Size=|{b 3, b 4, c 4, c 5 }|=4 Gap b0b0 c0c0

35 More definitions [CG] (4 of 4) Augmented catalog: a catalog enlarged with additional records. Bridge: a record in an augmented catalog pointing to a record with the same value in a neighboring augmented catalog. Gap: a pair of consecutive bridges associated with an edge. To ensure the time bound, gaps have sizes less than 6d-1, where d is the (locally bounded) degree of the graph. Specifically, augmenting a catalog is adding records with values present in neighboring catalogs, such that bridges from them have records with the same value on both sides.

36 Answering a query [CG] If we know the position of a value in an augmented catalog, we can compute its position in the original catalog in one step. If we know the position of a value in an augmented catalog, we can compute the position of that value in a neighboring augmented catalog in O(d) time, where d is the degree of the vertex. Summarizing, we can handle any multiple lookup query provided that the structures has already been built and efficient searching is possible for the first augmented catalog that is considered.

37 Multiple Look-Up Query a b c d e f d bf ace

38 a b c d e f d bf ace Add range endpoints

39 Multiple Look-Up Query a b c d e f d bf ace Augment catalogs

40 Multiple Look-Up Query a b c d e f d bf ace Augment catalogs

41 Multiple Look-Up Query a b c d e f d bf ace Augment catalogs

42 Multiple Look-Up Query a b c d e f d bf ace Set bridges

43 Multiple Look-Up Query a b c d e f d bf ace Query

44 Multiple Look-Up Query a b c d e f d bf ace Query

45 Multiple Look-Up Query a b c d e f d bf ace Query

46 Multiple Look-Up Query a b c d e f d bf ace Query

47 Multiple Look-Up Query a b c d e f d bf ace Query

48 Multiple Look-Up Query a b c d e f d bf ace Query

49 Multiple Look-Up Query a b c d e f d bf ace Query

50 Multiple Look-Up Query a b c d e f d bf ace Query

51 Complexity [CG] For a graph of size s and degree d it is possible to construct a data structure to solve the iterative search problem in O(s) space and O(ds) time. The time bound can be improved using star trees to construct an emulation graph, thus decreasing the degree of any vertex to 3. The new bound is O(p log d + log s), where p is the length of the search path.

52 Star trees [CG] A star tree Tn is an oriented tree with n leaves, endowed with a special vertex: its center. Tn can be obtained from Tn-1 by adding 2 new edges to the leaf closest to the center. Star trees are used here to replace vertices and to ensure that the final degree of the graph is minimal. e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 1 2 3 4 5 e1 e2 e3 e4 e5 e6 e7 e8 e9e10 Vertex with 10 edges:Star tree with 10 leaves:

53 Gateways [CG] To get the search started, we would have to keep a copy of all augmented catalogs in a table, and perform the first search in one of them. To avoid this, we introduce gateways, vertices that have augmented catalogs attached to them, but no catalogs per se. Processing the new nodes yields paths consisting of transit edges and transit vertices. The new structure closely resembles a B-tree. The difference is that splitting and merging gaps may result in coming back to a node previously visited, and go on for an unpredictable length of time.

54 Contributions of YZ paper In practice catalog graphs are usually trees (directed, acyclic…). Reformulate catalog graphs as catalog DAGs. Relax bridges into semi-bridges (unidirectional pointers): easier to maintain and more space-efficient. In Chazelle & Guibas the query path is ‘magically’ built. Yap & Zhu introduce edge types and discriminant functions to build the query path. Introduce B-graphs as counterparts to catalog DAGs and true generalization of B-trees, inheriting their well- known advantages for I/O efficient algorithms. Generalize the point location algorithm for line segments to monotone chains.

55 Explicit iterative search. Intersecting a polygonal path with a line (using convex hulls). Slanted range search (points inside a trapezoid). Orthogonal range search. Orthogonal range search in the past. Computing locus-functions. Space compression of data structures. Iterative search extensions of query problems. Applications [CG]

56 More definitions [CG] (2 of 2) vertex in the graph edge in the graph augmented catalog old value in catalog Example of a graph with augmented catalogs: new value in catalog bridge gap


Download ppt "Fractional Cascading CSE737 2002. What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal."

Similar presentations


Ads by Google