Programming Game AI by Example5. 그래프의 비밀아키텍트를 꿈꾸는 사람들(http://cafe.naver.com/architect1)현수명  (http://soomong.tistory.com)
그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*Graph그래프의 정의
이산수학 Example 5.2GraphNodea3Edge ( Arc )g(aX)함수2a2a4a1a6a513455개의 Node와 6개의 Edge
이산수학 DefinitionGraph그래프는 순서쌍 (N, A, g)이다N : Node 들의 집합. (공집합 안됨)A : Arc 들의 집합. (공집합 허용,유한개)g : Arc a 의 끝점이라고 하는 비순서쌍 x-y 가 각각의 arc a 로 사상하는 함수
이산수학 Definition트리Tree트리는root 라고 지정된 노드를 갖는비순환(acyclic), 연결(connected) 그래프이다rr
Dense vs Sparse Graph밀집한 vs성긴 그래프
Digraph방향성 그래프
이산수학 Example 5.4a5a1a2a3241a43g(a3) = (1,3)g(a4) = (3,1)g(a1) = (1,2)
Game AI Graph게임 AI 에서의 그래프Navigation Graph
Game AI Graph게임 AI 에서의 그래프State GraphDependency Graph
그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*그래프 클래스 구현하기Adjacency Matrix인접행렬Adjacency List인접리스트
이산수학그래프에 대한 컴퓨터 표현방식인접 행렬adjacency matrix]A = [11      1     -      11      -     1      --       1     -     11      -      1     -234행렬 원소 (1,1) 의 값 1 은 노드1 에서의 루프를 나타낸다모든 무방향성 그래프의 인접행렬은 대칭적이다.
이산수학그래프에 대한 컴퓨터 표현방식인접 리스트adjacency list즉 Linked list1124   •113   •223344   •24133   •4
그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*WARNING!Beware! Search algorithms have the ability to create in the average humanbrain terrible amounts of frustration and confusion, leading to headaches,nausea, and sleep deprivation. Spontaneous and excessive howling is not uncommon. Please be aware these symptoms are commonplace in the earlystages of the learning curve and are not generally cause for concern. Normal service is usually resumed within a reasonable length of time. (If symptoms persist, however, stay clear of busy roads, razor blades, andloaded weapons. Seek medical advice at the earliest opportunity.)경고! 탐색 알고리즘은 수많은 좌절과 혼동으로, 두통, 메스꺼움, 수면 결핍을 통하여 보통 사람의 두뇌로 생성될 수 있다. 자발적이고 과도한 울부짖음은 보통이다.이러한 증상은 배우는 초기 단계에서 동반되는 것으로 일반적으로 관심을 끌지 못함에 유의한다.보통의 서비스는 대개 합리적인 시간 내에 재개된다. ( 그러나 증상이 계속 된다면, 복잡한 도로, 레이저날, 장착된 무기를 제거하고, 기회가 있을 때 빨리 의사를 찾아간다)
그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*Depth First Search깊이 우선 탐색그래프를 가능한 깊게 이동하여 탐색한다.    - 막다른 곳에 도달하면 더 얕은 노드로 되돌아간다.깊이 탐색 AlgorithmStack                                           LIFO
Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
5 에서 3 찾아가기Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색
Found!!Depth First Search깊이 우선 탐색
Depth First Search깊이 우선 탐색5 – 2 – 1 -3
Depth First Search깊이 우선 탐색
그래프 그래프, 트리
 그래프 클래스 구현하기그래프 탐색 알고리즘무정보 그래프 탐색
깊이 우선 탐색
너비 우선 탐색
비용 기반 그래프 탐색
Dijkstra Algorithm
Dijkstra Algorithm A*Breadth First Search너비 우선 탐색시작노드에서 인접한 각 노드들를 검사하고목표노드를 찾을때까지 시작 노드에서     - 하나의 에지만큼 떨어진 노드    - 두개의 에지만큼 떨어진 노드    - 세개의 에지만큼 떨어진 노드 등을 탐색한다.즉 이렇게 찾은 경로는 가장 적은 에지를 포함하도록 보장된다.너비 탐색 AlgorithmQueue                                                   FIFO
Breadth First Search너비 우선 탐색
5 에서 3 찾아가기Breadth First Search너비 우선 탐색
Breadth First Search너비 우선 탐색
Breadth First Search너비 우선 탐색
Breadth First Search너비 우선 탐색
Breadth First Search너비 우선 탐색
Found!!Breadth First Search너비 우선 탐색
Breadth First Search너비 우선 탐색5 – 4 – 3

5장 그래프의 비밀 (Programming Game AI by Example)