Instead of finding all 6 hops from start and checking if it's the end find 3 hops from start, 3 hops from end and just intersect two sets.
Instead of finding all 6 hops from start and checking if it's the end find 3 hops from start, 3 hops from end and just intersect two sets.