finding a maximum in a matrix
- From: jcardin@xxxxxxxxx (Jean Cardinal)
- Date: 14 Apr 2005 09:40:43 -0700
Here is a seemingly simple problem:
---
Given two vectors of integers
X = (X_1, X_2,..., X_n) and Y = (Y_1, Y_2,..., Y_n)
sorted in increasing order,
find a pair i,j with 1 <= j <= i <= n that maximizes
(X_i + Y_j) * (n - (i + j) + 2).
---
A simple algorithm for this is to check all n * n / 2 possible pairs
of indices. Can we do better? (Say, O(n polylog n)?) Is it 3SUM-hard?
It seems to me to have the same flavor as sorting X+Y, or the
following open problem from Eppstein:
http://compgeom.cs.uiuc.edu/~jeffe/open/algo.html#dynprog
Yet it is a different problem.
Any idea / algorithm / lower bound / similar open problem would be
appreciated.
Thank you!
Jean
.
- Prev by Date: Computational Mathematics and Computer Science
- Next by Date: Re: Computational Mathematics and Computer Science
- Previous by thread: Computational Mathematics and Computer Science
- Next by thread: Network Flow
- Index(es):