A parcel network can contain a loop, a repeated lane, or a depot with no lanes. A traversal needs an explicit rule for what has already been visited. Mark a vertex when you add it to the queue so another incoming lane can't add it again. Breadth-first search handles vertices in distance order when every edge costs one.
A search from one starting point answers reachability questions within that component. To inspect a whole network, scan every identifier and restart from each unseen vertex. Keep the meaning of your state clear: a visited flag answers reachability, a distance records transfers, and a color represents a two-shift assignment. You will begin with guided queue construction, then reuse the search idea for disconnected graphs and conflicting constraints.
lanes = [[0,1], [1,2], [3,4]]
start = 0
visited by BFS: 0, 1, 2
reachable count = 3
component sizes = [3, 2]
The queue reaches one component; a new search from 3 discovers the other.