Lecture08 - Today's Lecture CSE 421 Algorithms Richard...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 421 Algorithms Richard Anderson Lecture 8 Optimal Caching Dijkstra’s algorithm Today’s Lecture • Optimal Caching (Section 4.3) • Dijkstra’s Algorithm (Section 4.4) Optimal Caching • Caching problem: – Maintain collection of items in local memory – Minimize number of items fetched Caching example A, B, C, D, A, E, B, A, D, A, C, B, D, A Optimal Caching • If you know the sequence of requests, what is the optimal replacement pattern? • Note – it is rare to know what the requests are in advance – but we still might want to do this: – Some specific applications, the sequence is known – Competitive analysis, compare performance on an online algorithm with an optimal offline algorithm Farthest in the future algorithm • Discard element used farthest in the future A, B, C, A, C, D, C, B, C, A, D
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Correctness Proof • Sketch • Start with Optimal Solution O • Convert to Farthest in the Future Solution F-F • Look at the first place where they differ • Convert O to evict F-F element
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/25/2012 for the course CSE 421 taught by Professor Richardanderson during the Fall '06 term at University of Washington.

Page1 / 4

Lecture08 - Today's Lecture CSE 421 Algorithms Richard...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online