Refactor reachability.
Use maps for cells and walls.
Limit river/wall generation retries.