Numerical algorithms for a variational problem of the spatial segregation of reaction-diffusion systems