Research Article

Cost-Effective Resource Provisioning for Real-Time Workflow in Cloud

Algorithm 5

Partition workflow algorithm.
(1)procedure (PartitionPath())
(2) CP ⟵ Critical Path of ;
(3)for each ti ∈ G do
(4)  if ti ∈ CP then
(5)   ti.assigned ⟵ true;
(6)  else
(7)   ti.assigned ⟵ false;
(8)  end if
(9)end for
(10)k ⟵ BD(t) where t is the first task of CP;
(11)while all of ti ∈ BL(k) with ti.assigned = true do
(12)  k ⟵ k − 1;
(13)end while
(14)t ⟵ the first ti ∈ BL(k) where ti.assigned = false;
(15) ⟵ ;
(16) ⟵ Null;
(17)while t.assigned = false do
(18)   ⟵  + {t};
(19)   ⟵  − {t};
(20)  t.assigned ⟵ true;
(21)  t′ ⟵ t;
(22)  for each tp′ ∈ Parent(t′) do
(23)   if tp′.assigned = false then
(24)    t′ = tp′;
(25)     ⟵  + {t′};
(26)     ⟵  − {t′};
(27)    t′.assigned ⟵ true;
(28)   end if
(29)  end for
(30)  t ⟵ Child(t);
(31)end while
(32)return ,
(33)end procedure