<jupyter_start><jupyter_text>1. (1/1)<jupyter_code>g = nx.Graph()
g.add_edges_from(
    [
        ('A','B'), ('A','C'), ('A','D'), ('A','E'), ('A','F'),
        ('B','C'), ('B','F'), ('C','D'), ('C','F'),
        ('D','E'), ('D','F'),
        ('E','F')
    ]
)
nx.draw_networkx(g)
nx.clustering(g, 'F')<jupyter_output><empty_output><jupyter_text>2. (1/1) Graph **A** has higher average LCC but lower trasitivity then graph **B**  3. (1/1)<jupyter_code>g = nx.Graph()
g.add_edges_from(
    [
        ('A','B'), ('A','C'),
        ('B','D'),
        ('C','D'), ('C','E'),
        ('D','E'), ('D','G'),
        ('E','G'),
        ('G','F')
    ]
)
nx.draw_networkx(g)
nx.radius(g)
nx.diameter(g)
g_noG = g.copy()
g_noG.remove_node('G')
nx.draw_networkx(g_noG)
nx.is_connected(g_noG)
t = nx.bfs_tree(g, 'A')
nx.draw_networkx(t)
nx.center(g)
nx.periphery(g)
nx.eccentricity(g)<jupyter_output><empty_output><jupyter_text>4. (1/1)<jupyter_code>g = nx.Graph()
g.add_edges_from(
    [
        ('A','C'), ('A','D'), ('C','G'), ('G','E'), ('D','E'),
        ('D','B'), ('D','H'), ('E','H'), ('B','H'), ('H','F'),
        ('I','J'), ('I', 'K')
    ]
)
nx.draw_networkx(g)
nx.is_connected(g)
nx.number_connected_components(g)
g_noEG = g.copy()
g_noEG.remove_edge('E', 'G')
nx.number_connected_components(g_noEG)
nx.draw_networkx(g_noEG)
nx.clustering(g, 'I'), nx.clustering(g, 'J'), nx.clustering(g, 'K'), 
g.add_edge('E', 'J')
nx.is_connected(g)<jupyter_output><empty_output><jupyter_text>5. (0/1)<jupyter_code>g1 = nx.MultiDiGraph()
g2 = nx.MultiDiGraph()
g3 = nx.MultiDiGraph()
g1.add_edges_from(
    [
        ('A','B'), ('A','C'),
        ('B','C'), ('C','B'),
        ('D','C'), ('E','B'),
    ]
)
g2.add_edges_from(
    [
        ('A','D'), ('A','B'), ('B','A'), ('B','C'),
        ('A','C'), ('C','A'), ('D','E'), ('E','C')
    ]
)
g3.add_edges_from(
    [
        ('A','C'), ('B','A'), ('A','D'), ('C','B')
    ]
)
nx.draw_networkx(g1, nx.kamada_kawai_layout(g1))
nx.draw_networkx(g2, nx.kamada_kawai_layout(g2))
nx.draw_networkx(g3, nx.kamada_kawai_layout(g3))
(nx.is_strongly_connected(g1),
 nx.is_strongly_connected(g2),
 nx.is_strongly_connected(g3))
g1_str = g1.copy()
g1_str.add_edge('C', 'D')
nx.is_strongly_connected(g1_str)
nx.draw_networkx(g1_str, nx.kamada_kawai_layout(g1_str))
nx.draw_networkx(g2, nx.kamada_kawai_layout(g2))
nx.node_connectivity(g2), nx.minimum_node_cut(g2)
nx.edge_connectivity(g2), nx.minimum_edge_cut(g2)
g3_str = g3.copy()
g3.add_edge('D', 'A')
nx.is_strongly_connected(g3_str)
# More then one edge is needed
nx.draw_networkx(g3_str, nx.kamada_kawai_layout(g3_str))<jupyter_output><empty_output><jupyter_text>6. (1/1) [x] The closures of an airport (...)[x] Network robustness measures (...)[x] Adding edges can never (...)  7. (1/1)<jupyter_code>g = nx.Graph()
g.add_edges_from(
    [
        ('A','B'), ('A','C'), ('A','F'),
        ('B','C'), ('B','D'), ('B','E'),
        ('C','E'), ('C','F'), 
        ('D','E'),
        ('E','F'), ('E','G'), ('E','H'), 
        ('G','H'), ('G','K'), ('G','M'),
        ('H','M'), ('H','N'), 
        ('K','M'), ('K','N')
    ]
)
nx.average_clustering(g), nx .transitivity(g)
nx.node_connectivity(g)<jupyter_output><empty_output><jupyter_text>8. (1/1)<jupyter_code>nx.edge_connectivity(g)
nx.edge_connectivity(g), nx.minimum_edge_cut(g)
nx.node_connectivity(g), nx.minimum_node_cut(g)<jupyter_output><empty_output><jupyter_text>9. (1/1)<jupyter_code>g = nx.DiGraph()
g.add_edges_from(
    [
        ('D','A'), ('D','B'), ('B','A'),
        ('A','C'), ('C','E'), ('C','B'),
        ('E','F'), ('E','H'), ('J','E'),
        ('H','J'), ('H','K'), ('K','J'), 
        ('F','H'), ('F','K'), ('F','G'),
        ('G','K')
    ]
)
len(sorted(nx.all_simple_paths(g, 'D', 'K')))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.29909766454352443, 'fraction_numerical': 0.01592356687898089, 'mean_word_length': 4.346099290780142, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '416560', 'license': 'MIT', 'n_tokens_mistral': 1764, 'n_tokens_neox': 1730, 'n_words': 226, 'path': 'socialNetAnalysis/w2/quiz.ipynb', 'repo_name': 'htbrandao/applied-social-network-analysis-in-python', 'size': '3768'}