Answered step by step
Verified Expert Solution
Link Copied!

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

Q4. Small World Network. The Small World Network theory, first introduced by Professor
Milgram in 1967, 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 6 degrees of separation. For instance, Prof. Choi and YOU could be connected to
each other within a maximum of 6 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 6 steps, satisfying the Small World Network
criterion. However, among the green vertices in the right graph, connections require a minimum
of 7 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 6 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.
<25 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 1 to N.(1<= N <=100,0<= K <= N\times (N-1)/2)
From the second line to the (K+1)-th line, each line contains two integers, A and
B, representing friendships. (1<= 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions