SWAP algorithm for sparse regression