Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT
- Pages
- 12
- Format
- Size
- 161 KB
- Trường
- Đại học Bách khoa Hà Nội
- Views
- 0
- Comments
- 0
- Lượt tải
- 0
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).
Frequently asked questions
Is this document free?
Yes. “Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT” is free — just sign in and click Download to get the original file.
How many pages is this document?
The document has 12 pages, for the course Lập trình C. You can preview it online before downloading.
Can I preview before downloading?
Yes. You can preview this document right on this page with the online reader, then decide whether to download.
- 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
- Pages
- 12 pages
- Uploaded by
- lienhejb
Generating preview...
Description
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
Lập trình C nâng cao - Fit Lec 9 (HUST) GV.AnhTT
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
Read full document
- 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
- Pages
- 12 pages
- Uploaded by
- lienhejb
Comments (0)
No comments yet. Be the first!
Lập trình C nâng cao - Fit Lec 7 (HUST) GV.AnhTT
Lập trình C nâng cao - Fit Lec 8 (HUST) GV.AnhTT
Lập trình C nâng cao - Fit Lec 4 (HUST) GV.AnhTT
Lập trình C nâng cao - Fit Lec 5 (HUST) GV.AnhTT
Slide Lập trình C nâng cao - Fit Lec 11 (HUST) GV.AnhTT
K5 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K2 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K3 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K4 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
K1 Bộ đề luyện thi Trạng Nguyên Tiếng Việt (NXB DHQG)
Comments (0)
No comments yet. Be the first!