Breadth First Search in Graphs

http://install4install.com

Breadth First Search is a technique to visit all the nodes of graph in a well-defined way.This technique can be applied  to  directed,undirected,weighted or unweighted  graph.Queues are used as a data structure to store elements.

Example

Say we have a graph as shown in  Fig 1

Screen Shot 2014-07-15 at 5.09.35 PM

Fig 1 : A Graph

 

Screen Shot 2014-07-16 at 1.26.21 PM

Fig 2 : Mark A

1

Fig 2 : Mark B

 

Screen Shot 2014-07-15 at 5.27.56 PM

Fig 3 : Mark D

Screen Shot 2014-07-15 at 5.39.08 PM

Fig 5 : Mark C

Screen Shot 2014-07-15 at 6.07.19 PM

Fig 6 : Mark F

 

Screen Shot 2014-07-15 at 6.08.57 PM

Fig 8 : Mark G

 



Short URL: http://tinyit.cc/c27b00
Author: Cusp2207 on July 16, 2014
Category: Computer Science
Tags:

Leave a Reply

Last articles