bfs, dfs and ucs working on visibility without rotation