A bidirectional search algorithm for the maze problem