ArticleslgStudy

computer science

Fractional cascading

Fractional cascading is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Fractional cascading rather than just read about it. In short: In computer science, fractional cascading is a technique to speed up a sequence of binary searches for the same value in a sequence of related data structures. The first binary search in the sequence takes a logarithmic amount of time, as is standard for binary searches, but successive searches in the sequence are faster.

Fractional cascading — main illustration
Fractional cascading — illustration

Key takeaways

  • Fractional cascading belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Fractional cascading to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Fractional cascading from memory before moving on to harder problems.

Reference excerpt

In computer science, fractional cascading is a technique to speed up a sequence of binary searches for the same value in a sequence of related data structures. The first binary search in the sequence takes a logarithmic amount of time, as is standard for binary searches, but successive searches in the sequence are faster. The original version of fractional cascading, introduced in two papers by Chazelle and Guibas in 1986 (Chazelle & Guibas 1986a; Chazelle & Guibas 1986b), combined the idea of cascading, originating in range searching data structures of Lueker (1978) and Willard (1978), with the idea of fractional sampling, which originated in Chazelle (1983). Later authors introduced more complex forms of fractional cascading that allow the data structure to be maintained as the data changes by a sequence of discrete insertion and deletion events.

Example As a simple example of fractional cascading, consider the following problem. We are given as input a collection of k ordered lists Li of numbers, such that the total length ∑i|Li| of all lists is n, and must process them so that we can perform binary searches for a query value q in each of the k lists. For instance, with k=4 and n=17,

L1 = 24, 64, 65, 80, 93 L2 = 23, 25, 26 L3 = 13, 44, 62, 66 L4 = 11, 35, 46, 79, 81 The simplest solution to this searching problem is just to store each list separately. If we do so, the space requirement is O(n), but the time to perform a query is O(klog⁡(n/k)), as we must perform a separate binary search in each of k lists. The worst case for querying this structure occurs when each of the k lists has equal size n/k, so each of the k binary searches involved in a query takes time O(log⁡(n/k)). A second solution allows faster queries at the expense of more space: we may merge all the k lists into a single big list L, and associate with each item x of L a list of the results of searching for x in each of the smaller lists Li. If we describe an element of this merged list as x[a,b,c,d] where x is the numerical value and a, b, c, and d are the positions (the first number has position 0) of the next element at least as large as x in each of the original input lists (or the position after the end of the list if no such element exists), then we would have

L = 11[0,0,0,0], 13[0,0,0,1], 23[0,0,1,1], 24[0,1,1,1], 25[1,1,1,1], 26[1,2,1,1], 35[1,3,1,1], 44[1,3,1,2], 46[1,3,2,2], 62[1,3,2,3], 64[1,3,3,3], 65[2,3,3,3], 66[3,3,3,3], 79[3,3,4,3], 80[3,3,4,4], 81[4,3,4,4], 93[4,3,4,5] This merged solution allows a query in time O(k+log⁡n): simply search for q in L and then report the results stored at the item x found by this search. For instance, if q=50, searching for q in L finds the item 62[1,3,2,3], from which we return the results L1[1]=64, L2[3] (a flag value indicating that q is past the end of L2), L3[2]=62, and L4[3]=79. However, this solution pays a high penalty in space complexity: it uses space O(kn) as each of the n items in L must store a list of k search results. Fractional cascading allows this same searching problem to be solved with time and space bounds meeting the best of both worlds: query time O(k+log⁡n), and space O(n). The fractional cascading solution is to store a new sequence of lists Mi. The final list in this sequence, Mk, is equal to Lk; each earlier list Mi is formed by merging Li with every second item from Mi+1. With each item x in this merged list, we store two numbers: the position resulting from searching for x in Li and the position resulting from searching for x in Mi+1. For the data above, this would give us the following lists:

M1 = 24[0, 1], 25[1, 1], 35[1, 3], 64[1, 5], 65[2, 5], 79[3, 5], 80[3, 6], 93[4, 6] M2 = 23[0, 1], 25[1, 1], 26[2, 1], 35[3, 1], 62[3, 3], 79[3, 5] M3 = 13[0, 1], 35[1, 1], 44[1, 2], 62[2, 3], 66[3, 3], 79[4, 3] M4 = 11[0, 0], 35[1, 0], 46[2, 0], 79[3, 0], 81[4, 0] Suppose we wish to perform a query in this structure, for q=50. We first do a standard binary search for q in M1, finding the value 64[1,5]. The "1" in 64[1,5], tells us that the search for q in L1 should return L1[1]=64. The "5" in 64[1,5] tells us that the approximate location of q in M2 is position 5. More precisely, binary searching for q in M2 would return either the value 79[3,5] at position 5, or the value 62[3,3] one place earlier. By comparing q to 62, and observing that it is smaller, we determine that the correct search result in M2 is 62[3,3]. The first "3" in 62[3,3] tells us that the search for q in L2 should return L2[3], a flag value meaning that q is past the end of list L2. The second "3" in 62[3,3] tells us that the approximate location of q in M3 is position 3. More precisely, binary searching for q in M3 would return either the value 62[2,3] at position 3, or the value 44[1,2] one place earlier. A comparison of q with the smaller value 44 shows us that the correct search result in M3 is 62[2,3]. The "2" in 62[2,3] tells us that the search for q in L3 should return L3[2]=62, and the "3" in 62[2,3] tells us that the result of searching for q in M4 is either 79[3,0] at position 3 or 46[2,0] at position 2; comparing q with 46 shows that the correct result is 79[3,0] and that the result of searching for q in L4 is L4[3]=79. Thus, we have found q in each of our four lists, by doing a binary search in the single list M1 followed by a single comparison in each of the successive lists. More generally, for any data structure of this type, we perform a query by doing a binary search for q in M1, and determining from the resulting value the position of q in L1. Then, for each i>1, we use the known position of q in Mi to find its position in Mi+1. The value associated with the position of q in Mi points to a position in Mi+1 that is either the correct result of the binary search for q in Mi+1 or is a single step away from that correct result, so stepping from i to i+1 requires only a single comparison. Thus, the total time for a query is O(k+log⁡n) In our example, the fractionally cascaded lists have a total of 25 elements, less than twice that of the original input. In general, the size of Mi in this data structure is at most |Li|+12|Li+1|+14|Li+2|+⋯+12j|Li+j|+⋯, as may easily be proven by induction. Therefore, the total size of the data structure is at most ∑|Mi|=∑|Li|(1+12+14+⋯)≤2n=O(n), as may be seen by regrouping the contributions to the total size coming from the same input list Li together with each other.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Fractional cascading

Start with the simplest possible case. Write down what Fractional cascading claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Fractional cascading before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Fractional cascading ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Fractional cascading

In research
Fractional cascading appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Fractional cascading in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Fractional cascading is common in secondary-school and first-year university syllabi. It links to neighbouring topics Geometric data structures, Graph data structures, Search algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Fractional cascading outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Fractional cascading” →

How to study Fractional cascading in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Fractional cascading means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Fractional cascading out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Fractional cascading in simple terms?

In computer science, fractional cascading is a technique to speed up a sequence of binary searches for the same value in a sequence of related data structures. The first binary search in the sequence takes a logarithmic amount of time, as is standard for binary searches, but successive searches in…

Why does Fractional cascading matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Fractional cascading?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Fractional cascading.

Tags

  • Geometric data structures
  • Graph data structures
  • Search algorithms

Keep exploring