The Problem of K Maximum Sums and its VLSI Implementation Sung Eun Bae, Tadao Takaoka University of Canterbury Christchurch New Zealand.

Slides:



Advertisements
Similar presentations
YOSI! BLUE (30 sec play) Ball moves to X1 from X2
Advertisements

BESTIALES IV COLLECTION Reference numberDescriptionAvailable units BS Large backpack Size: 31x40x15cm Available in three models Reference.
An Introduction to Calculus. Calculus Study of how things change Allows us to model real-life situations very accurately.
Table de multiplication, division, addition et soustraction.
Evaluation and Validation
EOG Vocabulary Week of March 28, 2011 Math Words: Fractions and Properties.
The Derivative in Graphing and Application
Chapter 4 Section 3 Matrix Multiplication. Scalar Multiplication Scalar Product - multiplying each element in a matrix by a scalar (real number) –Symbol:
Maximal Independent Subsets of Linear Spaces. Whats a linear space? Given a set of points V a set of lines where a line is a k-set of points each pair.
Rule Learning – Overview Goal: learn transfer rules for a language pair where one language is resource-rich, the other is resource-poor Learning proceeds.
Order of Operations PEMDAS.
Factoring Trinomials NEXT. Problem 1 Product: x 2 + 6x + 8 Step 1: Place the x 2 model in the upper-left region. NEXT.
PROLOG MORE PROBLEMS.
Bank Accounts Management System - p. 448
Sculpture. Rolling Ts (2010), Hammered Copper, Patina 36X36X2 in.
The Dating Game With Our Host, Welcome to the Dating Game, the game where we find the greatest common factors between different numbers. Hopefully well.
1 Parallel Algorithms (chap. 30, 1 st edition) Parallel: perform more than one operation at a time. PRAM model: Parallel Random Access Model. p0p0 p1p1.
1 Frequency Distribution: Mean, Variance, Standard Deviation Given: Number of credit hours a sample of 25 full- time students are taking this semester.
§ 6.2 Areas and Riemann Sums. Area Under a Graph Riemann Sums to Approximate Areas (Midpoints) Riemann Sums to Approximate Areas (Left Endpoints) Applications.
Inverting a Singly Linked List Instructor : Prof. Jyh-Shing Roger Jang Designer : Shao-Huan Wang The ideas are reference to the textbook “Fundamentals.
Error-Correcting codes
Factoring Polynomials to Find Roots. Factoring a Polynomial to Find Roots Factor 3x x x x – 24 and find all of the roots. Roots: Factors:
Outcome: Determine the square root of perfect squares.
© T Madas Botany Bay Amersham Northgate Poole Milling Collier Bay 1 cm = 2 km.
Rahnuma Islam Nishat Debajyoti Mondal Md. Saidur Rahman Graph Drawing and Information Visualization Laboratory Department of Computer Science and Engineering.
Comparisons combinations Algebraic chains Other
23-8 3x6 Double it Take Away 6 Share By 9 Double it +10 Halve it Beginner Start Answer Intermediate 70 50% of this ÷7÷7 x8 Double it Start Answer.
LA TABLA DEL 5 5X1= 5X2= 5X3= 5X4= 5X5= 5X6= 5X7= 5X8= 5X9= 5X10=
2 x0 0 12/13/2014 Know Your Facts!. 2 x1 2 12/13/2014 Know Your Facts!
2 x /18/2014 Know Your Facts!. 11 x /18/2014 Know Your Facts!
BA 452 Lesson A.11 Other Advanced Applications 1 1ReadingsReadings Chapter 5 Advanced Linear Programming Applications.
2 x /10/2015 Know Your Facts!. 8 x /10/2015 Know Your Facts!
2.4 – Factoring Polynomials Tricky Trinomials The Tabletop Method.
Strategies – Multiplication and Division
SAT Encoding For Sudoku Puzzles
Properties of Multiplication Zero property of multiplication Identity property of multiplication Commutative property of multiplication Associative property.
PERMUTATIONS AND COMBINATIONS
1 Lecture 5 PRAM Algorithm: Parallel Prefix Parallel Computing Fall 2008.
A man-machine human interface for a special device of the pervasive computing world B. Apolloni, S. Bassis, A. Brega, S. Gaito, D. Malchiodi, A.M. Zanaboni.
5 x4. 10 x2 9 x3 10 x9 10 x4 10 x8 9 x2 9 x4.
1 The Restaurant Domain Will they wait, or not?. 2 Decision Trees Patrons? NoYesWaitEst? No Alternate?Hungry?Yes Reservation?Fri/Sat?Alternate?Yes NoYesBar?Yes.
Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
DIRECTIONAL ARC-CONSISTENCY ANIMATION Fernando Miranda 5986/M
Linear Programming – Simplex Method: Computational Problems Breaking Ties in Selection of Non-Basic Variable – if tie for non-basic variable with largest.
RSES – reducts and discretization of attributes presented by Zbigniew W. Ras University of North Carolina, Charlotte, NC & Warsaw University of Technology,
CS 478 – Tools for Machine Learning and Data Mining Clustering: Distance-based Approaches.
Multivariate Statistical Process Control and Optimization
Multiplication Facts Practice
Parameter identifiability, constraints, and equifinality in data assimilation with ecosystem models Dr. Yiqi Luo Botany and microbiology department University.
A Case Study  Some Advice on How to Go about Solving Problems in Prolog  A Program to Play Connect-4 Game.
Developing Mathematical Thinking In Number : Focus on Multiplication.
Whiteboardmaths.com © 2010 All rights reserved
Variational Inference Amr Ahmed Nov. 6 th Outline Approximate Inference Variational inference formulation – Mean Field Examples – Structured VI.
Probabilistic sequence modeling II: Markov chains Haixu Tang School of Informatics.
Computational Facility Layout
Shannon Expansion Given Boolean expression F = w 2 ’ + w 1 ’w 3 ’ + w 1 w 3 Shannon Expansion of F on a variable, say w 2, is to write F as two parts:
COMP9314Xuemin Continuously Maintaining Order Statistics Over Data Streams Lecture Notes COM9314.
Graeme Henchel Multiples Graeme Henchel
Quiz Number 2 Group 1 – North of Newark Thamer AbuDiak Reynald Benoit Jose Lopez Rosele Lynn Dave Neal Deyanira Pena Professor Kenneth D. Lawerence New.
1.Print and cut round outside of cootie catcher 2.Fold in half and in half again 3.Open out, turn over so.
The Project Problem formulation (one page) Literature review –“Related work" section of final paper, –Go to writing center, –Present paper(s) to class.
Susan Van Geest Artwork. Altar I: Centrality of Being Marble 1.5’x1.5’x1.5’
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
C2 Part 4: VLSI CAD Tools Problems and Algorithms Marcelo Johann EAMTA 2006.
Simplex (quick recap). Replace all the inequality constraints by equalities, using slack variables.
Adding & Subtracting Mixed Numbers. Objective: To develop fluency in +, –, x, and ÷ of non-negative rational numbers. Essential Question: How.
The Mechanical Cryptographer (Tolerant Algebraic Side-Channel Attacks using pseudo-Boolean Solvers) 1.
22 22 33 33 11 11 X1 X2 X3 X4 X5 X6 X7 X8 X9                    2,1  3,1  3,2 2,1 1,1 3,1 4,2 5,2 6,2 7,3 8,3 9,3.
Clustering AMCS/CS 340: Data Mining Xiangliang Zhang
7x7=.
Presentation transcript:

