def build_gidx_and_mapping_graph(graph):
    """Build immutable graph index of the whole graph.

    Parameters
    ----------
    graph : GraphAdapter
        Graph

    Returns
    -------
    graph : utils.CtxCachedObject
        Function that generates a immutable graph index on given context
    edge_map : utils.CtxCachedObject
        Function that generates forward and backward edge mapping on given
        context
    nbits : int
        Number of ints needed to represent the graph
    """
    return graph.get_immutable_gidx, None, graph.bits_needed()
