Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[PYTHON] Given a connected computer network (bidirectional communication) we want to find two different nodes u and v such that we can maximize the congestion

[PYTHON] Given a connected computer network (bidirectional communication) we want to find two different nodes u and v such that we can maximize the congestion between u and v with a continuously sent virus being sent between the pair. We define the congestion level as the maximum number of edge-disjoint paths between nodes u and v. For example, the network shown in the following figure has three different paths between nodes 0 and 6 such that each edge is only part of one of the paths. Note that two paths are allowed to go through the same node, such as node 7. No other pair of nodes has a higher congestion level.

image text in transcribed

We will be given a sequence of connected computer networks each with n nodes, n 40, labeled {0, 1, ..., n1}. The last input case will be followed by a network of n = 0 nodes, which should not be processed. The specification for a computer network will be as follows: the first line contains a single non-negative value n, denoting the number of nodes. This is then followed by n lines of integers, separated by spaces, denoting the neighbors (zero indexed) of each node. Expect up to 2000 test cases.

For each input case output one integer on a line by itself denoting the maximum congestion level possible for some pair of its network nodes.

Sample Input

8

4 5 7

5 6

6 7

7

0 7

0 1

1 2 7

0 2 3 4 6

4

1 2

0 2

3 0 1

2

0

Output for Sample Input

3

2

Provide the code in python (NetworkX permitted).

6 2 1 5 7 0 3

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_2

Step: 3

blur-text-image_3

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

3. How frequently do the assessments occur?

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago