Puas yog lub hnub qub greedy?
Puas yog lub hnub qub greedy?

Video: Puas yog lub hnub qub greedy?

Video: Puas yog lub hnub qub greedy?
Video: Qub Qub Tsw Tsw - Jeeker (Official Audio) 2024, Hlis ntuj nqeg
Anonim

A* (A hnub qub ) A * yog kev sib xyaw ntawm Dijkstra thiab Greedy . Nws siv qhov kev ncua deb ntawm lub hauv paus node ntxiv rau heuristics nrug mus rau lub hom phiaj. Lub algorithm xaus thaum peb pom lub hom phiaj ntawm.

Tsis tas li ntawd, puas yog greedy zoo tshaj plaws thawj tshawb nrhiav tiav?

Hauv cov ntsiab lus, siab ntshaw BFS tsis yog ua kom tiav , tsis zoo , muaj lub sij hawm complexity ntawm O (bm) thiab qhov chaw complexity uas yuav ua tau polynomial. A* yog ua kom tiav , zoo , thiab nws muaj lub sijhawm thiab qhov chaw nyuaj ntawm O (bm). Yog li, feem ntau, A * siv lub cim xeeb ntau dua siab ntshaw BFS. A* ua tsis tau zoo thaum lub nrhiav qhov chaw loj heev.

Ib sab saum toj no, puas yog * nkag tau? Yog hais tias lub heuristic muaj nuj nqi nkag tau , txhais tau hais tias nws yeej tsis overestimates tus nqi tiag tiag kom tau mus rau lub hom phiaj, A * tau lav tias yuav rov qab tau tus nqi tsawg kawg ntawm kev pib mus rau lub hom phiaj. Tus nqi f ntawm lub hom phiaj yog ces tus nqi ntawm txoj kev luv tshaj plaws, txij li h ntawm lub hom phiaj yog xoom hauv ib qho nkag tau heuristic.

Ntxiv mus, yog vim li cas yog ib tug * zoo tshaj qhov zoo tshaj plaws nrhiav thawj?

A* ua tiav zoo dua kev ua tau zoo los ntawm kev siv heuristics coj nws nrhiav . A* muab cov txiaj ntsig zoo ntawm Zoo tshaj - thawj Nrhiav thiab Uniform Cost Nrhiav : xyuas kom pom txoj kev optimized thaum ua kom cov algorithm efficiency siv heuristics.

Puas yog A * algorithm tiav?

A* yog ua kom tiav thiab yuav ib txwm nrhiav kev daws teeb meem yog tias muaj. Ua tib zoo saib ntawm kab lus wikipedia. Yog hais tias ntxiv cov heuristics yog admissible thiab monotonic lub algorithm tseem yuav nkag tau (piv txwv li kev pom zoo).

Pom zoo: