The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Lecture 15 - DFS and BFS This tree defines a shortest path from the root to every other node in the tree. The proof is by induction on the length of the shortest path from the root: ● Length = 1 First step of BFS explores all neighbors of the root. In an unweighted graph one edge must be the shortest path to any node. ● Length = s Assume the BFS tree has the shortest paths up to length s-1. Any node at a distance of will first be discovered by expanding a distance s-1 node. Listen To Part 16-11 The key idea about DFS A depth-first search of a graph organizes the edges of the graph in a precise way. In a DFS of an undirected graph, we assign a direction to each edge, from the vertex which discover it: In a DFS of a directed graph, every edge is either a tree edge or a black edge. file:///E|/LEC/LECTUR16/NODE15.HTM (2 of 8) [19/1/2003 1:35:08]
Lecture 15 - DFS and BFS In a DFS of a directed graph, no cross edge goes to a higher numbered or rightward vertex. Thus, no edge from 4 to 5 is possible: Listen To Part 16-12 Edge Classification for DFS What about the other edges in the graph? Where can they go on a search? Every edge is either: On any particular DFS or BFS of a directed or undirected graph, each edge gets classified as one of the above. Listen To Part 17-3 DFS Trees The reason DFS is so important is that it defines a very nice ordering to the edges of the graph. file:///E|/LEC/LECTUR16/NODE15.HTM (3 of 8) [19/1/2003 1:35:08]
- Page 925 and 926: Lecture 8 - binary trees insert(b)
- Page 927 and 928: Lecture 8 - binary trees Not (1) -
- Page 929 and 930: Lecture 9 - catch up Next: Lecture
- Page 931 and 932: Lecture 10 - tree restructuring 1.
- Page 933 and 934: Lecture 10 - tree restructuring Lis
- Page 935 and 936: Lecture 10 - tree restructuring Not
- Page 937 and 938: Lecture 10 - tree restructuring Cas
- Page 939 and 940: Lecture 11 - backtracking Next: Lec
- Page 941 and 942: Lecture 11 - backtracking Only 63 s
- Page 943 and 944: Lecture 11 - backtracking Recursion
- Page 945 and 946: Lecture 11 - backtracking Specifica
- Page 947 and 948: Lecture 12 - introduction to dynami
- Page 949 and 950: Lecture 12 - introduction to dynami
- Page 951 and 952: Lecture 12 - introduction to dynami
- Page 953 and 954: Lecture 12 - introduction to dynami
- Page 955 and 956: Lecture 12 - introduction to dynami
- Page 957 and 958: Lecture 13 - dynamic programming ap
- Page 959 and 960: Lecture 13 - dynamic programming ap
- Page 961 and 962: Lecture 13 - dynamic programming ap
- Page 963 and 964: Lecture 14 - data structures for gr
- Page 965 and 966: Lecture 14 - data structures for gr
- Page 967 and 968: Lecture 14 - data structures for gr
- Page 969 and 970: Lecture 14 - data structures for gr
- Page 971 and 972: Lecture 14 - data structures for gr
- Page 973 and 974: Lecture 14 - data structures for gr
- Page 975: Lecture 15 - DFS and BFS Next: Lect
- Page 979 and 980: Lecture 15 - DFS and BFS It could u
- Page 981 and 982: Lecture 15 - DFS and BFS Algorithm
- Page 983 and 984: Lecture 16 - applications of DFS an
- Page 985 and 986: Lecture 16 - applications of DFS an
- Page 987 and 988: Lecture 16 - applications of DFS an
- Page 989 and 990: Lecture 17 - minimum spanning trees
- Page 991 and 992: Lecture 17 - minimum spanning trees
- Page 993 and 994: Lecture 17 - minimum spanning trees
- Page 995 and 996: Lecture 17 - minimum spanning trees
- Page 997 and 998: Lecture 17 - minimum spanning trees
- Page 999 and 1000: Lecture 18 - shortest path algorthm
- Page 1001 and 1002: Lecture 18 - shortest path algorthm
- Page 1003 and 1004: Lecture 18 - shortest path algorthm
- Page 1005 and 1006: Lecture 18 - shortest path algorthm
- Page 1007 and 1008: Lecture 18 - shortest path algorthm
- Page 1009 and 1010: Lecture 19 - satisfiability Next: L
- Page 1011 and 1012: Lecture 19 - satisfiability Why? Th
- Page 1013 and 1014: Lecture 19 - satisfiability between
- Page 1015 and 1016: Lecture 19 - satisfiability Note th
- Page 1017 and 1018: Lecture 20 - integer programming Ex
- Page 1019 and 1020: Lecture 20 - integer programming Ne
- Page 1021 and 1022: Lecture 21 - vertex cover Proof: VC
- Page 1023 and 1024: Lecture 21 - vertex cover Question:
- Page 1025 and 1026: Lecture 21 - vertex cover seen to d
Lecture 15 - DFS and BFS<br />
In a DFS of a directed graph, no cross edge goes to a higher numbered or rightward vertex. Thus, no<br />
edge from 4 to 5 is possible:<br />
Listen To Part 16-12<br />
Edge Classification for DFS<br />
What about the other edges in the graph? Where can they go on a search?<br />
Every edge is either:<br />
On any particular DFS or BFS of a directed or undirected graph, each edge gets classified as one of the<br />
above.<br />
Listen To Part 17-3<br />
DFS Trees<br />
<strong>The</strong> reason DFS is so important is that it defines a very nice ordering to the edges of the graph.<br />
file:///E|/LEC/LECTUR16/NODE15.HTM (3 of 8) [19/1/2003 1:35:08]