Mathematical Model and Framework for Multi-Phase Project Optimization