The design of algorithms is both an art and a science.