def _map_nodes_to_int(nodes):
    """
    Return a dict mapping a list of nodes to their sorted indices. Nodes should
    be a list of strings.

    Returns:
    --------
    Dict[str, int]
    """
    sorted_node_set = sorted(set(nodes))
    name_to_id = {name: i for i, name in enumerate(sorted_node_set)}
    return name_to_id