# Online File Caching with Rejection Penalties

- 219 Downloads
- 5 Citations

## Abstract

In the file caching problem, the input is a sequence of requests for files out of a slow memory. A file has two attributes, a positive retrieval cost and an integer size. An algorithm is required to maintain a cache of size *k* such that the total size of files stored in the cache never exceeds *k*. Given a request for a file that is not present in the cache at the time of request, the file must be brought from the slow memory into the cache, possibly evicting other files from the cache. This incurs a cost equal to the retrieval cost of the requested file. Well-known special cases include paging (all costs and sizes are equal to 1), the cost model, which is also known as weighted paging, (all sizes are equal to 1), the fault model (all costs are equal to 1), and the bit model (the cost of a file is equal to its size). If bypassing is allowed, a miss for a file still results in an access to this file in the slow memory, but its subsequent insertion into the cache is optional.

We study a new online variant of caching, called *caching with rejection*. In this variant, each request for a file has a rejection penalty associated with the request. The penalty of a request is given to the algorithm together with the request. When a file that is not present in the cache is requested, the algorithm must either bring the file into the cache, paying the retrieval cost of the file, or reject the file, paying the rejection penalty of the request. The objective function is the sum of total rejection penalty and the total retrieval cost. This problem generalizes both caching and caching with bypassing.

We design deterministic and randomized algorithms for this problem. The competitive ratio of the randomized algorithm is *O*(log*k*), and this is optimal up to a constant factor. In the deterministic case, a *k*-competitive algorithm for caching, and a (*k*+1)-competitive algorithm for caching with bypassing are known. Moreover, these are the best possible competitive ratios. In contrast, we present a lower bound of 2*k*+1 on the competitive ratio of any deterministic algorithm for the variant with rejection. The lower bound is valid already for paging. We design a (2*k*+2)-competitive algorithm for caching with rejection. We also design a different (2*k*+1)-competitive algorithm, that can be used for paging and for caching in the bit and fault models.

## Keywords

Caching Paging Online algorithms## Notes

### Acknowledgements

The authors would like to thank an anonymous reviewer who suggested the reduction presented in Theorem 6 below, and thus allowed us to simplify the randomized result significantly, making the paper much more elegant.

## References

