14-Competitive-Analysis

14-Competitive-Analysis - Algorithms LECTURE 14 Competitive...

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

View Full Document Right Arrow Icon
Algorithms L14.1 Professor Ashok Subramanian L ECTURE 14 Competitive Analysis Self-organizing lists Move-to-front heuristic Competitive analysis of MTF Algorithms
Background image of page 1

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

View Full DocumentRight Arrow Icon
Algorithms L14.2 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L .
Background image of page 2
Algorithms L14.3 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . 12 3 50 14 17 4 L Example:
Background image of page 3

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

View Full DocumentRight Arrow Icon
Algorithms L14.4 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . 12 3 50 14 17 4 L Accessing the element with key 14 costs 4 . Example:
Background image of page 4
Algorithms L14.5 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . 12 3 50 14 17 4 L Transposing 3 and 50 costs 1 . Example: 3 50
Background image of page 5

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

View Full DocumentRight Arrow Icon
Algorithms L14.6 On-line and off-line problems Definition. A sequence S of operations is provided one at a time. For each operation, an on-line algorithm A must execute the operation immediately without any knowledge of future operations (e.g., Tetris ). An off-line algorithm may see the whole sequence S in advance. Goal: Minimize the total cost C ( S ) . The game of Tetris
Background image of page 6
Algorithms L14.7 Worst-case analysis of self- organizing lists An adversary always accesses the tail ( n th) element of L . Then, for any on-line algorithm A , we have C ( S ) = (| S | n )
Background image of page 7

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

View Full DocumentRight Arrow Icon
L14.8 Average-case analysis of self- organizing lists Suppose that element x is accessed with probability p ( x ) . Then, we have = L x L A x x p S C ) ( rank ) ( )] ( [ E , which is minimized when L is sorted in decreasing order with respect to p . Heuristic:
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 40

14-Competitive-Analysis - Algorithms LECTURE 14 Competitive...

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

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