I'm in progress of implementing a multi agent A* algorithm on a tile-based map where agent. Agents move only in the X and Y axisaxes. I do avoid collisions between them by checking where arethe others are when calculating paths.
It works fine except the situation whenwhere agents have to pass the same tile from different directions. In situations like shown on imagethis, an optimal solution would be for one agent shouldto wait for anotherthe other to pass, otherwise it would not be the best solution.:


Also, if there's no northern corridor, then pathfinding fails.
Any ideas how toHow could I implement such an algorithm?