Question: [ 9 4 ] : , n = 5 0 friends = graph. g e n r a n d o m f riends (

[94]: ,n=50
friends = graph.genrandomfriends (n)
We can visualize the social network in a graph format:
graph.draw_matrix(friends, show_weights=False)
Now we need to find all the separate friend groups. Because we are defining friend groups as including "friends of friends", we just need to find the connected components!
Check your answers:
n_group_friends =41
Check your answers:
How many people are in the largest friend group? Store this number as max_group_size
max_group_size =41
[ 9 4 ] : , n = 5 0 friends = graph. g e n r a n

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 Programming Questions!