I have a large graph of say, Person, and the relations between them are FRIEND.
Given a couple of Persons, say 3 or 4 of them, I want to find all paths between all of them of length 4, and I just want simple paths.
That is, say the persons are A, B and C. Then I want a path of length at most 4 between A and B, having at least one node in common with a path from A to C and a path from B to C.. or one could say i want the graph of persons connected to all of A, B and C with at most a certain distance..
I have been looking at the graph algorithms and stuff, and spanningTree would give me one path between all of them, and between any given pair of Persons there are path finding algorithms, but cant figure out a good way to do it for 4 Persons..
Any great suggestions? :)