Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 677 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 677 Bytes

dfs_implementation_using_python

I am using python version 2.7

Before executing the dfs code, you should keep in mind that we are importing stack from Stack. Both stack.py and dfs.py should be in the same folder. Also you requrie an input file that will have the details of graphs.

DFS requires and file name arcs.txt, that you can edit later. The file "arcs.txt" has the details of the all vertices used in graphs and how they are connected. You can select your start point from the code. The format of "arcs.txt" file should not be changed. The format is as follows - S -> A S -> B S -> C A -> D D -> H B -> E E -> F F -> G C -> I

Here my graph starts from "S" vertex.