Starting BFS at s and t INPUT: undirected graph, s, t

OUTPUT: connectivity of s and t

I perform BFS on s AND t, each taking turns to make one traversal.

When a vertex exists in both s and t's BFS tree, we can assume it is connected.

When one tree is done traversing but the other is not, s and t are not connected.

Does such an algorithm exist or am I making stuff up?
Yes, this is a known thing. It's called bidirectional search.  It will find shortest paths in unweighted graphs and, in graphs of where every vertex has degree&nbsp;$d$, it will visit at most $2d^{\ell/2}=2\sqrt{d^\ell}$ vertices (where $\ell$&nbsp;is the length of the shortest path), whereas ordinary BFS could visit up to $d^\ell$&nbsp;vertices.