  We discuss the Douglas-Rachford algorithm to solve the feasibility problem
for two closed sets $A,B$ in $\mathbb{R}^d$. We prove its local convergence to
a fixed point when $A,B$ are finite unions of convex sets. We also show that
for more general nonconvex sets the scheme may fail to converge and start to
cycle, and may then even fail to solve the feasibility problem.
