个人读书笔记,欢迎大家批评指正、交流
An Introduction to Online Computation
Authors Komm, Dennis

文章目录

  • 1 Introduction
    • 1.1 Offline Algorithms
    • 1.2 Online Algorithms and Paging
      • Online Problem
      • Online Algorithms
      • Competitive Ratio
      • Theorem 1.2,1.3
      • Paging
      • pageingproblempageing\; problempageingproblem
    • 1.3 An Upper Bound for Paging
      • k−k-k−Phase Partition
      • Theorem 1.4 Fifo is strictly k-competitive for paging
    • 1.4 A Lower Bound for Paging:k-compititive
      • Theorem 1.5 No online algorithm for paging is better than k-compititive​
      • Theorem 1.6 LIFO is not competitive for paging
      • Theorem 1.7 LFU(使用频率最低) is not competitive for paging
    • 1.5 Marking Algorithms
      • Theorem 1.8. Every marking algorithm is strictly kkk-competitive for paging
      • Theorem 1.9. LRU is a marking algorithm
    • 1.6 Refined Competitive Analysis
      • lookahead
        • No online algorithm with lookahead ℓ\ellℓ for paging is better than kkk competitive.
      • resource augmentation
        • (h,k)-paging problem
      • Every marking algorithm is k/(k-h+1)-competitive for (h,k)-paging
      • Every marking algorithm is k/(k-h+1)-competitive for (h,k)-paging

1 Introduction

Online computation, that is, algorithms that work on problem instances which they do not know from the start, but that get revealed piece by piece. These algorithms are called online algorithms, and they are commonly analyzed using so-called competitive analysis, which compares their solution to an optimal one.

在线计算,也就是在问题实例上工作的算法,这些问题实例他们从一开始并不知道,但逐渐显露出来。这些算法被称为在线算法,通常使用所谓的竞争分析来分析它们,将它们的解与最优解进行比较

1.1 Offline Algorithms

停机问题,P,NP,NPC,NP-hard,优化问题的定义

近似算法:

对于最大化问题:

​ gain(OPT(I))≤r⋅gain(gain(I))gain(OPT(I))\le r\cdot gain(gain(I))gain(OPT(I))≤r⋅gain(gain(I)),

​ $\frac {gain(OPT(I)) } { gain(ALG(I))} \le r $

对于最小化问题:

​ cost(ALG(I))≤r⋅cost(ALG(I))cost(ALG(I))\le r\cdot cost(ALG(I))cost(ALG(I))≤r⋅cost(ALG(I)),

​ $\frac {cost(ALG(I)) } { cost(OPT(I))}\le r $

背包问题

1.2 Online Algorithms and Paging

Online Problem

​ problem:Π\PiΠ

​ instances:I\mathcal{I}I

​ solutions:O\mathcal{O}O

​ instance: I∈II\in\mathcal{I}I∈I is a sequence of requestsrequestsrequests I=(x1,x2,...,xn)I=(x_1,x_2,...,x_n)I=(x1​,x2​,...,xn​)

​ output: $O\in\mathcal{O} $is a sequence of answersanswersanswers O=(y1,y2,...,yn)O=(y_1,y_2,...,y_n)O=(y1​,y2​,...,yn​)

​ n∈N+n\in\mathbb{N^+}n∈N+,i.e. all instances and solutions are finite

​ onlineminimizationproblemonline \; minimization \; problemonlineminimizationproblem:

​ cost(I,OPT(I))=mincost(I,O)∣O∈sol(I)cost(I,OPT(I))=min{cost(I,O)|O\in sol(I)}cost(I,OPT(I))=mincost(I,O)∣O∈sol(I)

​ onlinemaximizationproblemonline \; maximization \; problemonlinemaximizationproblem:

​ gain(I,OPT(I))=maxgain(I,O)∣O∈sol(I)gain(I,OPT(I))=max{gain(I,O)|O\in sol(I)}gain(I,OPT(I))=maxgain(I,O)∣O∈sol(I)

  1. only knows a prefix of the input in every given time step,只知道之前的输入
  2. makes decisions that are based only on this knowledge, and,只基于已经知道的知识做决策
  3. may not revoke any decision it already made.不能改变之前的决策

Online Algorithms

​ Online problem : Π\PiΠ

​ An instance of Π\PiΠ: I=(x1,x2,...,xn)I=(x_1,x_2,...,x_n)I=(x1​,x2​,...,xn​)

