Graph Search using- Uniform Cost Search (Using input file) Programming Lang: Python 3.6 (for python 2.4 un-comment the PriorityQueue defination and change print() syntax)
-----INSTRUCTIONS-----
>> python find_route.py <Input_File_Name> <Start_City> <Destination_City>
##An Example: >> python find_route.py input1.txt Bremen Frankfurt
CODE_STRUCTURE
File: find_route.py
#Main function handles all the operations by calling specific functions #Main function accepts all the arguments passed and stores them in variables #Main Function calls create_graph()
>> {Karlsruhe': [('Saarbruecken', '143'), ('Stuttgart', '71')], 'Saarbruecken': [('Dortmund', '350'), ('Frankfurt', '177'), ('Karlsruhe', '143')], 'Duesseldorf': [('Dortmund', '69')], ....}
#Main Function Then Class the uniformed_cost_search() which return a path and total cost as a list
As PriorityQueue is already sorted on element[0] which is cost, it will always have node with lowest cost for expansion
#Main function then calls the display_path() to display the result in the correct in proper format
Please Note, You have to be within the directory where the code is.