The Problem of K Maximum Sums and its VLSI Implementation Sung Eun Bae, Tadao Takaoka University of Canterbury Christchurch New Zealand

Outline Problem of Maximum Sum Problem of K Maximum Sums VLSI Implementation Conclusion

Problem of Maximum Sum Originated by Bentley To find a portion of maximum sum in an array 1-dimension : Maximum subsequence problem 2-dimension: Maximum subarray problem S= S=21

For one dimensional array of size n How fast can we compute? x1 x2x3x4x5x6x7x8x9x10 x1 x2x3x4x5x6x7x8x9x10 Size n 1 x10 x9 x8 x7 x6 x5 x4 x3 x2 x9 x8 x7 x6 x5 x4 x3 x2 x1 n-1 Size 2 x10 x9 x8 x7 x6 x5 x4 x3 x2 x1 n Size 1 … Total Number=n+(n-1)+(n-2)+…+2+1=n(n+1)/2 Is it O(n 2 )? No!!! x10 x9 x8 x7 x6 x5 x9 x8 x7 x6 x5 x4 x8 x7 x6 x5 x4 x3 Size 3 x3x2 x4 x1x3x2 n-2 x2 x3x4x5x6x7x8x9x10 x1x2x3x4x5x6x7x8x9 Size n-1 2

