Module 4 Graphs_bfs Dfs
Module 4 Graphs_bfs Dfs
DATA STRUCTURES
GRAPHS
Three Sample Graph
GRAPH ABSTRACT DATA TYPES
BFS & DFS
Cont..
Example:
BFS
DFS
Spanning Trees
Spanning tree – sub graph of G(V,E) with no cycles.
Properties:
1. Spanning tree should connect all vertices of graph
2. If graph is n vertices then spanning tree should have n-1 edges.
3. Should not contain cycles.