Imagine we have a stream of bank transactions. Each transaction has a target account and some amount of money. I'd like to find top K accounts over some period of time (e.g. last 7 days) which received the maximum amount of money.
Are there any algorithms/papers that address this kind of problem?
- I deliberately use bank accounts as an example since the same account can receive more than 1 transaction, and the transaction size is important. In this aspect the problem is very different from "Top-K most frequent items".
- There are potentially infinitely-many window sizes (e.g. last day, last 2 days, last week etc etc). I wonder if there's an approach that would support this property without computing answers for all needed window sizes independently. (Or at least anything better than computing answers for all possible window sizes independently i.e. some way to derive an answer for window size X when we know answers for window sizes 2X and 0.5X or smth like that).