1 / 26

Algorithms for the Maximum Subarray Problem Based on Matrix Multiplication

Algorithms for the Maximum Subarray Problem Based on Matrix Multiplication. Authours : Hisao Tamaki & Takeshi Tokuyama Speaker : Rung-Ren Lin. Outline. Introduction ½ -approximation Funny matrix multiplication Reduction Two little programs. Introduction ½ -approximation

hisano
Download Presentation

Algorithms for the Maximum Subarray Problem Based on Matrix Multiplication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Algorithms for the Maximum Subarray Problem Based on Matrix Multiplication Authours:Hisao Tamaki & Takeshi Tokuyama Speaker:Rung-Ren Lin

  2. Outline • Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  3. Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  4. Definition • Given an m by n matrix, output the maximum subarray.

  5. History • Bentley proposes this problem in 1984. • Kadane’s algorithm solves 1-D problem in linear time. • Kadane’s idea does not work for the 2-D case. • There’s an O(m2n) algorithm by using Kadane’s idea.

  6. Kadane’s algorithm i S(i) = A(i) + max{S(i-1), 0}

  7. Preprocessing • Given a matrix A[1…m][1…n], we can compute B[1…m][1…n] in O(mn) time such that B[i][j] represents the sum of A[1…i][1…j].

  8. Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  9. m n Time = mn/2 * 2 = mn

  10. m n Time = mn/4 * 4= mn

  11. Time Complexity • O(mn*logm)

  12. Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  13. Definition • Given two n by n matrices, Aij & Bij Cij = maxk=1 to n{Aik + Bkj} j j i i A B C

  14. History • Funny matrix multiplication is well-studied, since its computational complexity is known to be equivalent to that of “all-pairs shortest paths”. • Fredman constructs a subcubic algorithm with running time:

  15. Cont’d • Takaoka improved to in 1992.

  16. Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  17. Definition • T(m, n):computing time for the m by n matrix • Trow(m, n):row-centered • Tcol(m, n):column-centered T(m, n) = Trow(m, n) + Tcol(m, n) + 4T(m/2, n/2)

  18. Cont’d • Tcenter(m, n):row & column-centered Trow(m, n) = Tcenter(m, n) + 2Trow(m, n/2) Tcol(m, n) = Tcenter(m, n) + 2Tcol(m/2, n)

  19. Reduction B A C D

  20. Cont’d • Let A, B, C, D[1…m/2][1…n/2] be the sum of the given area. Xij = maxk=1 to m/2{Aik + Cjk} Yij = maxk=1 to m/2{Bik + Djk} output = max{Xij + Yij}

  21. Introduction • ½-approximation • Funny matrix multiplication • Reduction • Two little programs

  22. 13-card

  23. Pacman

  24. Challenges • It’s difficult to search 3-D models.

  25. The End

More Related