Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT
正在生成预览...
Tài liệu giảng dạy về đồ thị vô hướng, các khái niệm cơ bản về biểu diễn đồ thị (danh sách cạnh, ma trận kề, danh sách kề) và các bài tập thực hành lập trình C để xây dựng các cấu trúc dữ liệu đồ thị.
描述
Undirected graphs anhtt-fit@mail.hut.edu.vn dungct@it-hut.edu.vn Undirected graphs A graph G=(V, E) where V is a set of vertices connected pairwise by edges E. Why study graph algorithms? Interesting and broadly useful abstraction. Challenging branch of computer science and discrete math. Hundreds of graph algorithms known. Thousands of practical applications. Communication, circuits, transportation, scheduling, software systems, internet, games, social network, neural networks, … 1 Graph terminology Some graph-processing problems Path: Is there a path between s to t? Shortest path: What is the shortest path between s and t? Cycle: Is there a cycle in the graph? Euler tour: Is there a cycle that uses each edge exactly once? Hamilton tour: Is there a cycle that uses each vertex exactly once? Connectivity: Is there a way to connect all of the vertices? MST: What is the best way to connect all of the vertices? Biconnectivity: Is there a vertex whose removal disconnects the graph? 2 Graph representation (1) Maintain a list of the edges Not suitable for searching Edge List Structure Edge sequence sequence of edge objects Edge object element origin vertex object destination vertex object reference to position in edge sequence Vertex sequence sequence of vertex objects Vertex object element reference to position in vertex sequence 3 Graph representation (2) Maintain an adjacency matrix. Suitable for random accesses to the edges A graph data structure Use a dynamic array to represent a graph as the following typedef struct { int * matrix; int sizemax; } Graph; Define the following API Graph createGraph(int sizemax); void setEdge(Graph* graph, int v1,
AI 摘要
- 文档名称
- Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT
- 学校 / 课程
- Đại học Bách khoa Hà Nội · Lập trình C
- 作者(文档中)
- AnhTT
- 内容
- Tài liệu này tập trung vào đồ thị vô hướng, các bài toán liên quan và các phương pháp biểu diễn đồ thị phổ biến như danh sách cạnh, ma trận kề và danh sách kề, cùng với các ví dụ và bài tập thực hành.
- 目录
- Undirected graphs
- Graph terminology
- Some graph-processing problems
- Graph representation (1)
- Edge List Structure
- Graph representation (2)
- Graph representation (3)
- Adjacency List Representation
- 页数
- 11 页
- 上传者
- lienhejb
常见问题
此文档免费吗?
是的。“Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT”是免费的 — 只需登录并点击“下载”即可获取原始文件。
这份文档有多少页?
该文档共有 11 页,适用于课程 Lập trình C。您可以在下载前进行在线预览。
我可以在下载前预览吗?
是的。您可以通过在线阅读器直接在本页面预览此文档,然后再决定是否下载。
Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT
正在生成预览...
Undirected graphs anhtt-fit@mail.hut.edu.vn dungct@it-hut.edu.vn Undirected graphs A graph G=(V, E) where V is a set of vertices connected pairwise by edges E. Why study graph algorithms? Interesting and broadly useful abstraction. Challenging branch of computer science and discrete math. Hundreds of graph algorithms known. Thousands of practical applications. Communication, circuits, transportation, scheduling, software systems, internet, games, social network, neural networks, … 1 Graph terminology Some graph-processing problems Path: Is there a path between s to t? Shortest path: What is the shortest path between s and t? Cycle: Is there a cycle in the graph? Euler tour: Is there a cycle that uses each edge exactly once? Hamilton tour: Is there a cycle that uses each vertex exactly once? Connectivity: Is there a way to connect all of the vertices? MST: What is the best way to connect all of the vertices? Biconnectivity: Is there a vertex whose removal disconnects the graph? 2 Graph representation (1) Maintain a list of the edges Not suitable for searching Edge List Structure Edge sequence sequence of edge objects Edge object element origin vertex object destination vertex object reference to position in edge sequence Vertex sequence sequence of vertex objects Vertex object element reference to position in vertex sequence 3 Graph representation (2) Maintain an adjacency matrix. Suitable for random accesses to the edges A graph data structure Use a dynamic array to represent a graph as the following typedef struct { int * matrix; int sizemax; } Graph; Define the following API Graph createGraph(int sizemax); void setEdge(Graph* graph, int v1,
阅读全文
- 文档名称
- Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT
- 学校 / 课程
- Đại học Bách khoa Hà Nội · Lập trình C
- 作者(文档中)
- AnhTT
- 内容
- Tài liệu này tập trung vào đồ thị vô hướng, các bài toán liên quan và các phương pháp biểu diễn đồ thị phổ biến như danh sách cạnh, ma trận kề và danh sách kề, cùng với các ví dụ và bài tập thực hành.
- 目录
- Undirected graphs
- Graph terminology
- Some graph-processing problems
- Graph representation (1)
- Edge List Structure
- Graph representation (2)
- Graph representation (3)
- Adjacency List Representation
- 页数
- 11 页
- 上传者
- lienhejb
评论 (0)
暂无评论。快来抢沙发吧!
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)
评论 (0)
暂无评论。快来抢沙发吧!