ArticleslgStudy

computer science

Ruzzo–Tompa algorithm

Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm rather than just read about it. In short: The Ruzzo–Tompa algorithm or the RT algorithm is a linear-time algorithm for finding all non-overlapping, contiguous, maximal scoring subsequences in a sequence of real numbers. The Ruzzo–Tompa algorithm was proposed by Walter L.

Key takeaways

  • Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Ruzzo–Tompa algorithm from memory before moving on to harder problems.

Reference excerpt

The Ruzzo–Tompa algorithm or the RT algorithm is a linear-time algorithm for finding all non-overlapping, contiguous, maximal scoring subsequences in a sequence of real numbers. The Ruzzo–Tompa algorithm was proposed by Walter L. Ruzzo and Martin Tompa. This algorithm is an improvement over previously known quadratic time algorithms. The maximum scoring subsequence from the set produced by the algorithm is also a solution to the maximum subarray problem. The Ruzzo–Tompa algorithm has applications in bioinformatics, web scraping, and information retrieval.

Applications

Bioinformatics The Ruzzo–Tompa algorithm has been used in Bioinformatics tools to study biological data. The problem of finding disjoint maximal subsequences is of practical importance in the analysis of DNA. Maximal subsequences algorithms have been used in the identification of transmembrane segments and the evaluation of sequence homology. The algorithm is used in sequence alignment which is used as a method of identifying similar DNA, RNA, or protein sequences. Accounting for the ordering of pairs of high-scoring subsequences in two sequences creates better sequence alignments. This is because the biological model suggests that separate high-scoring subsequence pairs arise from insertions or deletions within a matching region. Requiring consistent ordering of high-scoring subsequence pairs increases their statistical significance.

Web scraping The Ruzzo–Tompa algorithm is used in Web scraping to extract information from web pages. Pasternack and Roth proposed a method for extracting important blocks of text from HTML documents. The web pages are first tokenized and the score for each token is found using local, token-level classifiers. A modified version of the Ruzzo–Tompa algorithm is then used to find the k highest-valued subsequences of tokens. These subsequences are then used as predictions of important blocks of text in the article.

Information retrieval The Ruzzo–Tompa algorithm has been used in Information retrieval search algorithms. Liang et al. proposed a data fusion method to combine the search results of several microblog search algorithms. In their method, the Ruzzo–Tompa algorithm is used to detect bursts of information.

Problem definition The problem of finding all maximal subsequences is defined as follows: Given a list of real numbered scores x 1 , x 2 , … , x n {\displaystyle x_{1},x_{2},\ldots ,x_{n}} , find the list of contiguous subsequences that gives the greatest total score, where the score of each subsequence S i , j = ∑ i ≤ k ≤ j x k {\displaystyle S_{i,j}=\sum _{i\leq k\leq j}x_{k}} . The subsequences must be disjoint (non-overlapping) and have a positive score.

Other algorithms There are several approaches to solving the all maximal scoring subsequences problem. A natural approach is to use existing, linear time algorithms to find the maximum subsequence (see maximum subarray problem) and then recursively find the maximal subsequences to the left and right of the maximum subsequence. The analysis of this algorithm is similar to that of Quicksort: The maximum subsequence could be small in comparison to the rest of sequence, leading to a running time of O ( n 2 ) {\displaystyle O(n^{2})} in the worst case.

Algorithm

The standard implementation of the Ruzzo–Tompa algorithm runs in O ( n ) {\displaystyle O(n)} time and uses O(n) space, where n is the length of the list of scores. The algorithm uses dynamic programming to progressively build the final solution by incrementally solving progressively larger subsets of the problem. The description of the algorithm provided by Ruzzo and Tompa is as follows:

Read the scores left to right and maintain the cumulative sum of the scores read. Maintain an ordered list I 1 , I 2 , … , I j {\displaystyle I_{1},I_{2},\ldots ,I_{j}} of disjoint subsequences. For each subsequence I j {\displaystyle I_{j}} , record the cumulative total L j {\displaystyle L_{j}} of all scores up to but not including the leftmost score of I j {\displaystyle I_{j}} , and the total R j {\displaystyle R_{j}} up to and including the rightmost score of I j {\displaystyle I_{j}} . The lists are initially empty. Scores are read from left to right and are processed as follows. Nonpositive scores require no special processing, so the next score is read. A positive score is incorporated into a new sub-sequence I k {\displaystyle I_{k}} of length one that is then integrated into the list by the following process: The list I {\displaystyle I} is searched from right to left for the maximum value of j {\displaystyle j} satisfying L j < L k {\displaystyle L_{j}<L_{k}}

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Ruzzo–Tompa algorithm

Start with the simplest possible case. Write down what Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm

In research
Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm 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
Ruzzo–Tompa algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Dynamic programming, Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Ruzzo–Tompa algorithm 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 “Ruzzo–Tompa algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Ruzzo–Tompa algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Ruzzo–Tompa algorithm in simple terms?

The Ruzzo–Tompa algorithm or the RT algorithm is a linear-time algorithm for finding all non-overlapping, contiguous, maximal scoring subsequences in a sequence of real numbers. The Ruzzo–Tompa algorithm was proposed by Walter L.

Why does Ruzzo–Tompa algorithm 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 Ruzzo–Tompa algorithm?

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 Ruzzo–Tompa algorithm.

Tags

  • Dynamic programming
  • Optimization algorithms and methods

Keep exploring