  This paper is devoted to Fredholm realizations of semi-Fredholm operators in
a Hilbert space. Such a realization is determined by an abstract boundary
condition, which is a subspace of the space of abstract boundary values. We
find the $K^0$ index of a family of Fredholm realizations of semi-Fredholm
operators in terms of the corresponding family of boundary conditions.
Similarly, we find the $K^1$ index of a family of self-adjoint Fredholm
extensions of symmetric semi-Fredholm operators. Our approach is based on
passing from a Fredholm operator to its graph. The graph forms a Fredholm pair
with the horizontal subspace, and we prove the index formula by deforming the
horizontal subspace instead of the operator.
