Dab tsi yog qhov nyuaj ntawm Dijkstra's algorithm?
Dab tsi yog qhov nyuaj ntawm Dijkstra's algorithm?

Video: Dab tsi yog qhov nyuaj ntawm Dijkstra's algorithm?

Video: Dab tsi yog qhov nyuaj ntawm Dijkstra's algorithm?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Hlis ntuj nqeg
Anonim

Lub sij hawm nyuaj ntawm Dijkstra's Algorithm yog O (V 2) tab sis nrog min-priority queue nws poob mus rau O (V + E l o g V).

Ib sab ntawm no, Dijkstra's algorithm yog dab tsi nrog piv txwv?

Dijkstra's algorithm (los yog Dijkstra cov Txoj Kev Shortest Thawj algorithm , SPF algorithm ) yog ib algorithm txhawm rau nrhiav txoj hauv kev luv tshaj plaws ntawm cov nodes hauv daim duab, uas tuaj yeem sawv cev, rau piv txwv , kev networks. Rau qhov muab qhov node hauv daim duab, lub algorithm pom txoj kev luv tshaj ntawm qhov node thiab txhua lwm yam.

Kuj Paub, yog Dijkstra's algorithm zoo? Dijkstra's algorithm yog siv rau kev tshawb nrhiav graph. Nws yog zoo , txhais tau tias nws yuav pom ib txoj kev luv tshaj plaws. Nws yog uninformed, txhais tau tias nws tsis tas yuav tsum paub lub hom phiaj ntawm tes ua ntej tes. Qhov tseeb nws pom txoj kev luv tshaj plaws los ntawm txhua lub pob mus rau ntawm lub hauv paus chiv keeb.

Ib sab ntawm no, Dijkstra's algorithm ua dab tsi?

Dijkstra's algorithm tuaj yeem siv los txiav txim txoj kev luv tshaj plaws los ntawm ib qho ntawm ib qho daim duab rau txhua qhov ntawm lwm qhov hauv tib yam daim duab cov ntaub ntawv qauv, yog tias cov nodes tuaj yeem ncav cuag los ntawm qhov pib ntawm qhov pib. Dijkstra's algorithm tuaj yeem siv los nrhiav txoj hauv kev luv tshaj.

Puas yog Dijkstra BFS lossis DFS?

Dijkstra cov algorithm yog Dijkstra's algorithm, nws tsis yog algorithm vim BFS thiab DFS lawv tus kheej tsis yog Dijkstra cov algorithm: BFS tsis siv qhov tseem ceeb queue (los yog array, yog tias koj xav siv qhov ntawd) khaws cia qhov deb, thiab. BFS tsis ua cov ntug kev so.

Pom zoo: