Question: C++ help PLEASE calc_similarity_scores method creates a similarity matrix for all the users in the social network. Here the definition of similarity is the number

C++ help PLEASE

calc_similarity_scores method creates a similarity matrix for all the users in the social network. Here the definition of similarity is the number of friends that any pair of users have in common Use two nested for loops to iterate over all pairs of users in the network_data. For each pair of users you can obtain their vector of friends from the network_data, and then call the function num_in_common_between_vectors (vector1,vector2), which will return an integer, num_in_common, representing the number of friends those two users have in common. The int num_in_common will need to be stored in locations [user1][user2] and [user2][user1] of the similarity_matrix. Suggestion, to iterate over all pairs of users use the following: for i in range(n): for j in range(n): # call num_in_common_between_vectors using user is vector and user js vector as arguments

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!