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ị.
Génération de l'aperçu...
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,
… Téléchargez le fichier original pour lire le document complet.
- Nom du document
- Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT
- École / Cours
- Đại học Bách khoa Hà Nội · Lập trình C
- Auteur (dans le document)
- AnhTT
- Contenu
- 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.
- Table des matières
- Undirected graphs
- Graph terminology
- Some graph-processing problems
- Graph representation (1)
- Edge List Structure
- Graph representation (2)
- Graph representation (3)
- Adjacency List Representation
- Pages
- 11 pages
- Téléversé par
- lienhejb
Foire aux questions
Ce document est-il gratuit ?
Oui. « Lập trình C nâng cao - Fit Lec 6 (HUST) GV.AnhTT » est gratuit — il suffit de vous connecter et de cliquer sur Télécharger pour obtenir le fichier original.
Combien de pages compte ce document ?
Le document contient 11 pages, pour le cours Lập trình C. Vous pouvez le prévisualiser en ligne avant de le télécharger.
Puis-je prévisualiser avant de télécharger ?
Oui. Vous pouvez prévisualiser ce document directement sur cette page avec le lecteur en ligne, puis décider de le télécharger ou non.

Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !