Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Theory Chapter 2 An Introduction to Algorithms

Similar presentations


Presentation on theme: "Graph Theory Chapter 2 An Introduction to Algorithms"— Presentation transcript:

1 Graph Theory Chapter 2 An Introduction to Algorithms
大葉大學(Da-Yeh Univ.) 資訊工程系(Dept. CSIE) 黃鈴玲(Lingling Huang)

2 Outline 2.6 Representing graph in a computer

3 2.6 Representing graph in a computer
① adjacency matrix: G: v6 v4 v2 v1 v3 v5

4 ② adjacency list: G: 1. 2. 3. 4. 5. 6. v6 v4 v2 v1 v3 v5 2 3 1 3 1 2 4
1 3 1 2 4 5 3 3

5 ② adjacency list: 6 個 點  邊 數 2 neighbor 名稱 neighbor 在表 格中的位置 1. 2.
表示v1的第一個neighbor位置 7 6 個 點 1. 2 3 ,, v ,, 9 ,, v ,, 11 2. 1 3 ,, v ,, 15 ,, v ,, 16 3. 1 2 4 5 ,, v ,, 4. 2 表示下一個neighbor位置 8 3 邊 數 2 3 表示沒有了 adjacency list table 5. 3 1 10 3 6. φ 1 12 2 13 4 14 5 3 3

6 Homework Exercise 2.6: 1


Download ppt "Graph Theory Chapter 2 An Introduction to Algorithms"

Similar presentations


Ads by Google