Approximation
Approximation ratio
【Definition】 An algorithm has an approximation ratio of ρ\rhoρ(n) if, for any input of size n, the cost C of the solution produced by the algorithm is within a factor of ρ\rhoρ (n) of the cost C* of an optimal solution: max(CC∗,C∗C)≤ρ(n)\frac{C}{C^*},\frac{C^*}{C}) \leq \rho(n)C∗C,CC∗)≤ρ(n)
If an algorithm achieves an approximation ratio of ρ\rhoρ(n), we call it a ρ\rhoρ(n)-approximation algorithm.
【Definition】 An approximation scheme for an optimization problem is an approximation algorithm that takes as input not only an instance of the problem, but also a value ϵ\epsilonϵ > 0 such that for any fixed ϵ\epsilonϵ, the scheme is a (1+ ϵ\epsilonϵ)-approximation algorithm.
We say that an approximation scheme is a polynomial-time approximation scheme (PTAS) if for any fixed ϵ\epsilonϵ > 0, the scheme runs in time polynomial in the size n of its input instance.
eg. O((1/ϵ)2n3)O((1/ \epsilon)^2 n^3)O((1/ϵ)2n3) --> FPTAS (fully …) , O(nϵ/2)O(n^{\epsilon/2})O(nϵ/2), …
Approximate Bin Packing
Online Algorithms
next fit
void NextFit ( )
{ read item1;while ( read item2 ) {if ( item2 can be packed in the same bin as item1 )place item2 in the bin;elsecreate a new bin for item2;item1 = item2;} /* end-while */
}
Let M be the optimal number of bins required to pack a list I of items. Then next fit never uses more than 2M – 1 bins. There exist sequences such that next fit uses 2M – 1 bins.
first fit
void FirstFit ( )
{ while ( read item ) {scan for the first bin that is large enough for item;if ( found )place item in that bin;elsecreate a new bin for item;} /* end-while */
}
Let M be the optimal number of bins required to pack a list I of items. Then first fit never uses more than 17M / 10 bins. There exist sequences such that first fit uses 17(M – 1) / 10 bins.
best fit
Off-line Algorithm
first fit decreasing
Let M be the optimal number of bins required to pack a list I of items. Then first fit decreasing never uses more than 11M / 9 + 6/9 bins. There exist sequences such that first fit decreasing uses 11M / 9 + 6/9 bins.
best fit decreasing
Exercises
Approximation相关推荐
- Sparse low rank approximation
1. Sparse and low rank approximation (source codes) :http://www.ugcs.caltech.edu/~srbecker/wiki/Main ...
- 核逼近(Kernel Approximation)
核逼近(Kernel Approximation) 主要方法和函数: sklearn.kernel_approximation.Nystroem sklearn.kernel_approximatio ...
- 人脸检测--Recurrent Scale Approximation for Object Detection in CNN
Recurrent Scale Approximation for Object Detection in CNN ICCV2017 https://github.com/sciencefans/RS ...
- UA OPTI544 量子光学9 2-level system approximation的向量模型
UA OPTI544 量子光学9 2-level system approximation的向量模型 Bloch Vector与Optical Bloch Equation Bloch变量及其物理含义 ...
- UA OPTI544 量子光学8 2-level system approximation的population rate equation模型
UA OPTI544 量子光学8 2-level system approximation的population rate equation模型 Density Matrix的稳态(假设无非弹性碰撞) ...
- UA OPTI544 量子光学7 2-level system approximation的Density Matrix模型
UA OPTI544 量子光学7 2-level system approximation的Density Matrix模型 Density Matrix的Rabi Equation Non-Hami ...
- 创新实训个人记录:approximation factor, maximum matchingvertex cover
创新实训个人记录:approximation factor, maximum matching&&vertex cover approximation factor(近似比) maxi ...
- 斯特林公式(Stirling's approximation)
斯特林公式(Stirling's approximation)是一条用来取n的阶乘的近似值的数学公式.一般来说,当n很大的时候,n阶乘的计算量十分大,所以斯特林公式十分好用,而且,即使在n很小的时候, ...
- C++实现successive approximation渐进法(附完整源码)
C++实现successive approximation渐进法 C++实现successive approximation渐进法算法完整源码(定义,实现,main函数测试) C++实现success ...
- Approximation and fitting、Statistical estimation
一.Approximation and fitting 1. 拟合与回归的区别 回归分析:是一种统计学上分析数据的方法,目的在于了解两个或多个变量间是否相关.相关方向与强度,并建立数学模型以便观察特定 ...
最新文章
- SpringBoot接口参数校验
- 2020-03-21
- uploadify的使用错误
- shell_之_find(查找)
- Airbnb搜索:Embedding表示学习
- Group By和Order By的总结
- LINUX检查一个进程内存增长的脚本
- c语言井字棋二维数组,【C语言】简单实现三子棋(井字棋)小游戏
- word当前页面设置第一页
- 给公司、领导提提意见,该怎么写?
- 【期末复习】网络安全技术(双语)
- Java实现微信公众号模板消息管理群发和单发
- 验收测试的名词解释_验收测试工作流程及准则
- vs智能提示英文转为中文
- 【笔记】ARM指令系统
- ubuntu下载,直接上中国官网就好了
- win7 mac 时间不一致
- BBS社区运营,需要什么专业知识?
- 详解资本市场线、证券市场线、证券特征线
- SmartDraw 2010 破解