Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT
Tài liệu giảng dạy về đồ thị có hướng, bao gồm các khái niệm cơ bản như đồ thị liên thông, chu trình, cây, cũng như các thuật toán duyệt đồ thị (BFS, DFS), tìm thành phần liên thông, và sắp xếp topo trên đồ thị có hướng không chu trình (DAG).
Generating preview...
Directed graphs anhtt-fit@mail.hut.edu.vn dungct@it-hut.edu.vn http://www.4shared.com/file/43395119/3907952d/lect08. html Terminology Connected graph A graph is connected if and only if there exists a path between every pair of distinct vertices Sub-graph A graph with the vertex and edge set being subsets of the original graph Connected Components A connected component of a graph is a maximally connected subgraph of a graph Cycle A path in a graph that starts and ends at the same vertex Tree A graph G is a tree if and only if it is connected and acyclic Directed Graph A graph whose the edges (arcs) are directional Directed Acyclic Graph A directed graph with no directed cycles 1 Directed Graphs A directed graph can be represented by an adjacency matrix/list the same way as in undirected graph, except: An arc (u, v) only contributes to 1 entry in the adj. matrix or 1 node in the adj. list Paths/Cycles A directed graph can also contain paths and cycles (“directed paths” and “directed cycles”) b a Graph on top has directed paths and directed cycle Graph on bottom has directed paths but NO directed cycle (acyclic) c b a c 2 Graph traversal BFS and DFS can be used to traverse a directed graph, the same way as in undirected graph To check for connectivity of a graph run BFS or DFS using an arbitrary vertex as the source. If all vertices have been visited, then the graph is connected; otherwise, the graph is disconnected Finding Connected Components Run DFS or BFS from a vertex the set of visited vertices form a connected component Find another vertex i which has not been visited before, run DFS or BFS from it we have another connected component Repeat the steps until all vertices are visited Running time is O(ni + mi ) = O ( i mi ) = O( n
… Tải file gốc để đọc toàn bộ tài liệu.
- Document name
- Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT
- School / Course
- Đại học Bách khoa Hà Nội · Lập trình C
- Author (in document)
- AnhTT
- Content
- Tài liệu này tập trung vào đồ thị có hướng, bao gồm định nghĩa, biểu diễn, duyệt đồ thị, tìm thành phần liên thông và giới thiệu về sắp xếp tôpô cho đồ thị không chu trình.
- Table of contents
- Directed graphs
- Terminology
- Connected graph
- Sub-graph
- Connected Components
- Cycle
- Tree
- Directed Graph
- Directed Acyclic Graph
- Directed Graphs
- Paths/Cycles
- Graph traversal
- Finding Connected Components
- A complete graph API
- Topological Sort
- Doc.pages
- 12 pages
- Uploaded by
- lienhejb
Frequently asked questions
Tài liệu này có miễn phí không?
Có. “Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT” miễn phí — bạn chỉ cần đăng nhập rồi bấm Tải xuống để lấy file gốc.
Tài liệu dài bao nhiêu trang?
Tài liệu gồm 12 trang, thuộc môn Lập trình C. Bạn có thể xem trước online trước khi tải.
Tôi có thể xem trước trước khi tải không?
Có. Bạn xem trước tài liệu ngay trên trang này bằng trình đọc online, rồi quyết định tải về.

Comments (0)
No comments yet. Be the first!