Exercise 6
Input data
SCENARIO 1
n = 8 # number of nodes
edges = ['8 1', '5 8', '7 3', '8 6']
SCENARIO 2
n = 4 # number of nodes
edges = ['1 2', '2 4']
Output
n= 8
edges= ['8 1', '5 8', '7 3', '8 6']
connected= {1, 3, 5, 6, 7, 8}
isolated= {2, 4}
links {'8': 3, '7': 1}
RESULT= 6 (correct)
n= 4
edges= ['1 2', '2 4']
connected= {1, 2, 4}
isolated= {3}
links {'1': 1
RESULT= 3 (correct)