​ An onlinealgorithmonline \; algorithmonlinealgorithm ALG for Π\PiΠ computes the output ALG(I)=(y1,y2,...,yn)ALG(I)=(y_1,y_2,...,y_n)ALG(I)=(y1​,y2​,...,yn​), where yiy_iyi​ only depends on x1,x2,...,xix_1,x_2,...,x_ix1​,x2​,...,xi​,and y1,y2,...,yi−1y_1,y_2,...,y_{i-1}y1​,y2​,...,yi−1​, $ALG(I) $is a feasible solution for III,that is , ALG(I)∈sol(I)ALG(I) \in sol(I)ALG(I)∈sol(I).

Competitive Ratio

​ Online problem : Π\PiΠ

​ Online algorithm : ALGALGALG

​ For c≥1c \ge 1c≥1,ALGALGALG is c−competitivec-competitivec−competitive for Π\PiΠ if there is a non-negative constant α\alphaα such that, for every instance I∈II \in \mathcal{I}I∈I,

​ for an online maximization problem,

​ gain(OPT(I))≤r⋅gain(gain(I))+αgain(OPT(I))\le r\cdot gain(gain(I))+\alphagain(OPT(I))≤r⋅gain(gain(I))+α,

​ for an online minimization problem,

​ cost(ALG(I))≤r⋅cost(ALG(I))+αcost(ALG(I))\le r\cdot cost(ALG(I))+\alphacost(ALG(I))≤r⋅cost(ALG(I))+α,

if α=0\alpha=0α=0, we call ALGstrictlyc−competitiveALG \;strictly\; c-competitiveALGstrictlyc−competitive ,ALGALGALG is called if it is strictly 1-competitive.

cALGc_{ALG}cALG​

stronglycALG−competitivestrongly \;c_{ALG}-competitivestronglycALG​−competitive

近似比和竞争比考虑的都是当前算法的worst−caseworst-caseworst−case

competitiveanalysiscompetitive\;analysiscompetitiveanalysis

As with the approximation ratio, the competitive ratio is not necessarily constant, but may be a function of the input length nnn .We use the following terminology. 竞争比不一定是一个常数,可能是与输入长度n有关的函数

notcompetitivenot\; competitivenotcompetitive :如果在线算法不具有与输入长度无关的竞争比的上界???

即,算法的上界,应该与输入长度无关,这样才能是competitive的

α\alphaα这个常数是必不可少的

Theorem 1.2,1.3

​ 对于最小化/最大化问题,there is no online algorithm that is "better than c−competitvec-competitvec−competitve"

Paging

phasesphasesphases:consist of a number of consecutive(连续的) time steps.

c是任何分页在线算法竞争比的下界

pageingproblempageing\; problempageingproblem

​ minimization

​ In memory: p1,...,pmp_1,...,p_mp1​,...,pm​

​ Instance: I=(x1,x2,...,xn)I=(x_1,x_2,...,x_n)I=(x1​,x2​,...,xn​), such that xi∈{p1,...,pm}x_i\in \{p_1,...,p_m\}xi​∈{p1​,...,pm​}

​ xix_ixi​is requested in time Step TiT_iTi​,

ALGALGALG for paging maintains a cache memory of size kkk with k<mk < mk<m .

time step TiT_iTi​,cache 中存的东西:Bi={pj1,pj2,...,pjk}B_i=\{p_{j1},p_{j2},...,p_{jk}\}Bi​={pj1​,pj2​,...,pjk​}

B0={p1,p2,...,pk}B_0=\{p_{1},p_{2},...,p_{k}\}B0​={p1​,p2​,...,pk​}

如果TiT_iTi​请求的page在Bi−1B_{i-1}Bi−1​中,命中,cost=0,如果不在,选一个yiy_iyi​置换出去,ALGALGALG outputs yi=pjy_i=p_jyi​=pj​

cost(ALG(I)ALG(I)ALG(I))=|{i∣yi≠0i|y_i\ne0i∣yi​​=0}|,下标是集合的大小?

the goal is to minimize this number.

demandpagingalgorithmsdemand \;paging \;algorithmsdemandpagingalgorithms:每次只替换出一页,请求分页算法

Strategies:FIFO,LIFO,LFU(使用频率最低),LRU,FWF(flush when full),LFD(离线算法,remove 之后最晚被请求的)

1.3 An Upper Bound for Paging

这里是在算上界,也就是说,求cost(ALG(I))cost(ALG(I))cost(ALG(I))max,和cost(OPT(I))cost(OPT(I))cost(OPT(I))min

先介绍些东西,以便于证明上界。

在上一节中,我们定义了一个在线算法是竞争的,如果它的竞争比c是与输入长度相关的一个常数。

在分页问题中,c与k,m相关?

k−k-k−Phase Partition

k步划分,针对输入,而不针对算法

instance:I=(x1,x2,...,xn)I=(x_1,x_2,...,x_n)I=(x1​,x2​,...,xn​)

A

online-section1-new相关推荐

  1. OCM_第二天课程:Section1 —》配置 Oracle 网络环境

    注:本文为原著(其内容来自 腾科教育培训课堂).阅读本文注意事项如下: 1:所有文章的转载请标注本文出处. 2:本文非本人不得用于商业用途.违者将承当相应法律责任. 3:该系列文章目录列表: 一:&l ...

  2. 一点一点学Latex(section1)

    一点一点学Latex(section1) 标签: Latex 2014-02-16 13:38 4141人阅读 评论(7) 收藏 举报  分类: [Latex](12)  版权声明:本文为博主原创文章 ...

  3. Section1:有源负载差动对(五管OTA)(2) -- 性能参数

    Section1:有源负载差动对(五管OTA)(2) – 性能参数 学习笔记 文章目录 Section1:有源负载差动对(五管OTA)(2) -- 性能参数 前言 一.共模输入电压 Vin,cmV_{ ...

  4. USACO Section1.3 Combination Lock 解题报告

    combo解题报告 -- icedream61 博客园(转载请注明出处) --------------------------------------------------------------- ...

  5. USACO Section1.5 Superprime Rib 解题报告

    sprime解题报告 -- icedream61 博客园(转载请注明出处) -------------------------------------------------------------- ...

  6. USACO Section1.2 Your Ride Is Here(水题)

    简单的计算题,边计算乘积边取余 /* ID: 18795871 PROG: ride LANG: C++ */ #include<iostream> #include<fstream ...

  7. USACO section1.3 Barn Repair 修理牛棚(贪心)

    题目:http://www.wzoi.org/usaco/11%5C304.asp 大意:有m个点,用有数量限制的区间把这些点全部覆盖,求区间和的最小值. 贪心原理:如果限制的区间数大于等于m的话an ...

  8. Section1 Flight Ticket Reservation 预订机票

    记录生活中的口语 点明意图 : 我要搞张票去杭州 Excuse me, could I make a reservation for flight to Hangzhou? Hello,I'd lik ...

  9. usaco java_USACO Section1.1

    本系列博客主要学习和记录USACO的相关代码和总结,附上我的github地址. 什么是USACO USACO全称是The USA Computing Olympiad,主要目的是从美国高中生中选出代码 ...

  10. 最全面的homogeneous单应性坐标的定义,以及不同投影,仿射,相似,刚体变换矩阵的关系和自由度分析

    本文对图像的投影变换,做了最基础和全面的总结.包括了摄影几何,homogeneous单应性坐标与变换矩阵分析. 1. Homogeneous Coordinate的定义 2. 使用Homogeneou ...

最新文章

  1. Java 算法-异或校验和
  2. 将LSTM与word2vec结合实现中文自动写作
  3. 升级Windows Phone Developer Tools Beta
  4. LeetCode-数组-35. 搜索插入位置
  5. 如何安装gnuplot
  6. 图片导入ppt后模糊_PPT设计,找图也是一种能力
  7. clickhouse 同步 mysql数据
  8. 电池图标不见了怎么解决
  9. Redash本地开发环境搭建
  10. 聊一聊HTTP缓存机制
  11. 活动选择问题的贪心算法c语言,c语言背包问题_背包问题贪心算法_背包问题 贪心算法...
  12. java网站渗透测试_如何进行Web渗透测试
  13. java 微信 图灵机器人_使用图灵api创建微信聊天机器人
  14. Soul是一个基于兴趣、场景、算法搭建的“第三空间”?
  15. linux 如何添加字体
  16. php打implode 函数,[PHP源码阅读]explode和implode函数,explodeimplode_PHP教程
  17. Pytorch问题及解决:‘lengths‘ argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor
  18. 专利申请的流程与时间
  19. ATOM基础教程一linter-php配置(12)
  20. 高性能迷你React框架 anu1.2.3 发布

热门文章

  1. numpy 学习汇总5-数组运算 tcy
  2. html5怎么设置字母联想,联想bios高级模式
  3. UIWebView的用法
  4. CSDN~BLOG目录
  5. 【D3.js】D3是什么
  6. 聚合搜索V2.0泛解析泛目录站群二开源码 可做指定关键词SEO源码
  7. 百分点科技位居中国数据治理解决方案市场第二
  8. 中国合伙人及致青春电影名言
  9. (3) 二分频VHDL描述
  10. ctr多少正常_亚马逊点击率多少算正常?点击率怎么算?