[情報] PA3 DFS和BFS的輸出順序

作者: shefiroth26 (shefiroth)   2013-04-24 16:22:54
DFS和BFS的結果會是一棵tree,
這棵tree的loot就是source node,
BFS tree 和 DFS tree 有一些性質,同學可以從Textbook查到相關資料。
依照pa3.doc規定:
1. For DFS/BFS trees, when there are multiple vertices too choose,
you should always choose the vertex with minimal index first.
2. When you write an edge, please always put the predecessor vertex
in front of the successor vertex.
所以輸出檔案 edges順序 以及 vertices順序 是"固定"的。
第一個edge的第一個vertex 為 source node。
至於MST output之前有公告過,同學可以不用考慮其輸出順序。
以下是gn4.dot source node為v1的輸出結果
DFS:
graph gn4_dfs {
v1

Links booklink

Contact Us: admin [ a t ] ucptt.com