Lecture 3 — Maximum Contiguous Subsequence Sum and The Substitution Method
نویسنده
چکیده
1.1 Algorithm 1: Brute Force Immediate from the definition is an algorithm with O(n3) work and O(log n) span. This algorithm examines all possible combinations of subsequences and for each one of them, it computes the sum and takes the maximum. Note that every subsequence of s can be represented by a starting position i and an ending position j. We will use the shorthand si.. j to denote the subsequence 〈si , si+1, . . . , s j〉. For each subsequence i.. j, we can compute its sum by applying a plus reduce. This does O( j− i) work and O(log( j− i)) span. Furthermore, all the subsequences can be examined independently in parallel (using, e.g., tabulate). This leads the following bounds: †Lecture notes by Guy E Blelloch, Margaret Reid-Miller, and Kanat Tangwongsan.
منابع مشابه
Parallel Algorithms for Maximum Subsequence and Maximum Subarray
Given a sequence Q of n numbers positive and negative the maximum subsequence of Q is the contiguous subsequence that has the maximum sum among all contiguous subsequences of Q Given a two dimensional array A of n n numbers positive and negative the maximum subarray of A is the contiguous subarray that has the maximum sum among all contiguous subarrays of A We present two O log n time parallel ...
متن کاملCS 157 : Assignment 4 Douglas
This write-up presents the design and analysis of several algorithms for determining the maximum sum of certain subsets of one-dimensional arrays. In the first section, we consider the Maximum Subsequence Sum (MSS) problem: given an array A with signed integer elements, find a contiguous subarray with the maximum possible sum. In Section 2, we extend our algorithm to handle the case of cyclic s...
متن کاملInsertion and sorting in a sequence of numbers minimizing the maximum sum of a contiguous subsequence
Let A be a sequence of n ≥ 0 real numbers. A subsequence of A is a sequence of contiguous elements of A. A maximum scoring subsequence of A is a subsequence with largest sum of its elements , which can be found in O(n) time by Kadane’s dynamic programming algorithm. We consider in this paper two problems involving maximal scoring subsequences of a sequence. Both of these problems arise in the c...
متن کاملOptimization I: Greedy Algorithms
In this chapter and the next, we consider algorithms for optimization problems. We have already seen an example of an optimization problem — the maximum subsequence sum problem from Chapter 1. We can characterize optimization problems as admitting a set of candidate solutions. In the maximum subsequence sum problem, the candidate solutions are the contiguous subsequences in the input array. An ...
متن کاملComputing Maximum Subsequence in Parallel
The maximum subsequence problem finds the contiguous subsequence of n real numbers with the highest sum. This is an important problem that arises in several contexts in Computational Biology in the analysis of DNA or protein sequences. The maximum subsequence problem of n given scores can be solved sequentially in O(n) time. In this paper we present an efficient BSP/CGM parallel algorithm that ...
متن کامل