Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 4 . Small World Network. The Small World Network theory, first introduced by Professor Milgram in 1 9 6 7 , suggests that even
Q Small World Network. The Small World Network theory, first introduced by Professor
Milgram in suggests that even in a vast network, every part can be closely interconnected.
In this theory, Professor Milgram claimed that every person on Earth could be connected within a
maximum of degrees of separation. For instance, Prof. Choi and YOU could be connected to
each other within a maximum of steps, even if they are complete strangers to each other.
In the above illustration, where vertices represent people and edges denote friendships, all vertices
in the left graph are connected within a maximum of steps, satisfying the Small World Network
criterion. However, among the green vertices in the right graph, connections require a minimum
of steps, failing to meet the Small World Network criterion.
Doubting this theory, you may wonder whether indeed all people on Earth could be connected
within just steps. Let's create a program that verifies whether the Small World Network condition
is actually satisfied when given the friendships among all people on Earth.
points
Input:
The first line contains two integers, N and K representing the number of people
on Earth N and the count of friendships K respectively. Each person is
numbered from to N N K Ntimes N
From the second line to the Kth line, each line contains two integers, A and
B representing friendships. A B N
If A and B are friends, then B and A are also friends. There are no friendships
with oneself. Friendships between A and B are not duplicated in the input.
Output:
If the network satisfies the Small World Network criterion, print "Small World!",
otherwise, print "Big World!".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started