I have the database movies (movie_id INT, actor VARCHAR(80)) and i want to answer to this question
’Six degrees of separation’: Given two actor names, determine their ’degree of separation’, defined as 1 follows: Two actors ’A’ and ’B’ are 1-degree away if they played in at least one movie together; they are 2-degrees away if there exists an actor ’C’ who is 1-degree away from each of ’A’ and ’B’; and so on.
Do you have any idea how i can do this ?
Thank you
xxmp
0
Light Poster
Recommended Answers
Jump to PostThis seems to be not so trivial as it looks. You have to find not only some distance between two actors, but the minimum distance. This means that you have to scan all possible paths from actor1 to actor2, including the possibility that they are not connected at all.
I …
All 3 Replies
smantscheff
265
Veteran Poster
jkon
636
Posting Whiz in Training
Featured Poster
smantscheff
265
Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.