def get_id_to_graph_index_map(object_ids, node_index, edge_index):
    """
    Get object id to graph index map
    :param object_ids: a list object ids
    :param node_index: index of each node
    :param edge_index: index of edges
    :return: a dictionary mapping object id (or pairs) to graph index
    """
    id_to_index_map = {}
    for i, ni in enumerate(node_index):
        id_to_index_map[object_ids[ni]] = i

    for i, (s, t) in enumerate(edge_index):
        id_to_index_map[(object_ids[s], object_ids[t])] = i
    return id_to_index_map