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一個已經(jīng)被探測過得或者已經(jīng)存在在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.(如果我們的啟發(fā)方法是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
總結(jié)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末壁畸,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子喜喂,更是在濱河造成了極大的恐慌瓤摧,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,627評論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件玉吁,死亡現(xiàn)場離奇詭異照弥,居然都是意外死亡,警方通過查閱死者的電腦和手機进副,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,180評論 3 399
  • 文/潘曉璐 我一進店門这揣,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人影斑,你說我怎么就攤上這事给赞。” “怎么了矫户?”我有些...
    開封第一講書人閱讀 169,346評論 0 362
  • 文/不壞的土叔 我叫張陵片迅,是天一觀的道長。 經(jīng)常有香客問我皆辽,道長柑蛇,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 60,097評論 1 300
  • 正文 為了忘掉前任驱闷,我火速辦了婚禮耻台,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘空另。我一直安慰自己盆耽,他們只是感情好,可當我...
    茶點故事閱讀 69,100評論 6 398
  • 文/花漫 我一把揭開白布扼菠。 她就那樣靜靜地躺著摄杂,像睡著了一般。 火紅的嫁衣襯著肌膚如雪循榆。 梳的紋絲不亂的頭發(fā)上匙姜,一...
    開封第一講書人閱讀 52,696評論 1 312
  • 那天,我揣著相機與錄音冯痢,去河邊找鬼氮昧。 笑死框杜,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的袖肥。 我是一名探鬼主播咪辱,決...
    沈念sama閱讀 41,165評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼椎组!你這毒婦竟也來了油狂?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 40,108評論 0 277
  • 序言:老撾萬榮一對情侶失蹤寸癌,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后蒸苇,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,646評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡溪烤,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,709評論 3 342
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了檬嘀。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片槽驶。...
    茶點故事閱讀 40,861評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖鸳兽,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情揍异,我是刑警寧澤,帶...
    沈念sama閱讀 36,527評論 5 351
  • 正文 年R本政府宣布蒿秦,位于F島的核電站烤镐,受9級特大地震影響蛋济,放射性物質(zhì)發(fā)生泄漏棍鳖。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 42,196評論 3 336
  • 文/蒙蒙 一碗旅、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧祟辟,春花似錦、人聲如沸旧困。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,698評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至怖竭,卻和暖如春锥债,著一層夾襖步出監(jiān)牢的瞬間痊臭,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,804評論 1 274
  • 我被黑心中介騙來泰國打工广匙, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人艇潭。 一個月前我還...
    沈念sama閱讀 49,287評論 3 379
  • 正文 我出身青樓,卻偏偏與公主長得像鲁纠,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子改含,可洞房花燭夜當晚...
    茶點故事閱讀 45,860評論 2 361

推薦閱讀更多精彩內(nèi)容

  • 常言道:故土難離迄汛!還真是如此!在舊金山住的時間長了鞍爱,我這心里邊,還真朦朦朧朧生發(fā)出了一種思鄉(xiāng)之情睹逃,這種情感...
    天澤家人閱讀 371評論 0 1
  • 她用一支筆創(chuàng)造了我 生命的一切來自于她的熱情 她在遠處的遙不可及 我在她內(nèi)心深處感同身受 她看見了我 冷笑不屑羞恥...
    StriveG閱讀 247評論 0 0
  • 我和窗外的竹子 隔著一層玻璃 她隨著風輕輕舞動身姿 搖曳在這初秋的季節(jié)里 夾雜著微微的嘆息 我們隔著咫尺的距離 你...
    koko空空閱讀 728評論 1 4