Shortest Path with and Without Barrier