MINLP Optimization Algorithm for the Synthesis of Heat and Work Exchange Networks