Questions tagged [bidirectional-search]

Bidirectional search is a graph search algorithm that finds the shortest path from an initial vertex to a goal vertex in a directed graph. It runs two simultaneous searches (which can be, e.g., two breadth-first searches): one forward from the initial state, and one backwards from the goal, stopping when the two meet.

12 questions
10
votes
4 answers

Implementation of the bidirectional graph search

I am trying to implement a bi-directional graph search. As I understand, I should somehow merge two breadth-first searches, one which starts at the starting (or root) node and one which starts at the goal (or end) node. The bi-directional search…
4
votes
0 answers

Bidirectional BFS in Python Implementation

I am implementing a bidirectional BFS for a 2d maze problem in Python 3.7.3. Firstly, here is how I create the maze: for row in range(dim): # Add an empty array that will hold each cell # in this row grid.append([]) for column in…
3
votes
2 answers

Bidirectional Search

I am trying to implement a bi-directional search in python. As I understand, I should somehow merge two breadth-first searches, one which starts at the starting (or root) node and one which starts at the goal (or end) node. The bi-directional…
2
votes
1 answer

Dijkstra's bi-directional implementation

I am implementing a bidirectional Dijkstra's algorithm and having issues understanding how the various implementations of the stopping condition work out. Take this graph for example, where we're starting from node A, targetting node J. Below the…
1
vote
1 answer

Using Breadth-First Search instead of Bidirectional Search?

Is there any situation or search problem in which it would be better to use regular breadth-first search instead of bidirectional search?
0
votes
0 answers

Why is the time searching for Bidirectional Dijkstra's is more than Dijkstra's?

I had used the Dijktra's algorithm and Bidirectional Dijkstra's as the path finding techniques in the maze game. After I implement everything, it normally works as usual. However, after I insert the time count to prove that Bidirectional Dijkstra's…
Alexander
  • 11
  • 3
0
votes
1 answer

Bidirectional Search for Multiple Goal States

I'm implement bidirectional A* search for pacman food search problem using the Berkeley AI Materials. Can we apply the bidirectional A* search to this problem as it has multiple goal states (multiple food)? I tried to implement a new problem in the…
0
votes
0 answers

How to implement attention matrix from pretrained BERT uncased transformer model to analyze IMDB sentiment tasks

I was following this well-known paper and wanted to generate the attention matrices demonstrated on the last three pages of this paper. The data and model I built are based on this extensive tutorial. However, I am having difficulty extracting one…
0
votes
1 answer

Mistake in implementation of bidirectional path search by Java

I tried implement bidirectional path search (when one search started from the head vertex of a path, and other started from the end vertex and these two path will be union, when they have a non-empty intersection) in Java 17. I have a graph, which…
Maks
  • 1
  • 1
0
votes
0 answers

Why is bidirectional graph search complete only when BFS is used?

In every article I found it seems to say that only when BFS is used in both directions the bidirectional search is complete. I do not realluy understand that, because there are way more "complete" search algorithms. For example, if one of the…
0
votes
0 answers

Slice a list of integers into four slices and applies bidirection search to each slice

I am trying to write a function namely fourslicebidirectionSearch() where I have to do as a title said. My problem is I can write each function on its own but I couldn't figure out how to apply bidirection to four sliced integers. def…
-1
votes
1 answer

Slice a list of integers into four slices and applies bidirection search to each slices

I am trying to write a function namely fourslicebidirectionSearch() where I have to do as a title said. My problem is I can write each function on its own but I couldn't figure out how to apply bidirection to four sliced integers. def…