Different types of obstacles are made by varying the edge weight. Hence choose the different types of obstacles only in Dijkstra and not in BFS algorithm.