def to_solution(parameters, columns):
    """Convert a solution given as a list pairs of column indices and values to
    a solution given as a list of pairs of columns and values."""

    return [(parameters.columns[column_id], value)
            for column_id, value in columns]