4. Informed search algorithms

Heuristic Function: Estimates the cost from a given state to the goal

Note: the goal test is performed when the node is popped from the frontier, NOT when it is generated during expansion.

A strategy is defined by picking the order of node expansion

Greedy search

Evaluation function f(n) = h(n) (entirely heuristic) = estimate of cost from n to the closest goal

Greedy search expands the node that appears to be closest to goal

Effect:
Complete: No–can get stuck in loops. Complete in finite space with repeated-state checking
Time: O(b^m), but a good heuristic can give dramatic improvement
Space: O(b^m)
Optimal: No

A∗ search

Idea: avoid expanding paths that are already expensive
Evaluation function f(n) = g(n) + h(n)

Admissible heuristic:
∀n h(n) ≤ h∗(n) where h∗(n) is the true cost from n.
When h(n) is admissible, f(n) never overestimates the total cost of the shortest path through n to the goal
Consistency: A∗ expands nodes in order of increasing f value

Theorem: if h is admissible, A∗ search finds the optimal solution

Effect:
Complete: Yes, unless there are infinitely many nodes with f ≤ C∗ Time: Exponential
Space: Exponential
Optimal: Yes—cannot expand fi+1 until fi is finished

Relaxed problems

Admissible heuristics can be derived from the optimal solution cost of a relaxed version of the problem
Key point: the optimal solution cost of a relaxed problem
is no greater than the optimal solution cost of the real problem

Graph search

不像tree search会有一个明确的detect方向,graph search 有2个set用于存放detected nodes, successors。
从successors set 里取一个node,当该node不是goal时就detect它的successor,如果没有被detected过且没有在successors set中,那么将其加入successors set,反之则抛弃。

When seeking optimal solutions, mutliple paths to the same state may need to be explored and compared to find the optimal。
这种情况下,我们就要detect一个已经被探测过得或者已经存在在successors set 中的node 是否存在一个更小的heuristic value,是则重新放入或者取代。

注意:If h is consistent (not just admissible), no re-opening is needed. h = 0 is consistent so no reopening is needed with uniform cost.(如果我们的启发方法是consistent,那么就不会有上一个问题了)

  1. For many problems, the state space is a graph rather than a tree.
  2. Cycles can prevent termination.
  3. Be exponentially more efficient than tree search.
  4. Often needed to ensure termination and optimality
  5. Stores all expanded nodes and requires extra tests
总结
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 200,527评论 5 470
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,314评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 147,535评论 0 332
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,006评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,961评论 5 360
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,220评论 1 277
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,664评论 3 392
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,351评论 0 254
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,481评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,397评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,443评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,123评论 3 315
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,713评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,801评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,010评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,494评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,075评论 2 341

推荐阅读更多精彩内容

  • 常言道:故土难离!还真是如此!在旧金山住的时间长了,我这心里边,还真朦朦胧胧生发出了一种思乡之情,这种情感...
    天泽家人阅读 355评论 0 1
  • 她用一支笔创造了我 生命的一切来自于她的热情 她在远处的遥不可及 我在她内心深处感同身受 她看见了我 冷笑不屑羞耻...
    StriveG阅读 242评论 0 0
  • 我和窗外的竹子 隔着一层玻璃 她随着风轻轻舞动身姿 摇曳在这初秋的季节里 夹杂着微微的叹息 我们隔着咫尺的距离 你...
    koko空空阅读 709评论 1 4