560 likes | 913 Views
Fractional Cascading. CSE737. 2002. 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]
E N D
Fractional Cascading CSE737 2002
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]
Iterative Searching Graph where vertices have lists associated.
Iterative Searching Graph where vertices have lists associated. 2, 44, 78, 234…
Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative Searching Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Example of Iterative Searching: Onion Find what layer a point lies on. c f e d b a
Example of Iterative Searching: Onion Find what layer a point lies on. c f d e d b f a c e b Associated graph (binary tree) a
Example of Iterative Searching: Onion Find what layer a point lies on. c f d e d b f a c e b Search in the list associated to each vertex a
Example of Iterative Searching: Onion Find what layer a point lies on. c f d e d b f a c e b Search in the list associated to each vertex a
Example of Iterative Searching: Onion Find what layer a point lies on. c f d e d b f a c e b Query path along the graph a
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.
Some definitions [CG] (2 of 2) Example of a catalog graph: value in catalog catalog edge vertex 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.
Catalog c f d e d b f a c e b a
Catalog d b f a c e b
Catalog d b2 b f records a c e b b3 b1 b6 b4 b5
Catalog Catalog d b: b1.key, b2.key, b3.key… b2 b f a c e b b3 b1 b6 b4 b5
Catalog Catalog d b: b1.key, b2.key, b3.key… b2 b f a c e b b3 b1 key b6 b4 b5
Catalog Catalog (+ Range endpoints) d b: b0.key, b1.key… b0.key b2 b f a c e b b3 b1 b1 b0 b6 b4 b5
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.
More definitions [CG] (1 of 4) Augmented catalog: a catalog enlarged with additional records.
Augmented Catalog c f d e d b f a c e b a
Augmented Catalog c3 c c2 d c4 b f b2 c1 a c e b b3 c5 b1 b0 c0 b6 b4 b5 c7 c6
Augmented Catalog c3 c c2 d c4 b f b2 c1 a c e b b3 c5 b1 b0 c0 b6 b4 b5 c7 c6
Augmented Catalog c3 c c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c7 c6
Augmented Catalog c3 c c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c6’ c7 c6
Augmented Catalog Augmented Catalog c3 c b: b1, b2, c3’, b3… c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c6’ c7 c6
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.
Bridge c3 c c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c6’ c7 c6
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.
Gap c3 c c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c6’ c7 c6
Gap Gap Size=|{b3, b4, c4, c5}|=4 c3 c c2 d c4 b f b2 c1 c3’ a c e b b3 c5 b1 b0 c0 b6 b4 b5 c6’ c7 c6
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.
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.
Multiple Look-Up Query f c d e d b f a c e b a
Multiple Look-Up Query Add range endpoints f c d e d b f a c e b a
Multiple Look-Up Query Augment catalogs f c d e d b f a c e b a
Multiple Look-Up Query Augment catalogs f c d e d b f a c e b a
Multiple Look-Up Query Augment catalogs f c d e d b f a c e b a
Multiple Look-Up Query Set bridges f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a
Multiple Look-Up Query Query f c d e d b f a c e b a