Download presentation
Presentation is loading. Please wait.
Published byWalter Haynes Modified over 8 years ago
1
DATA STRUCTURE Presented By: Mahmoud Rafeek Alfarra Using C# MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Information Technology, 3’rd Semester Lecture 18: An Overview of Graph
2
Outline Definition of Graph Data Structure Concept of Vertices and edges What is Hash tables? Emank X Mezank !!
3
What is Graph? A graph consists of a set of vertices and a set of edges. Think of a map of your Country. Each town is connected with other towns via some type of road. 3 Presented & Prepared by: Mahmoud R. Alfarra
4
Vertex and edge !!! Each town is a vertex and a road that connects two towns is an edge. Edges are specified as a pair, (v1, v2), where v1 and v2 are two vertices in the graph. A vertex can also have a weight, sometimes also called a cost. 4 Presented & Prepared by: Mahmoud R. Alfarra
5
Directed graph 5 Presented & Prepared by: Mahmoud R. Alfarra ordered digraph A graph whose pairs are ordered is called a directed graph, or just a digraph.
6
Unordered graph 6 Presented & Prepared by: Mahmoud R. Alfarra If a graph is not ordered, it is called an unordered graph, or just a graph.
7
Path & length 7 Presented & Prepared by: Mahmoud R. Alfarra A path is a sequence of vertices in a graph such that all vertices are connected by edges. The length of a path is the number of edges from the first vertex in the path to the last vertex. A path can also consist of a vertex to itself, which is called a loop. Loops have a length of 0.
8
A cycle Path 8 Presented & Prepared by: Mahmoud R. Alfarra A cycle is a path of at least 1 in a directed graph so that the beginning vertex is also the ending vertex. In a directed graph, the edges can be the same edge, but in an undirected graph, the edges must be distinct.
9
Connected graph An undirected graph is considered connected if there is a path from every vertex to every other vertex. In a directed graph, this condition is called strongly connected. A directed graph that is not strongly connected, but is considered connected, is called weakly connected. If a graph has a edge between every set of vertices, it is said to be a complete graph.
10
Emank X Mezank !! قال النبي صلى الله عليه وسلم: قولوا لا إله إلا الله تُفلحـوا
11
Next Lecture Graphs
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.