LiveJournal Connect - How It Works

LiveJournal connect is deceptively simple in its operation. In fact, my current source code is less than 400 lines when comments and multi-line prints are excluded. Here's a simple breakdown, searching from "A" to "B":

Let's look at three examples, run on 20 Feb 03: This produces the shortest chain, even if one side is continually lower, because any short-circuit is immediately obvious. We're always checking every new person looked at to every other person ever looked at on the other side. I can't think of a single instance where this makes a chain any longer than it possibly needs to be.