随机算法的优缺点
优点:
1、简单性:通常非常容易实现(Usually very easy to implement)
2、性能:通常以高概率产生(接近)最佳解决方案(Usually produce (near-) optimum solutions with high probability)
缺点:
1、以有限的概率得到错误的答案(Getting a wrong answer with a finite probability.)
解决方案:重复算法
2、难以分析运行时间和获得错误解决方案的概率(Difficult to analyse the running time and probability of getting an incorrect solution)
3、不可能获得真正的随机数(Impossible to get truly random numbers)