presented in Section \[PF\] in polynomial time. The main idea of the algorithm is to assign the task to a core so that the finish time of the task is closest to its deadline. If there is no enough resource, the algorithm adds an available PM with most capacity or leases a VM with best cost-performance ratio from the public cloud when there is no available PM in the local cloud. The details of the algorithm are described as follows, outlined in Algorithm 1.

  ----------------- ------------------------------------------------------------------------------------------------------------------------------------------------------
   $\mathcal{T}$:   the set of unassigned tasks, 3-tuples: (an unassigned task, its requirement of resource amount, its deadline);
   $\mathcal{C}$:   the set of available cores, 4-tuples: (a core, its capacity, the finish time of all tasks assigned to it, the PM/VM containing it);
   $\mathcal{PM}$:  the set of available PMs, 3-tuples: (an available PM, its core number, the capacity of a core);
   $\mathcal{VT}$:  the set of available VM instance types, 4-tuples: (an available VM instance type, its core number, the capacity of a core, its price per unit time);
   $\mathcal{A}$:   the set of assignments, 5-tuples: (a task, the core running it, the PM/VM containing the core, its start time).
  ----------------- ------------------------------------------------------------------------------------------------------------------------------------------------------

\

$\mathcal{T}$; $\mathcal{PM}$; $\mathcal{VT}$ $\mathcal{A}$ $pm 