Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Undirected Breadth First Search F A BCG DE H Source:

Similar presentations


Presentation on theme: "1 Undirected Breadth First Search F A BCG DE H Source:"— Presentation transcript:

1

2 1 Undirected Breadth First Search F A BCG DE H Source:

3 2 Undirected Breadth First Search F A BCG DE H Queue: A get 0 distance from A visit(A) Undiscovered Discovered Finished Top of queue

4 3 Undirected Breadth First Search F A BCG DE H Queue: A 0 F 1 F discovered Undiscovered Discovered Finished Top of queue

5 4 Undirected Breadth First Search F A BCG DE H Queue: A F 0 1 B 1 B discovered Undiscovered Discovered Finished Top of queue

6 5 Undirected Breadth First Search F A BCG DE H Queue: A F B C 1 C discovered Undiscovered Discovered Finished Top of queue

7 6 Undirected Breadth First Search F A BCG DE H Queue: A F B C G 1 G discovered Undiscovered Discovered Finished Top of queue

8 7 Undirected Breadth First Search F A BCG DE H Queue: A F B C G get A finished Undiscovered Discovered Finished Top of queue

9 8 Undirected Breadth First Search F A BCG DE H Queue: A F B C G A already visited Undiscovered Discovered Finished Top of queue

10 9 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D 2 D discovered Undiscovered Discovered Finished Top of queue

11 10 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E 2 E discovered Undiscovered Discovered Finished Top of queue

12 11 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E F finished Undiscovered Discovered Finished Top of queue

13 12 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E Undiscovered Discovered Finished Top of queue get

14 13 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E A already visited Undiscovered Discovered Finished Top of queue

15 14 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E B finished Undiscovered Discovered Finished Top of queue get

16 15 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E A already visited Undiscovered Discovered Finished Top of queue

17 16 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E get C finished Undiscovered Discovered Finished Top of queue

18 17 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E A already visited Undiscovered Discovered Finished Top of queue

19 18 Undirected Breadth First Search F A BCG DE H Undiscovered Fringe Finished Queue: A F B C G D E Active E already visited

20 19 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E get G finished Undiscovered Discovered Finished Top of queue

21 20 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E E already visited Undiscovered Discovered Finished Top of queue

22 21 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E F already visited Undiscovered Discovered Finished Top of queue

23 22 Undirected Breadth First Search F A BCG DE H Undiscovered Fringe Finished Queue: A F B C G D E Active get D finished

24 23 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E D already visited Undiscovered Discovered Finished Top of queue

25 24 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E F already visited Undiscovered Discovered Finished Top of queue

26 25 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E G already visited Undiscovered Discovered Finished Top of queue

27 26 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E H 3 H discovered Undiscovered Discovered Finished Top of queue

28 27 Undirected Breadth First Search F A BCG DE Queue: A F B C G D E H get H 3 E finished Undiscovered Discovered Finished Top of queue

29 28 Undirected Breadth First Search F A BCG DE H Undiscovered Fringe Finished Queue: A F B C G D E H Active E already visited

30 29 Undirected Breadth First Search F A BCG DE H Queue: A F B C G D E H STOP H finished Undiscovered Discovered Finished Top of queue

31 30 Undirected Breadth First Search F A BCG DE H distance from A

32 31 Directed Breadth First Search s

33 32 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s

34 33 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s 2 Top of queue 3 1 1

35 34 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s 2 3 Top of queue

36 35 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue 1 1 1

37 36 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

38 37 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue already discovered: don't enqueue

39 38 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

40 39 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

41 40 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

42 41 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

43 42 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

44 43 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

45 44 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

46 45 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

47 46 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

48 47 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

49 48 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

50 49 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

51 50 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

52 51 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

53 52 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

54 53 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

55 54 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

56 55 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

57 56 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

58 57 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

59 58 Directed Breadth First Search s Undiscovered Discovered Finished Queue: s Top of queue

60 59 Directed Breadth First Search s BFS Tree


Download ppt "1 Undirected Breadth First Search F A BCG DE H Source:"

Similar presentations


Ads by Google