Commit a2d60e2e authored by Victor Zimmermann's avatar Victor Zimmermann
Browse files

Update absinth.py

parent adf4c815
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -725,9 +725,21 @@ def draw_propagation(graph: nx.Graph, root_hub_list: list) -> None:

    pos = nx.spring_layout(graph, scale=3)
    
    mapping = {node:graph.node[node]['sense'] for node in graph.nodes}
    nodes = set
    for root1 in root_hub_list:
        for root2 in root_hub_list:
            path = nx.shortest_path(graph, root1, root2)
            for node in path:
                nodes.add(node)
                
    nx.draw_networkx_edges(graph, pos, alpha=0.4)
    edges = [edge for edge in graph.edges if edge[0] in nodes and edge[1] in nodes]
    

    mapping = {node:graph.node[node]['sense'] for node in nodes}

    nx.draw_networkx_edges(graph, pos,
                           alpha=0.5,
                           edgelist=edges)

    nx.draw_networkx_nodes(graph, pos,
                           nodelist=list(mapping.keys()),