This document summarizes an algorithm for optimized cost allocation in a distributed computing system. The algorithm considers a set of tasks that need to be assigned to processors across multiple phases. It calculates execution costs, residing costs, communication costs, and reallocation costs to determine the optimal allocation that minimizes overall system costs. The algorithm is demonstrated on a sample problem involving 4 tasks to be allocated across 2 processors over 5 phases. Cost matrices are provided and the algorithm partitions the problem into subproblems to determine the lowest cost allocation for each phase and overall.