1 / 15

Efficient heuristic algorithms for the maximum subarray problem

This paper explores efficient heuristic algorithms for solving the maximum subarray problem. Rung-Ren Lin and Kun-Mao Chao present intelligent approaches with promising results for locating the maximum subarray in a two-dimensional array. Beginning with Bentley's classic introduction of the problem in his book, "Programming Pearls," the paper discusses Kadane's algorithm for the one-dimensional case and Bentley's solution for the m×n array. It also reviews an improved algorithm by Tamaki et al. from 1998. The paper delves into heuristic methods and constructing TL matrices. It demonstrates how to compute an arbitrary rectangle using the TL matrix and suggests strategies for intelligent guessing. The approaches discussed aim for a more efficient solution to the maximum subarray problem.

ninag
Download Presentation

Efficient heuristic algorithms for the maximum subarray problem

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. Efficient heuristic algorithms for the maximum subarray problem Rung-Ren Lin and Kun-Mao Chao

  2. Preview • Trying to guess the answer intelligently. • Preliminary experiments show that these approaches are very promising for locating the maximum subarray in a given two-dimensional array.

  3. Review of Maximum Subarray • Bentley posed the maximum subarray problem in his book “Programming Pearls” in 1984. • He introduces Kadane's algorithm for the one-dimensional case, whose time is linear.

  4. Cont’d • Given an m×n array of numbers, Bentley solved the problem in O(m2n) time. • An improvement O(m2n(loglogm/logm)0.5) was given by Tamaki et al. in 1998. • This algorithm is heavily recursive and complicated.

  5. Applications

  6. Cont’d

  7. Heuristic Methods • Given a 2-D array A[1..m][1..n], let TL[i][j] denote the sum of the rectangle A[1..i][1..j]. A TL

  8. Constructing TL Matrix • for i = 2 to n do for j = 1 to n do A[i][j] = A[i][j] + A[i-1][j] A A’

  9. Cont’d • for i = 2 to n do for j = 1 to n do A’[j][i] = A’[j][i] + A’[j][i-1] A’ TL

  10. Computing an Arbitrary Rectangle

  11. How to guess? • Each rectangle can be computed by TL matrix, and the answer is MAX( + - - ). • the larger the better. • the smaller the better.

  12. Cont’d • We try only those entries which are in the top k-th, or in the bottom k-th for a given k. • We test only O(k) times instead of O(n) times. Since there are in total O(m2) pairs, this step takes O(km2).

  13. 4-Corner

  14. Happy New Year!!

  15. Interesting Questions • 128 gold. • The way to heaven and hell. • 10 smart prisoners.

More Related