Lecture 26: Online Algorithms

Aram asked how the random algorithm does for paging: at each time just pick a random page to evict from the cache. Jason sent in an example where the optimum is 1, but the expected cost for RANDOM is k. The sequence is:

\displaystyle  1,2,\ldots, k, (0, 1, 2, \ldots, k-1)^*

The optimal action is to evict {k} when you see the first {0}, with an optimal cost of 1. But the random algorithm, on each cache miss, will pick a random page to evict, until it finally hits on {k}. Each time it has a 1-in-k chance of success, which leads to an expected cost of {k}.

In fact, Raghavan and Snir show that any memoryless randomized algorithm for paging cannot have competitive ratio less than {k}. They have a similar construction, and give sequences where the ratio remains {k} even when the optimal costs go to infinity. (Else we could give a weak-competitiveness bound with an additive factor of {k}.)

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s