def save_adjacency(G, vlist, elist, filename):
    """Induce subgraph of G using input vertex and edge lists and save the
    resulting adjacency list to a file.

    Args:
        G (graph_tool.Graph): The graph instance.
        vlist (list): List of vertex indices to induce upon.
        elist (list): List of edge indices to induce upon.
        filename (str): Filepath to write adjacency.

    Returns:
        Confirmation or error message.
    """

    # get proper indices
    vp = G.new_vp('bool', vals=False)
    ep = G.new_ep('bool', vals=False)
    vp.a[vlist] = True
    ep.a[elist] = True
    G.set_vertex_filter(vp)
    G.set_edge_filter(ep)

    with open(filename, 'w') as f:
        for v in G.vertices():
            neighbors = [u for u in v.out_neighbours()]
            # First column for v; following columns are neighbors.
            # NOTE: Adjacency list is redundant for undirected graphs
            out_str = ('{} ' +
                       ('{} ' * len(neighbors))[:-1] +
                       '\n').format(v, *neighbors)
            f.write(out_str)

    return {'msg': 'Adjacency saved as {}'.format(filename)}