측면에서 최단 경로(시작에서 목적지까지)가 된다. 하지만 간선의 가중치를 고려할 때 누적된
마일은 최단 경로라고 할 수 있을까? 답은 그렇지 않다는 것이다.
우리는 깊이 우선 탐색이 경로의 길이를 보장하지 않음을 알고 있다. [그림
7
-
15
]는 깊이 우
선 탐색으로 생성된
267
개 간선으로
485
.
2
마일을 이동한 것을 보여준다. 유도 탐색 알고리즘
은 여정 초기에 잘못된 결정을 내려(그림에는 나타나지 않는다)
141
개 간선,
245
.
2
마일을 계
산한다. [그림
7
-
14
]에서 또 다른 경로는 남동쪽 방향으로 진행하며
128
개 간선을 포함하고
210
.
1
마일만을 필요로 한다.
다익스트라 알고리즘
Dijkstra
algorithm
은 이 해결책으로 계산하는 방법
을 보여준다.
그림
7-15
깊이 우선 탐색의 결과인 비효율적 경로
7.6
다익스트라 알고리즘
네덜란드 과학자인 에츠허르 다익스트라
Edsger
Dijkstra
는 컴퓨터 과학 분야의 지적인 설립자
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.