The Cavity Method at Zero Temperature