/*maximum subsequence a[x1..x2] of a[1..n]*/ (x1,x2):=(0,0); s:=-∞; t:=0; i:=1; for j:=1 to n begin t:=t+a[j]; if t>s then begin (x1,x2):=(i,j); s:=t end if t<0 then begin t:=0; i:=j+1; end //reset accumulation end t=-1 s=5 t=0 s=5 Maximum Subsequence Problem Kadane’s algorithm: O(n) t=5 s=5 t=7 s=7 t=10 s=10 t=1 s=10 t=9 s=10 t=14 s=14 t=5 s=14 t=0 s=- ∞

Maximum Subarray Problem Two dimensional array: Based on Kadane’s algorithm: O(n 3 ) (iterative) Best result by Tamaki, Tokuyama: O(n 3 (loglogn/logn) 1/2 ) (divide-and- conquer)

The Problem of K Maximum Sums What about 2 nd,3 rd …K th maximum sum? We expect,  O(K*n) : K maximum subsequences  O(K*n 3 ): K maximum subarrays Key idea  Prefix sum: sum of preceding cells  Eg. K=3  Maximum sum =max(a[x]+a[x+1]+…+a[y]) =max(sum[y]-sum[x-1]) asum Kadane’s framework is not capable… Eg. a[2]+a[3] =sum[3]-sum[1]=4

K Maximum Subsequences Algorithm Sums of all subsequences ending at a[i] obtained by  sum[i]-sum[0…i-1]  Eg. i=4, sum[4]-sum[0,1,2,3]=9-{0,-1,4,3}={9,10,5,6} Sums of K maximum subsequences ending at a[i] obtained by  sum[i]-min[K](sum[0…i-1])  Eg. i=4 K=3 sum[4]-min[3](sum[0,1,2,3])=9-min(0,-1,4,3)=9-{-1,0,3}={10,9,6} a sum

K Maximum Subsequences Algorithm min_prefix i [1..K] are K minimum prefix sums (select from sum[0,…,i-1])  sum[i]-min[K](sum[0…i-1])1= sum[i]- min_prefix i [1..K] Possible K-candidates (K=3) by sum[i]-min_prefix i [1..K]  i=1: -1-{0, ∞, ∞}={-1,-∞, -∞}  i=2: 4-{-1,0, ∞ }={5,4, -∞ }  i=3: 3-{-1,0,4}={4,3,-1}  i=4: 9-{-1,0,3}={10,9,6}  i=5: 7-{-1,0,3}={8,7,4} a sum { ∞, ∞,∞ } min_prefix i 0sum(i) {-1,0,3} {-1,0,4} 3 3 {-1,0, ∞ } 4 2 {0, ∞, ∞ } 1i K=3

K Maximum Subsequences Algorithm Final K Maximum Sums a sum O(K*n) { ∞, ∞,∞ } min_prefix i 0sum(i) {-1,0,3} {-1,0,4} 3 3 {-1,0, ∞ } 4 2 {0, ∞, ∞ } 1i Take K best candidates = =9 =

K Maximum Subarrays Problem Based on K maximum subsequences algorithm n=3 m= m+(m-1)+..+1 =m(m+1)/2 =O(m 2 ) ∴ O(m 2 ) K maximum subsequences Prefix sums

K Maximum Subarrays Problem K maximum subarrays problem K maximum subsequences problem m(m+1)/2 * Analysis  Each K maximum subsequences algorithm takes O(K*n) time  O(m 2 ) such problems to solve  O(K*m 2 *n) time O(K*m 2* n) ≒ O(K*n 3 )

Parallel Algorithm for Maximum Subarray Problem  PRAM and Interconnect hypercube: T=O(logn) time P=O(n 3 /logn) processors (P*T=O(n 3 ) and is optimal)  Mesh 1. T=O(n) time 2. P=O(n 2 ) processors 3. (P*T=O(n 3 ) and optimal)

Mesh model Motivation  The size of job for each node is very small and identically distributed  Mesh-type parallel algorithm can be easily programmed in a single VLSI chip  Cost-effective parallelisation  Practical

VLSI Algorithm Design of Circuit n m m*n nodes Data transmission is made vertically & horizontally Control signal is propagated downwards triggering horizontal transmission. Registor1,2,… control Control signal

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j) The number of parallel steps based on data transmission

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j)

VLSI Algorithm for K Maximum Subarrays Problem s: prefix sum (r1,c1)|(r2,c2): coordinates of Mx M1..MK The K maximum subarrays m1…mK the K minimum prefix sums r: row-wise sum v: value of the cell cell(i,j) T=O(K*n) P=m*n=O(n 2 ) Total cost T*P=O(K*n 3 )

Conclusion Possible application: Robot vision, Huge-scale data mining, etc. Cost effective way of exploiting the power of parallel computing O(K*n 3 ) O(K*n)