Skip to content

christykmathew/Depth-First-and-Breadth-First-Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Open In Collab

Depth First Search and Breadth First Search

Breadth First Search is a vertex based technique for finding a shortest path in graph whereas Depth First Search is a edge based technique.

Upload sample.txt containing the Graph nodes(start_node, end_node) and the costs.

from google.colab import drive
drive.mount('/content/drive')
sample_text = open("/content/drive/My Drive/sample.txt")

sample.txt format is given below. The First Line is the number of nodes and edges and the second line is the start_node and the goal_node.

8 13
S G
S A 6
S B 2
S C 1
A D 3
A G 20
B D 2
B E 6
C B 3
C E 6
C F 4
D F 5
E G 2
F G 1

About

DFS and BFS algorithm for traversing through graph

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors