Question: [ 9 4 ] : , n = 5 0 friends = graph. g e n r a n d o m f riends (
:
friends graph.riends
We can visualize the social network in a graph format:
graph.drawmatrixfriends showweightsFalse
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:
ngroupfriends
Check your answers:
How many people are in the largest friend group? Store this number as maxgroupsize
maxgroupsize
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
