I'm just learning graph theory and I'm trying to write the code to an algorithm problem. The problem involves n group of people, each of them has at least one mutual friendship with one of the members. The problem is to find the shortest friendship link between two people. The shortest friendship link contains the fewest number of people. For example; A and B are mutual friends and B and C are mutual friends, if A and C are also mutual friends then A-C and A-B-C are friendship links between A and C but A-C is considered shorter because it involves lesser individuals.
I would like to know which graph theory algorithm(s) applies in this case and I would appreciate any recommendation of a good free internet documentation on graph theory (other than wiki).