拉斯维加斯算法与蒙特卡洛算法

本篇为在University of Birmingham 学习Advanced Nature-Inspired Search and Optimisation课程中的笔记之一
This is one of the notes from the Advanced Nature-Inspired Search and Optimisation course at the University of Birmingham

1 问题引出——螺栓螺母的匹配问题

1.1 一个螺栓与n个螺母
  • 日常问题:给定一个螺栓和一组n个不同尺寸的螺母,找到一个与螺栓匹配的螺母
  • 以数学形式:给定n个元素的数组,找到其值等于x的第一个元素
  • 问:如何使用算法求解?如何有效解决?
1.2 n个螺栓与n个螺母
  • 木有条理的木匠有n个不同大小的螺母和n个螺栓的集合,并且希望找到相应的一对螺栓和螺母。每个螺母正好匹配一个螺栓(反之亦然),并且他只能将螺母与螺栓进行比较,即,他既不能将螺母与螺母进行比较,也不能将螺栓与螺栓进行比较。
  • 您能帮助木匠快速匹配螺母和螺栓吗?
  • 这称为“螺母和螺栓问题”或“锁和钥匙问题”。
  • 问:如何制定问题?如何使用算法求解?如何有效解决?

2 方案介绍——随机算法

“For many problems, a randomised algorithm is the simplest, the fastest or both.” —— Prabhakar Raghavan, Vice President of Engineering at Google.

2.1 算法一览
  1. 分治算法(e.g., quicksort algorithm, Merge-Sort)
  2. 数学规划算法(e.g., linear programming, Multi-objective programming, Dynamic programming algorithms)
  3. 搜索和枚举算法
    1. 蛮力算法
    2. 改进的蛮力算法
    3. 启发式算法_Heuristic algorithms
      1. 局部搜索(e.g., greedy search)
      2. **随机算法
2.2 启发式算法与随机算法
1). 启发式 在计算机中的解释:

一种(通常是简单的)算法,可以在合理的时间内为问题提供足够好的解决方案

  1. 解决方案(通常)不是最佳方案,但令人满意:
    1. 更快:替代蛮力(穷举)搜索
    2. 权衡最优性,完整性,准确性或精度以提高速度。
  2. 通常用于解决其他算法难以解决的问题,例如蛮力算法
  3. 包括确定性(例如本地搜索)和随机算法(Randomised Algorithm)
2). 随机算法
  1. Randomised algorithm: An heuristic algorithm that makes random choices during execution to produce a result_随机选择产生结果
    1. Takes a source of random numbers to make random choices
    2. Behaviour, e.g., output or running time can vary even on a fixed input
  2. The goal: design an algorithm and analyse it to show that its behaviour is likely to be good, on every input
3). 随机算法 & 确定性算法
input
Algorithm
output
图1. Deterministic Algorithms
  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值