def _make_strahler_dicts(G):
    """Prepare dictionaries for the Strahler algorithm"""
    nodes_per_arc = {}
    arcs_per_node = {}

    for edge_id, edge in enumerate(G.edges()):
        nodes_per_arc[edge_id] = edge

        for node in G.nodes():
            if node in edge:
                if node in arcs_per_node:
                    arcs_per_node[node].append(edge_id)
                else:
                    arcs_per_node[node] = [edge_id]

    return nodes_per_arc, arcs_per_node