- 1.Achlioptas, D., Chrobak, M., Noga, J.: Competitive analysis of randomized paging algorithms. Theor. Comput. Sci.
**234**(1–2), 203–218 (2000) CrossRefzbMATHMathSciNetGoogle Scholar - 2.Adamaszek, A., Czumaj, A., Englert, M., Räcke, H.: An
*O*(log*k*)-competitive algorithm for generalized caching. In: Proc. of the 23rd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA2012), pp. 1681–1689 (2012) CrossRefGoogle Scholar - 3.Albers, S.: New results on web caching with request reordering. Algorithmica
**58**(2), 461–477 (2010) CrossRefzbMATHMathSciNetGoogle Scholar - 4.Albers, S., Arora, S., Khanna, S.: Page replacement for general caching problems. In: Proc. of the 10th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA1999), pp. 31–40 (1999) Google Scholar
- 5.Bansal, N., Buchbinder, N., Naor, J.: Towards the randomized
*k*-server conjecture: a primal-dual approach. In: Proc. of the 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA2010), pp. 40–55 (2010) CrossRefGoogle Scholar - 6.Bansal, N., Buchbinder, N., Naor, S.: A primal-dual randomized algorithm for weighted paging. J. ACM
**59**(4), 19 (2012), 24 pp. MathSciNetGoogle Scholar - 7.Bansal, N., Buchbinder, N., Naor, S.: Randomized competitive algorithms for generalized caching. SIAM J. Comput.
**41**(2), 391–414 (2012) CrossRefzbMATHMathSciNetGoogle Scholar - 8.Bar-Noy, A., Bar-Yehuda, R., Freund, A., Naor, J., Schieber, B.: A unified approach to approximating resource allocation and scheduling. J. ACM
**48**(5), 1069–1090 (2001) CrossRefMathSciNetGoogle Scholar - 9.Bartal, Y., Leonardi, S., Marchetti-Spaccamela, A., Sgall, J., Stougie, L.: Multiprocessor scheduling with rejection. SIAM J. Discrete Math.
**13**(1), 64–78 (2000) CrossRefzbMATHMathSciNetGoogle Scholar - 10.Bein, W.W., Larmore, L.L., Noga, J.: Equitable revisited. In: Proc. of the 15th Annual European Symposium on Algorithms (ESA2007), pp. 419–426 (2007) Google Scholar
- 11.Belady, L.A.: A study of replacement algorithms for a virtual-storage computer. IBM Systems Journal
**5**(2), 78–101 (1966) CrossRefGoogle Scholar - 12.Blum, A., Burch, C., Kalai, A.: Finely-competitive paging. In: Proc. of the 40th Annual IEEE Symposium on Foundations of Computer Science (FOCS1999), pp. 450–458 (1999) Google Scholar
- 13.Brehob, M., Enbody, R.J., Torng, E., Wagner, S.: On-line restricted caching. J. Sched.
**6**(2), 149–166 (2003) CrossRefzbMATHMathSciNetGoogle Scholar - 14.Brodal, G.S., Moruz, G., Negoescu, A.: OnlineMin: a fast strongly competitive randomized paging algorithm. In: Proc. of the 9th International Workshop on Approximation and Online Algorithms (WAOA2011), pp. 164–175 (2011) Google Scholar
- 15.Cao, P., Irani, S.: Cost-aware www proxy caching algorithms. In: Proc. of the USENIX Symposium on Internet Technologies and Systems, pp. 193–206 (1997) Google Scholar
- 16.Chrobak, M., Karloff, H.J., Payne, T.H., Vishwanathan, S.: New results on server problems. SIAM J. Discrete Math.
**4**(2), 172–181 (1991) CrossRefzbMATHMathSciNetGoogle Scholar - 17.Chrobak, M., Noga, J.: Competitive algorithms for relaxed list update and multilevel caching. J. Algorithms
**34**(2), 282–308 (2000) CrossRefzbMATHMathSciNetGoogle Scholar - 18.Chrobak, M., Woeginger, G.J., Makino, K., Xu, H.: Caching is hard—even in the fault model. Algorithmica
**63**(4), 781–794 (2012) CrossRefzbMATHMathSciNetGoogle Scholar - 19.Cohen, E., Kaplan, H.: Caching documents with variable sizes and fetching costs: an LP-based approach. Algorithmica
**32**(3), 459–466 (2002) CrossRefzbMATHMathSciNetGoogle Scholar - 20.Dósa, G., He, Y.: Bin packing problems with rejection penalties and their dual problems. Inf. Comput.
**204**(5), 795–815 (2006) CrossRefzbMATHGoogle Scholar - 21.Epstein, L.: Bin packing with rejection revisited. Algorithmica
**56**(4), 505–528 (2010) CrossRefzbMATHMathSciNetGoogle Scholar - 22.Epstein, L., Levin, A., Woeginger, G.J.: Graph coloring with rejection. J. Comput. Syst. Sci.
**77**(2), 439–447 (2011) CrossRefzbMATHMathSciNetGoogle Scholar - 23.Epstein, L., Noga, J., Woeginger, G.J.: On-line scheduling of unit time jobs with rejection: minimizing the total completion time. Oper. Res. Lett.
**30**(6), 415–420 (2002) CrossRefzbMATHMathSciNetGoogle Scholar - 24.Fiat, A., Karp, R.M., Luby, M., McGeoch, L.A., Sleator, D.D., Young, N.: Competitive paging algorithms. J. Algorithms
**12**(4), 685–699 (1991) CrossRefzbMATHGoogle Scholar - 25.Goemans, M.X., Williamson, D.P.: A general approximation technique for constrained forest problems. SIAM J. Comput.
**24**(2), 296–317 (1995) CrossRefzbMATHMathSciNetGoogle Scholar - 26.Irani, S.: Page replacement with multi-size pages and applications to web caching. Algorithmica
**33**(3), 384–409 (2002) CrossRefzbMATHMathSciNetGoogle Scholar - 27.Karlin, A., Manasse, M., Rudolph, L., Sleator, D.D.: Competitive snoopy caching. Algorithmica
**3**(1–4), 79–119 (1988) CrossRefzbMATHMathSciNetGoogle Scholar - 28.Karp, R.M.: On-line algorithms versus off-line algorithms: how much is it worth to know the future? In: van Leeuwen, J. (ed.) IFIP Congress (1). IFIP Transactions, vol. A-12, pp. 416–429. North-Holland, Amsterdam (1992) Google Scholar
- 29.Koufogiannakis, C., Young, N.E.: Greedy Δ-approximation algorithm for covering with arbitrary constraints and submodular cost. Algorithmica
**66**(1), 113–152 (2013) CrossRefzbMATHMathSciNetGoogle Scholar - 30.Manasse, M.S., McGeoch, L.A., Sleator, D.D.: Competitive algorithms for server problems. J. Algorithms
**11**(2), 208–230 (1990) CrossRefzbMATHMathSciNetGoogle Scholar - 31.McGeoch, L.A., Sleator, D.D.: A strongly competitive randomized paging algorithm. Algorithmica
**6**(6), 816–825 (1991) CrossRefzbMATHMathSciNetGoogle Scholar - 32.Mendel, M., Seiden, S.S.: Online companion caching. Theor. Comput. Sci.
**324**(2–3), 183–200 (2004) CrossRefzbMATHMathSciNetGoogle Scholar - 33.Nagy-György, J., Imreh, C.: Online scheduling with machine cost and rejection. Discrete Appl. Math.
**155**(18), 2546–2554 (2007) CrossRefzbMATHMathSciNetGoogle Scholar - 34.Seiden, S.S.: Preemptive multiprocessor scheduling with rejection. Theor. Comput. Sci.
**262**(1), 437–458 (2001) CrossRefzbMATHMathSciNetGoogle Scholar - 35.Sleator, D.D., Tarjan, R.E.: Amoritzed efficiency of list update and paging rules. Commun. ACM
**28**(2), 202–208 (1985) CrossRefMathSciNetGoogle Scholar - 36.Young, N.E.: The
*k*-server dual and loose competitiveness for paging. Algorithmica**11**(6), 525–541 (1994) CrossRefMathSciNetGoogle Scholar - 37.Young, N.E.: On-line file caching. Algorithmica
**33**(3), 371–383 (2002) CrossRefzbMATHMathSciNetGoogle Scholar