Optimal Resource Allocation and Scheduling for the