Lecture17: Graph I Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Graph 2
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Graphs Example: A vertex represents an airport and stores the three‐letter airport code. An edge represents a flight route between two airports and stores the mileage of the route. 3 ORD PVD MIA DFW SFO LAX LGA HNL
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Applications Electronic circuits Printed circuit board Integrated circuit Transportation networks Highway network Flight network Computer networks Local area network Internet Web Databases Entity‐relationship diagram 4
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Applications 5 ImageNet Gene network
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Basic Definitions in Graph 6 ORDPVD flight AA 1206 ORDPVD 849 miles
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Undirected Graph 7
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Directed Graph 8
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Terminology 9
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Terminology (cont’d) 10
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Terminology (cont’d) 11
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Terminology in Directed Graph 12
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Properties of Graphs 13
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Connectivity Connected graph There is a path from every vertex to every other vertex. Connected component Maximal connected subgraph Complete graph There is an edge between every pair of vertices. 14 Connected graph Non connected graph with two connected components Complete graph
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Connectivity in Directed Graph Strongly connected graph There is a path from every vertex to every other vertex. Weakly connected graph There is a path from every vertex to every other vertex, disregarding the direction of the edges. 15 Strongly connected graph Weakly connected graph
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Connectivity 16 Subgraph Spanning subgraph
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Trees and Forests A (free) tree is an undirected graph T such that T is connected T has no cycles This definition of tree is different from the one of a rooted tree Forest A forest is an undirected graph without cycles The connected components of a forest are trees 17 Tree Forest
CSED233: Data Structures by Prof. Bohyung Han, Fall 2014 Spanning Trees and Forests Spanning tree A spanning subgraph that is a tree Not unique unless the graph is a tree Spanning forest A spanning subgraph that is a forest 18 Graph Spanning tree
19