Lecture 3 — Maximum Contiguous Subsequence Sum and The Substitution Method

نویسنده

  • Kanat Tangwongsan
چکیده

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.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

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 ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2012