AI
来源:互联网 发布:工业数据采集 编辑:程序博客网 时间:2024/04/29 19:55
- Cost
- Parity
- Seach Algorithms Informed Search
- Search Algorithms Uniformed Search
- Heuristics for single-agent
- Minimax
- Heuristics for adverserial games
- Alpha-beta pruning for minimax
Cost
– g(n) Cost from root to node n;
– h(n) Estimated cost from n to goal.
* Uniformed Search:
* Informed Search: if
Parity
中文名:奇偶校验
不是所有initial State都能到达goal State。Parity的算法结果帮助判断用不用执行Search Algorithms:
0: puzzle state has even parity
1: puzzle state has odd parity
当Initial State的Parity == Goal State的parity,才用执行Search Algorithms.
Seach Algorithms (Informed Search)
- Actions:
- Up(-3), Down (+3), Left (-1), Right (+1)
- States:
- 用Recursion(或for loop) generate 关于 当前 State的 空格的所有可能的states, 即以空格为主要研究对象以其他数字为辅助研究对象。如上面左图 1[ref],空格需要通过判断可行的Actions,并运行这些Actions,recurlively 得到:
- 当空格向上:3 与 空格 Swap
- 当空格向下:8 与 空格 Swap
- 当空格向左:6 与 空格 Swap
- 当空格向右:可以用格子的位置index(0,1,2…8)判断(如上面右图),当空格在第5格时,空格不能向右移动。
- 用Recursion(或for loop) generate 关于 当前 State的 空格的所有可能的states, 即以空格为主要研究对象以其他数字为辅助研究对象。如上面左图 1[ref],空格需要通过判断可行的Actions,并运行这些Actions,recurlively 得到:
在使用Search Algorithms去寻找可行的States的解法,需要以State为Nodes去建立一个Graph。可以用Adjacent matrix 或 Adjacent List. Node 的Parent为State的上一个状态。一个为Parent node 的State, 可以有很多可以走的States 。继续上面一个例子:
BFS, DFS 和 A* 等Search Algorithms 能够帮助我们以起始的State找到相关的Path去到达goal的State。但在这过程中,去判断从一个State到下一个State的判断依据不同(对于非Root的Node,设Swap一次的Cost = 1;Root的Cost=0):
BFS:如果不用Cost,则只是使用FIFO的List便可。为了优化BFS,使用 Linked List(有Priority Queue作用, 最前面的为Cost累计最少的State),因为以Cost当Weight,使用 f(n) = g(n) + h(n) 的式, 是 Informed Cost Search。
双向BFS:相似的While loop判断;并用2个Priority Queues,一个从起始点为Initial State往Goal State方向Search,另一个相反,从Goal Sate为Initial State 向起始点放向Search。类似题目
DFS: 不看Cost,一有可行的State就移步到这个可行的State (Stack,最前面的为最后加进去的Sate),速度最慢
A*: 使用 f(n) = g(n) + h(n) 的式子,比BFS好, 是 Informed Cost Search。
Iterative-Deepening A* (IDA*): 和A*相似,是A*的优化版本
* BFS,DFS 与 A* 和 IDA* 区别 (OS:喜欢这篇总结)
Search Algorithms (Uniformed Search)
Heuristics for single-agent
Minimax
Heuristics for adverserial games
Alpha-beta pruning for minimax
- AI
- ai
- ai
- AI
- ai
- ai
- ai
- ai
- ai
- ai
- ai
- AI
- AI
- ai...
- AI
- AI
- Ai
- AI
- 139. Word Break
- Python文件操作(一)
- GAN生成对抗网络的TensorFlow实现
- 网络流板子(良心)
- 参考例7.4,利用求阶乘函数Fact(),编程计算并输出1!+2!+......+n!的值
- AI
- Hadoop性能调优选择合适的硬件
- IEEE754 浮点数格式 与 Javascript number 的特性
- ubuntu环境配置
- 将 腾讯 QLV文件 转成MP4
- 简单理解viewport
- spring boot springmvc上传进度条
- 博弈问题总集第五类----Every-SG
- find命令 、 文件名后缀