Date post: | 18-Dec-2015 |
Category: |
Documents |
Upload: | eric-watkins |
View: | 217 times |
Download: | 1 times |
Fractional CascadingFractional Cascading
CSE737
2002
What is What is Fractional CascadingFractional Cascading anyway? 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 SearchingIterative Searching
Graph where vertices have lists associated.
Iterative SearchingIterative Searching
Graph where vertices have lists associated.
2, 44, 78, 234…
Iterative SearchingIterative Searching
Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative SearchingIterative Searching
Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative SearchingIterative Searching
Graph where vertices have lists associated. Do a search in lists associated with vertices along a path in the graph.
Iterative SearchingIterative 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: OnionExample of Iterative Searching: Onion
Find what layer a point lies on.
a
b
c
de
f
Example of Iterative Searching: OnionExample of Iterative Searching: Onion
Find what layer a point lies on.
a
b
c
de
f d
b f
a c e
Associated graph (binary tree)
Example of Iterative Searching: OnionExample of Iterative Searching: Onion
Find what layer a point lies on.
a
b
c
de
f d
b f
a c e
Search in the list associated to each vertex
Example of Iterative Searching: OnionExample of Iterative Searching: Onion
Find what layer a point lies on.
a
b
c
de
f d
b f
a c e
Search in the list associated to each vertex
Example of Iterative Searching: OnionExample of Iterative Searching: Onion
Find what layer a point lies on.
a
b
c
de
f d
b f
a c e
Query path along the graph
Some definitions [CG] Some definitions [CG] (1 of 16)(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] Some definitions [CG] (2 of 2)(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.
vertexedge
catalog
value in catalog
Example of a catalog graph:
CatalogCatalog
a
b
c
de
f d
b f
a c e
CatalogCatalog
b
d
b f
a c e
CatalogCatalog
b
b2
b3
b4
b5
b6
b1
d
b f
a c erecords
CatalogCatalog
b
d
b f
a c e
b: b1.key, b2.key, b3.key…
Catalog
b2
b3
b4
b5
b6
b1
CatalogCatalog
b
d
b f
a c e
b: b1.key, b2.key, b3.key…
Catalog
b2
b3
b4
b5
b6
b1 key
CatalogCatalog
b
d
b f
a c e
b: b0.key, b1.key… b0.key
Catalog (+ Range endpoints)
b2
b3
b4
b5
b6
b1b1
b0
UsageUsageUsing 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] More definitions [CG] (1 of 4)(1 of 4)
Augmented catalog: a catalog enlarged with additional records.
Augmented CatalogAugmented Catalog
a
b
c
de
f d
b f
a c e
Augmented CatalogAugmented Catalog
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
b0 c0
Augmented CatalogAugmented Catalog
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
b0 c0
Augmented CatalogAugmented Catalog
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
b0 c0
Augmented CatalogAugmented Catalog
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
c6’
b0 c0
Augmented CatalogAugmented Catalog
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
c6’
b: b1, b2, c3’, b3…
Augmented Catalog
b0 c0
More definitions [CG] More definitions [CG] (2 of 4)(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.
BridgeBridge
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
c6’
b0 c0
More definitions [CG] More definitions [CG] (3 of 4)(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.
GapGap
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
c6’
b0 c0
GapGap
b
cd
b f
a c eb2
b3
b4
b5
b6
b1
c1
c2
c3
c4
c5
c6
c7
c3’
c6’
Size=|{b3, b4, c4, c5}|=4
Gap
b0 c0
More definitions [CG] More definitions [CG] (4 of 4)(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]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 Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Add range endpoints
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Augment catalogs
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Augment catalogs
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Augment catalogs
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Set bridges
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Multiple Look-Up Query Multiple Look-Up Query
a
b
c
de
f d
b f
a c e
Query
Complexity [CG]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.
Star trees [CG]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
e6e7
e8
e9
e10
1
2
3
45
e1e2
e3e4
e5
e6
e7
e8
e9e10
Vertex with 10 edges: Star tree with 10 leaves:
Gateways [CG]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.
Contributions of YZ paperContributions 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.
•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]Applications [CG]
More definitions [CG] More definitions [CG] (2 of 2)(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