Question: For this assignment, define a friendship relation as a link between two persons. For example, the provided text file friends . txt lists all pairs

For this assignment, define a friendship relation as a link between two persons. For example, the provided text file friends.txt lists all pairs of movie characters who appeared together in a scene of a Star Wars movie1. We refer to any pair of characters who were listed together as friends. We can then ask queries about this set of friendship relations. For example, who is the most popular character, that is, who appeared with the most other characters? Or, for some specific character, how many others are within two degrees of separation, that is, who are friends of the characters friends? You will answer these questions with Python code, using appropriate data types to read, store and look up the given friendship relations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!