인, 선택됩니다. 또한 dijkstra (대기열 아님)에서 우선 순위 대기열을 사용하므로 비용이 가장 적은 노드를 확장 할 수 있습니다. 그래서 당신의 예에서 A는 결코 확장되지 않을 것입니다.
open list = [ S cost:0 ] // priortiy queue
pop S out of open list
closed list = [ S cost:0 ]
open list = [ B cost:1 ; A cost:5 ]
pop B out of open list
closed list = [ S cost:0 ; B cost:1 ]
open list = [ E cost:2 ; A cost:5 ]
pop E out of open list
// it's better to terminate when we reach the goal but if we don't
// it doesn't make any difference we are going to find the shortest path
// to other nodes
closed list = [ S cost:0 ; B cost:1 ; E cost:2 ]
open list = [ A cost:5 ]
pop A out of open list
// there isn't any nodes that we can push to open list
closed list = [ S cost:0 ; B cost:1 ; E cost:2 ; A cost:5 ]
open_list = []
는 다 익스트라는 그것의 가장 짧은 경로를 찾을 수있다 가정하기 때문에 그것 확장에 폐쇄 목록에 노드를 밀어 넣습니다. 목표에 도달 할 때 종료하지 않더라도 폐쇄 목록에 있기 때문에 A를 확장하지 않습니다.
"목표 노드"란 무엇을 의미합니까? priority-queue가 비어있을 때 Dijkstra의 알고리즘이 종료됨을 알고 있습니다. – Elimination
나는 곧 내 대답에서 그것을 설명 할 것이다. – Tempux
CLRS book은 그렇지 않다고 말합니다. 우선 순위 대기열에서 빠져 나면 닫힌 집합에 정점을 추가합니다. – Elimination