First try, works, but one problem

Using BFS to get set of nodes that two nodes can visit independently,
then take the intersection of two sets to see if there is a route
between them. The time complexity should be O(E+V), where E is number of
Edges, V is number of nodes.
The problem is, as we cannot set "Visited" to every node, the time
complexity now should be O((E+V)*2)