1 Introduction

Grid computing has emerged as an efficient approach to solving extensive problems in business, engineering, and science. In grid computing, several processing resources are integrated and connected to work together as one huge computing power to accomplish a common goal. These resources could be geographically distributed over the world, and they could have significantly different capabilities and specifications. To benefit from the grid computing capabilities, effectual scheduling algorithms are primarily essential. Grid scheduling is an activity that assigns and manages the execution of related tasks on distributed resources. The main challenge in grid scheduling is how to distribute interdependent tasks to the available resources, taking into account the quality of service (QoS) time, and cost available to the user. For workflow processing systems, time denotes the overall time needed for finishing the workflow execution; while cost denotes the cost linked to the workflow execution incorporating grid resources usage charge for processing workflow tasks and the workflow systems management cost. The algorithms for scheduling inter-dependent tasks utilize DAGs (directed acyclic graphs) to model tasks dependency.

Grid scheduling is an NP-complete problem as the computational grid comprises resources that are heterogeneous and reside in different administrative regions, which employ distinctive management rules. GAs (genetic algorithms) [1] belong to the metaheuristic algorithms, which have been successfully applied to deal with NP-complete problems.

This paper presents a proposed GA-based approach for scheduling workflow tasks on grid services based on users’ QoS constraints in terms of time and cost. It is called Grid Workflow Tasks Scheduling Algorithm (GWTSA). The input to GWTSA is the set of workflow tasks, the dependencies between them, and the time limit (deadline) stated by the user for the execution of the workflow. The output of GWTSA is an optimal schedule for all workflow tasks that minimizes the execution time and cost, such that the scheduled time be within the deadline imposed by the user. In this approach, a DAG is used to represent the dependency between the workflow tasks. The DAG is divided, then the optimal sub-schedules of all task divisions are computed and used to obtain the execution schedule of the entire workflow. A GA-based technique is employed in GWTSA to compute the optimal execution sub-schedule for each branch division that consists of a set of sequential tasks. In this technique, the fitness function is formulated as a multi-objective function of time and cost, and each chromosome represents the tasks included in a branch division, where each gene holds the id of the service provider chosen to execute the corresponding task in the branch.

The next sections of this paper are as follows: Sect. 2 presents related work; Sect. 3 presents the problem description; Sect. 4 describes the proposed QoS-based grid workflow tasks scheduling approach GWTSA; Sect. 5 presents a case study to illustrate the working of GWTSA; Sect. 6 exhibits the experimental results; and Sect. 7 presents the conclusion and future work.

2 Related work

Several research studies have been proposed that used heuristic and metaheuristic algorithms to address the problem of scheduling tasks in computational grids. This section gives a review of examples of such studies.

2.1 Metaheuristics-based approaches

Aggarwal et al. [2] have presented a scheduler based on a GA for computational grids. It minimizes makespan, the available resources idle time, and turn-around time while satisfying the deadlines specified by users. Yu and Buyya [3] have proposed a GA-based workflow scheduling approach with budget constraints. It aims to minimize execution time while satisfying a specified processing budget. Yu and Buyya [4] have presented a GA-based workflow scheduling approach with two QoS constraints, deadline and budget. Chen et al. [5] have proposed a grid scheduling approach that combines a discrete PSO (particle swarm optimization) with the SA (simulated annealing) method, aiming to minimize the grid cost, which comprises communication and computing costs. Bouali et al. [6] have proposed a hybrid approach between the heterogeneous earliest finish time (HEFT) heuristic and PSO, to minimize the overall competition time of all tasks in the DAG. Jiang and Chen [7] have presented TSGA genetic algorithm for task scheduling that divides the search space into random patterns to check out the search space to minimize the execution time. Gabaldon et al. [8] have proposed a PSO-based approach for scheduling parallel jobs containing cooperating tasks, which aimed to minimize energy consumption. Gabaldon et al. [9] have proposed a hybrid PSO-GA metaheuristic approach for solving the resource matching and scheduling of parallel jobs that contain collaborative tasks in heterogeneous multi-cluster systems, which aimed to minimize both makespan and energy consumption. Younis and Yang [10] have proposed two hybrid metaheuristic schedulers. The first scheduler combines ant colony optimization and variable neighborhood search (VNS), while the second one merges the GA with VNS, with the aim of minimizing the makespan. Ghosh et al. [11] have proposed a hybrid GA-PSO algorithm for grid job scheduling, which aimed to reduce the schedule makespan and flowtime. Chhabra et al. [12] have proposed a multi-objective hybrid scheduling algorithm that combines cuckoo search and firefly algorithm for scheduling offline workload of parallel jobs with collaborative tasks in high-performance computing grid systems to optimize both energy-efficiency and QoS-aware performance expectations. Ankita and Sahana [13] have used the shortest job first to generate guided initial population in the proposed GA-based scheduling approach. Bose et al. [14] have proposed a scheduling approach named Pro-GA for scheduling bag-of-tasks jobs in multi-core heterogeneous computing systems to minimize the makespan, resource utilization, and speedup ratio. Ankita and Sahana [15] introduced a PSO-based scheduling algorithm called Ba-PSO that is designed to allocate jobs to appropriate resources, resulting in a significant reduction in job completion time. Yousif [16] presented a novel approach that is utilizing the firefly algorithm and the smallest position value (SPV) technique to significantly improve scheduling efficiency, leading to reduced makespan times compared to alternative methods like Tabu search.

2.2 Heuristics-based approaches

Yu et al. [17] have proposed an algorithm for QoS-based workflow scheduling, which minimizes the execution cost while satisfying the deadline. This algorithm utilizes an approach based on Markov decision process to schedule the execution of sequential workflow tasks. Benedict and Vasudevan [18] have proposed a grid scheduling approach that uses Tabu search method, for obtaining better computational grid schedules, with two objectives: maximizing the job completion ratio and minimizing the grid scheduler overhead to choose the precise workflow sequence. Meddeber and Yagoubi [19] have presented a dependent task allocation approach for grids, which divides a given task graph into a set of linked components to decrease, if possible, the average execution time of submitted tasks, and to reduce communication costs while respecting the dependency between tasks constraints. Bahnasawy et al. [20] have presented an algorithm for scheduling distributed heterogeneous computing systems. The algorithm divides the given DAG into levels based on the precedency relationships and sorts each level task descendingly according to their computation sizes, then the tasks are selected from that level in order. Bidgoli and Nezad [21] have proposed a scheduling algorithm, GCDM, for grid computing to minimize the final cost of implementation tasks, taking into account the data transfer cost between different tasks and their inter-dependencies that are modeled as a DAG. Hossam et al. [22] have proposed the algorithm WS-GCDM (WorkStealing-Grid Cost Dependency Matrix), which is an enhancement of GCDM [21]. It balances task scheduling among the available grid resources, while GCDM utilizes a certain number of grid resources irrespective of the number of available resources. Rahman et al. [21] have presented a dynamic and adaptive workflow scheduling algorithm based on critical path (CP) for grid computing, which dynamically and efficiently maps tasks of the workflow to grid resources by determining, at every step, the CP in the workflow graph. They, also, outlined a hybrid heuristic that merges the presented adaptive scheduling technique features with metaheuristics to obtain optimal execution time and cost while satisfying the users' requirements. Chauhan and Nitin [24] have proposed an entirely decentralized P2P algorithm for grid scheduling that schedules subtasks of DAG tasks, taking into account three factors: subtasks computation and communication costs, and the subtask waiting time caused by predecessors and precedence constraints. Garg and Singh [25] have proposed an adaptive approach based on a rescheduling method for scheduling workflow-dependent tasks on the dynamic grid resources. It initially performs static scheduling, followed by resource monitoring, then rescheduling to minimize the execution time for workflow applications.

3 Problem description and system model

Workflow application tasks in a grid computing system can be modeled as a DAG, which is represented with two sets (T, E), where T = {Ti, i = 1... n} denotes a set of n tasks, while E denotes the set of directed edges between tasks, where an edge (Ti, Tk) represents the dependency of task Tk on task Ti, which means that task Ti must be completed before scheduling task Tk. Task Ti is referred to as task Tk’s parent, and task Tk is referred to as task Ti’s child. Assuming D is the user’s provided deadline (time constraint) for the workflow execution, then the workflow application can be expressed as G (T, E, D). In the DAG, an entry task is a task that has no parent tasks and is referred to as Tentry, and an exit task is a task that has no child tasks and is referred to as Texit.

In a grid computing system, there are a set of service types, where diverse service providers can support each service type. Let m be the number of available services. Each task Ti has a set of services \({S}_{i}^{j}\) (1 ≤ i ≤ n, 1 ≤ j ≤ mi, mi ≤ m) that can execute this task, but only one of these services is chosen to execute the task. The processing capabilities of services vary and are provided at different prices. In general, there is an inverse proportion between the service price and the processing time [17]. The service price and time for executing task Ti on service \({S}_{i}^{j}\) are denoted by \({c}_{i}^{j}{\text{and}}\) \({t}_{i}^{j}\), respectively.

The scheduling problem is to assign every task Ti to a service \({S}_{i}^{j}\) to minimize the execution time and cost, such that the execution of the workflow is completed within the user’s provided deadline while taking into account tasks precedence constraints.

4 Scheduling methodology: the proposed QoS-based grid workflow tasks scheduling approach

In this work, the following steps are performed to solve the scheduling problem:

  • Step 1: Detect available services, and choose available service providers for each task according to the QoS parameters of services specified by the user.

  • Step 2: Cluster tasks of the workflow into task divisions.

  • Step 3: Distribute the user’s provided deadline (referred to as the specified deadline) on task divisions.

  • Step 4: Compute optimal sub-schedules for individual task divisions by using a GA-based strategy, then use these sub-schedules to generate an optimal schedule for the entire workflow.

The following subsections provide a detailed description of these steps.

4.1 Service detection and QoS request

Providing details of QoS for every available service is important for efficient workflow tasks scheduling. As Fig. 1 illustrates, the WMS (Workflow Management System) first sends a query to the GIS (Grid Information Service), which has knowledge of all registered grid services providers, to detect services, which are suitable for processing every task of the workflow user. Each query specifies the parameters of the task, estimated execution time, and workflow user. The GIS, in turn, replies with an available services list for every task. Then, the WMS sends a QoS request to these services to obtain their processing price and time for providing the service with the required QoS level.

Fig. 1
figure 1

Service detection and QoS request

4.2 Workflow DAG dividing

Workflow DAG dividing process starts by categorizing workflow tasks in G into simple tasks or synchronization tasks [17]. A synchronization task is one that has many parent tasks and/or child tasks, while a simple task is one which has at most one child and/or parent task. For example, in Fig. 2a, the 1st, 10th, and 14th tasks are synchronization tasks, while the remaining tasks are simple tasks. Then, the workflow tasks in G are divided into independent branches B and synchronization tasks Y, which leads to minimizing the size of G making it more simple thus containing less number of nodes. Let P be a set of nodes representing a set of task divisions Pi, 1 ≤ i ≤ nY + nB, where nY and nB are the total numbers of synchronization tasks and workflow branches, respectively. Assume E' is the set of directed edges, where each edge takes the form (Pi, Pj) with Pi as a parent of Pj. Then, the divided graph can be described as G'(P, E', D). Figure 2b shows the DAG of Fig. 2a after dividing. For example, in this figure, the sequence of tasks T2, T3, and T4 forms a branch division. A simple path in G' is a task division sequence that includes a directed edge from each task division in it to its successor, where the path task divisions are not repeated. The DAG_Dividing algorithm is shown in Fig. 3.

Fig. 2
figure 2

An example of workflow DAG dividing [13]

Fig. 3
figure 3

DAG dividing algorithm

Each task division Pi has four attributes: deadline (dl[Pi]), expected execution time (eet[Pi]), start time (start_time[Pi]), and minimum execution time (met[Pi]). If Pi is a branch, then its earliest start time is the earliest start time of the 1st task in it, and is calculated according to the deadlines of its parent divisions as follows:

$${\text{start}}\_{\text{time}}\left[{P}_{i}\right]=\underset{{P}_{j}\in {\mathit{PP}}_{i}}{{\text{max}}}{\text{d}}l\left[{P}_{j}\right]$$
(1)

where PPi is the set of Pi’s parent task divisions. The Pi’s minimum execution time is calculated as follows:

$${\text{met}}\left[{P}_{i}\right]=\sum_{{T}_{x}\in {P}_{i}}\underset{1\le y\le {m}_{x}}{{\text{min}}}{t}_{x}^{y}$$
(2)

The Expected execution time of Pi is calculated as follows:

$$ {\text{eet}}\left[ {P_{i} } \right] \, = {\text{ d}}l\left[ {P_{i} } \right] \, {-}{\text{ start}}\_{\text{time}}\left[ {P_{i} } \right] $$
(3)

4.3 Deadline distribution

Having divided the workflow graph G, the specified deadline, D, is distributed on the G′ task divisions, such that the deadline dl[Pi] allocated to each task division Pi is a sub-deadline of D.

Following are the deadline distribution rules: [17]

  • R1: The total sub-deadline of any path from a synchronization task Yi to another synchronization task Yj must be the same.

  • R2: Any path from Pi to Pj, where Tentry ∈ Pi and TexitPj, have a total sub-deadline equal to D.

  • R3: A sub-deadline allocated to any task division Pi must be greater than or equal to met(Pi).

  • R4: The specified deadline, D, is distributed over task divisions in proportion to their met.

These deadline distribution rules are implemented on the task division graph by using BFS (Breadth-First Search) algorithm and DFS (Depth-First Search) algorithm to calculate, for each task division, start time and sub-deadline. The deadline distribution algorithm is shown in Fig. 4.

Fig. 4
figure 4

Deadline distribution algorithm

4.4 Generation of an optimal schedule and fitness function

Once the sub-deadline of a task division is determined, an optimal sub-schedule for this task division can be obtained. If the obtained optimal sub-schedules for all task divisions ensure that the execution of these task divisions can be completed within their sub-deadlines, the entire workflow execution will be finished within the specified deadline. Also, minimizing the costs for all task divisions leads to reaching an optimal cost for the whole workflow. Thus, by combining all optimal sub-schedules, an optimized workflow schedule can be easily obtained. The scheduling solutions for the two task division types: synchronization task and branch division, as well as the overall Grid Workflow Tasks Scheduling Algorithm (GWTSA), are described below.

4.4.1 Scheduling the synchronization tasks

Synchronization task scheduling (STS) is a single-task scheduling problem. The optimal solution for such a problem can be simply obtained by selecting the service with the lowest cost which is able to execute the synchronization task within its allocated sub-deadline. Thus, for scheduling a synchronization task Yi, the objective function is as follows:

$$ \min c_{i}^{k} ,\,{\text{where}}\,\,1 \le k \le m_{i} ,\,\,{\text{and}}\,\,t_{i}^{k} \le {\text{ eet}}(Y_{i} ) $$
(4)

4.4.2 Branch division scheduling

If a branch division contains only one simple task, the solution for the branch division scheduling (BDS) is the same as STS. But, if a branch contains multiple tasks, a GA is used to get an optimal solution according to the evaluation of a fitness function. Here, the optimal solution is to minimize the branch execution time and cost, with the condition that the optimized time be within its allocated sub-deadline. Thus, the objective function to be minimized to obtain an optimal sub-schedule for branch Bj can be represented as a weighted sum that combines the following two objectives:

$$ \min \,{\text{cost}}\left( {B_{j} } \right)\,{\text{and}}\,\min \,{\text{ time}}\left( {B_{j} } \right),{\text{such}}\,{\text{that}}\,{\text{time}}(B_{j} )\, \le \,{\text{eet}}(B_{j} ) $$

where

$${\text{cost}}({B}_{j}) = \sum_{{T}_{i}\in {B}_{j}}{c}_{i}^{k}$$
(5)
$${\text{time}}({B}_{j}) = \sum_{{T}_{i}\in {B}_{j}}{t}_{i}^{k}$$
(6)

and 1 \(\le k\le {m}_{i}\).

That is, the objective function is formulated as follows:

$$ F\left( {B_{j} } \right) \, = \, w_{1} \;cost\left( {B_{j} } \right) \, + \, w_{2} \;time\left( {B_{j} } \right) $$
(7)

where w1 and w2 are weighting coefficients with value ≥ 0 and ≤ 1, which satisfy the condition w1 + w2 = 1. This objective function F will be the fitness function used by the proposed GA. This gives users the ability to control the workflow schedule by choosing weighting parameters to set an order of preference for time and cost objectives according to their needs. For example, if a user prefers to accomplish his workflow tasks as quickly as possible, regardless of the cost, then the optimal value for w1 is one and zero for w2, and vice versa. The weighting coefficients can be set proportionally to achieve the increase or decrease in the time and cost calculation of the flow process, when w1 = 0.2, w2 = 0.8, that is, the user prefers to reduce the cost against the time.

4.5 The proposed GA-based branch division scheduling (BDSGA) algorithm

A GA is a powerful search technique that applies the evolution principle to derive, in polynomial time, a good solution from a big search space. A GA merges the exploration of new areas of the solution space with the exploitation of the best solutions obtained from previous searches.

Genetic algorithms offer several advantages for task scheduling in grid computing systems, including optimization, flexibility, scalability, robustness, and efficiency.

Optimization: Genetic algorithms can optimize the scheduling of tasks by selecting an optimal or suboptimal scheduling of jobs. This can lead to better resource utilization and improved system performance.

Flexibility: Genetic algorithms are flexible and can be adapted to different scheduling scenarios. This means that they can be used in a variety of grid computing environments and can handle different types of tasks and resources.

Scalability: Genetic algorithms can handle large-scale scheduling problems [26]. This is important in grid computing systems, which typically involve a large number of tasks and resources.

Robustness: Genetic algorithms are robust and can handle noisy and incomplete data. This is important in real-world grid computing systems, which may have incomplete or inaccurate information about tasks and resources.

Efficiency: Genetic algorithms can be computationally efficient, especially when compared to exhaustive search methods [27]. This means that they can find good solutions to scheduling problems in a reasonable amount of time.

The problem search space solutions are represented by the population of chromosomes (individuals). A fitness function is used to determine the quality of a chromosome in the population. An individual’s fitness value signifies how good this individual is among other individuals in the population.

The main steps of any GA are as follows:

  1. 1.

    Randomly generate pop_size solutions to form the initial population.

  2. 2.

    Set current population = initial population.

  3. 3.

    Calculate the fitness values of all chromosomes in the current population.

  4. 4.

    Create a new population by repeating the following steps:

    • From the current population, select two chromosomes as parents.

    • With a certain probability, perform crossover on the parents to form a new offspring. In the case where no crossover is performed, offspring will be the same as their parents.

    • With a certain probability, perform mutation on the new offspring.

    • Add new offspring to the new population.

  5. 5.

    Set current population = new population.

  6. 6.

    Check the stopping condition. If it is not met, go to Step 3; otherwise, stop and return the best solution.

Solving the BDS problem by using a GA requires the determination of the chromosome representation, the initial population, the genetic operators (selection, crossover, and mutation), and a suitable fitness function. The proposed GA’s components are presented below.

4.5.1 BDS problem representation and initial population

In the proposed GA-based branch division scheduling (BDSGA) algorithm, for each branch in G′, we build a population of individuals that represents possible solutions for branch division scheduling on available service providers that satisfy the QoS constraints and specified deadline.

Each branch consists of a number of tasks, and each task has its service providers. So, the proposed branch chromosome representation is a one-dimension list consisting of a number of genes corresponding to the branch tasks, and each task Ti in the branch is accompanied by a list of service providers, spli, capable of executing this task. A gene gi that corresponds to a task Ti in the chromosome holds the id of a service provider, chosen from spli, to execute this task. Figure 5 shows an encoding for a branch B that consists of r tasks, T1, T2, …, Tk, …, Tr, where gk \(\in \) [1, mk], and mk is the number of services capable of executing task Tk.

Fig. 5
figure 5

Chromosome representation of branch B

For example, the following chromosome represents the branch that consists of tasks T2, T3, and T4, in Fig. 1, and indicates that these tasks will be executed on services with ids 1, 3, and 2, respectively.

T2

T3

T4

1

3

2

Each individual in the initial population for each branch consists of a random set of providers that are capable of executing each task in the branch. The chromosome representing branch B must satisfy the condition:

$$\sum_{{T}_{i}\in B}{t}_{i}^{k}\le {\text{eet}}(B)$$
(8)

According to the fitness function for each individual, new offspring is generated by using the genetic operators (selection, crossover, and mutation), in turn, then each individual’s fitness in the branch population is evaluated until the algorithm converges. We keep the best schedule for each branch division in G′. Then, these best schedules are used, with the best schedules of synchronization tasks, by the proposed Grid Workflow Tasks Scheduling Algorithm (GWTSA) to obtain the best schedule for the whole DAG (workflow tasks).

4.5.2 The fitness function and selection

Based on the considered optimization objective, a fitness function is utilized to assess the quality of the population individuals. The scheduling goal here is to optimize the grid system performance in terms of cost and time for each division, as explained above. Therefore, in BDSGA, the fitness function is the multi-objective function defined by Eq. (7).

4.5.3 The genetic operators

Genetic operations are applied to the current population individuals to create new individuals. Individuals that have better fitness values have a better chance to provide one or more offspring in the following generations. The three genetic operators, selection, crossover, and mutation, used in BDSGA, are described below.

4.5.3.1 Selection operation

In the selection stage of a GA, chromosomes are chosen from a population for crossover. In BDSGA, the roulette wheel selection method [1] is used to select the parents to be mated in the crossover operation.

4.5.3.2 Crossover

In the crossover operation, two parents (chromosomes) generate new offspring by swapping portions of their genetic information. Over time, better populations are generated by mixing genetic information from couples of fitter individuals from the previous population. In BDSGA, a one-point crossover operator is used. The crossover operation is performed according to a specified crossover rate (Xr). This rate represents the percentage of offspring generated through crossover in each iteration to the size of the population. In one-point crossover, one random crossover point is chosen, then genes (providers’ ids) between this point and the chromosome end in the two parent chromosomes are exchanged. Figure 6 shows an example of a one-point crossover operation. In this example, child1 takes the service id for task T1 from parent1 and the service ids for tasks T2, T3, and T4 from parent2, while child2 takes the service id for task T1 from parent2 and the service ids for task T2, T3, and T4 from parent1.

Fig. 6
figure 6

Example of applying the crossover operator

4.5.3.3 Mutation

Mutation aims to find new points in the search space in order to maintain population diversity. It is performed on a gene-by-gene basis. In BDSGA, the mutation is performed by randomly choosing a gene with a certain mutation rate (Mr), then replacing the id value in it with another id value from the remaining providers’ ids that can execute the corresponding task. An example illustrating the mutation operation is shown in Fig. 7.

Fig. 7
figure 7

An example illustrating the mutation operation

4.5.4 Overall BDSGA algorithm

The BDSGA algorithm is given in Fig. 8. The inputs to BDSGA are a branch B, list of service providers spli of each task Ti in B (see Fig. 5), the dl(B) (deadline of branch B), pop_size (population size), Max_Gen (maximum number of generations), Xr (crossover rate), Mr (mutation rate), and the weights w1 and w2 of the fitness function. In steps 1–3, BDSGA sets the number of generations counter No_of_Gens to 0, then generates the initial population consisting of pop_size chromosomes, where the genes of each chromosome are populated by service providers' ids randomly selected from the list of service providers of the corresponding tasks. Then, in steps 4–6, it calculates the schedule (time and cost) of each chromosome, according to providers’ ids placed in its genes, using the procedure ComputeBranchSchedule(), shown in Fig. 9. In step 8, these schedules are used to evaluate the fitness of each chromosome, using Eq. (7), and the best chromosome is saved. Next, steps 9–18 include a While loop, in which the steps of generating a new population, evaluating it, and keeping the best chromosome are repeated until No_of_Gens reaches Max_Gen. Finally, the best chromosome (best schedule for branch B) is returned.

Fig. 8
figure 8

The proposed GA-based branch division scheduling algorithm (BDSGA)

Fig. 9
figure 9

The proposed procedure for computing a branch schedule

4.5.5 Decoding

After obtaining the best chromosome, which represents the best schedule for the given branch B, it is decoded in order to set the start and end times for each task composing that chromosome. This decoding process is performed by applying the procedure Compute_Branch_Schedule(), shown in Fig. 9. It uses the provider's id placed in each gene to get the time and price provided by this provider for the corresponding task. Next, the procedure calculates the best execution cost and time for the whole branch by summing the prices and times of all tasks in B, using Eq. (5) and Eq. (6), respectively.

4.6 Overall grid workflow tasks scheduling algorithm (GWTSA)

The proposed Grid Workflow Tasks Scheduling Algorithm (GWTSA) is described in this section. It schedules the tasks of a workflow on grid services based on users’ QoS constraints. Figure 10 shows the flowchart of the proposed GWTSA, and Fig. 11 shows its procedural details. As shown in Fig. 11, the input to GWTSA is the workflow graph G (T, E, D), where T = {Ti, i = 1... n} denotes the workflow tasks set, E denotes the set of edges connecting tasks, and D denotes the user’s provided deadline for the execution of the workflow. The output of GWTSA is an optimal schedule for all workflow tasks, which minimizes both time and cost of workflow execution, such that the optimized time be within the specified deadline. The algorithm starts by requesting processing times and prices from available grid services for all workflow tasks. Then, it divides workflow tasks into independent branches (sequences of simple tasks) and synchronization tasks, by using the DAG_Dividing algorithm, shown in Fig. 3, generating a reduced graph G′(P, E', D), where P denotes the divisions (branches and synchronization tasks) set, and E' denotes the set of directed edges between divisions in G'. Then, it uses the deadline assignment algorithm, Deadline_Distributing, shown in Fig. 4, to distribute the overall deadline D over each division. Finally, GWTSA generates the execution schedule for the entire workflow by using the optimal sub-schedules of task divisions. If a task division is a branch, its optimal schedule is obtained using BDSGA, as described in Sec. 4.5; otherwise, STS is used, as described in Sec. 4.4.1. If a task division has one or more child divisions, then the procedure HandleChildDivision() is called to compute their schedules.

Fig. 10
figure 10

Flowchart of the proposed GWTSA

Fig. 11
figure 11

The proposed GWTSA

4.7 Complexity analysis

The complexity of different parts of the GWTSA algorithm:

Task Graph Division (DAG_Dividing): The complexity of this part depends on the size of the original task graph. If there are N tasks in the graph, and each task is examined once, the complexity would be O(N).

Deadline Distribution (Deadline_Distributing): This part involves traversing possible paths in the graph and performing calculations for each division. The complexity can be influenced by the number of paths and divisions. If there are M divisions and P paths, the complexity can be around O(M * P).

Division Scheduling (Queue Q and HandleChildDivision): The complexity of this part depends on th genetic algorithm (GA), the complexity of each GA operation (e.g., crossover and mutation) could be O(G * P), where G is the number of generations, and P is the population size. If there are K divisions to be scheduled, and each division undergoes GA-based scheduling, the overall complexity could be O(K * G * P).

Queue Handling (While loop in HandleChildDivision): This part involves handling the queue of divisions to be scheduled. The complexity here depends on the number of divisions and their relationships. If there are L divisions in the queue, the complexity would be O(L)

Overall, the complexity of the proposed GWTSA algorithm largely depends on the number of task divisions (K), the total number of generations (G), and (P) the population size.

5 A case study using GWTSA

To illustrate the working of the proposed grid scheduling approach, GWTSA, it was applied to the workflow modeled by the DAG given in Fig. 2 (adapted from [17]), which consists of 14 tasks. So, 14 service types were simulated, with a number of diverse service providers supporting each service type. Table 1 shows, for each task, the QoS attributes of providers that will provide the same service type needed for processing this task. These attributes are: provider id, processing time (sec), and cost ($). We assumed that the required deadline (DL) is 350 s.

Table 1 QoS attributes (provider id, processing time in sec, and cost in $) of services of different providers for executing the tasks of the example workflow

The inputs to GWTSA were:

  • The specified deadline D;

  • The GA parameters: pop_size, Max_Gen, Mr, Xr, w1, and w2;

  • A file containing the edges of the DAG of the example workflow: 1–2, 1–5, 1–7, 1–8, 2–3, 3–4, 4–14, 5–6, 6–14, 7–10, 10–11, 11–14, 10–12, 12–13, 13–14, 8–9, 9–10; and

  • A file containing the service providers’ information is shown in Table 1.

The outputs produced by GWTSA were:

  • A file containing the divisions of the example workflow DAG, with their types, is shown in Table 2.

  • A file containing the scheduled start and end times for each task with its service provider id, as shown in Table 3. Note that each provider id is prefixed with the corresponding task number to differentiate between providers of different tasks that have the same id. For example, 3:1 refers to the provider with id 1 of task 3, and 5:1 refers to provider with id 1 of task 5

  • A file containing the scheduled start and end times for each division, as shown in Table 4.

  • Resultant the best schedule time: 161 s and the best cost: $ 175.

Table 2 The divisions of the example workflow DAG, with their types (Y: synchronization and B: branch)
Table 3 The scheduled start and end times for each task with its service provider id
Table 4 The scheduled start and end times for each division

6 Experimental results

Two types of experiments have been carried out to assess GWTSA performance. In the first type of experiment, three workflows of 11, 14, and 25 tasks were used. For each task in each workflow, a different service type with diverse service providers was simulated.

6.1 Comparative scheduling algorithms

GWTSA was applied to the three workflows, with different deadlines, and the results were compared with three other scheduling algorithms, namely, Greedy-Time (GT) [17], Greedy-Cost (GC) [17], and Modified Greedy-Cost (MGC). For processing each task, GC chooses the lowest-cost service, whereas GT chooses the quickest service. MGC searches for the lowest-cost service for processing each task within the required deadline. The evaluation criteria were the execution cost and time constraint. The first criterion shows the workflow tasks scheduling costs on the utilized service grid, while the second one shows whether the scheduling approach has generated a schedule that satisfies the specified deadline. Table 5 shows some characteristics of the proposed algorithm and other scheduling algorithms. For each deadline value, we have run GWTSA ten times and calculated the average of the best time and cost values generated. The GA parameters used were: pop_size = 10, Max_Gen = 50, Xr = 0.70, Mr = 0.01, and w1 = w2 = 0.5. The algorithms were implemented using C# and run on TOSHIBA-Lap Intel(R) Core™ i5-2430 M CPU, 2.4 GHz, 4 GB RAM.

Table 5 Characteristics of comparative baseline algorithms

6.2 Comparative results

Figures 12, 13, and 14 show comparisons between the results of applying the four scheduling algorithms on the three workflows in terms of execution times and costs. Figures 12a, 13a, and 14a show that the expected execution time for the three workflows using GWTSA and MGC increases as the deadline is relaxed. For the first workflow (11 tasks), the expected execution time using GWTSA is lower than MGC. For the second workflow (14 tasks), the expected execution time using GWTSA is lower than MGC, except for some deadline values in the middle. For the third workflow (25 tasks), the expected execution times using GWTSA and MGC are too close with lower deadlines, but GWTSA generates lower execution times with higher deadlines. The workflow execution time using the GC algorithm is higher and cannot meet the required deadline when it is low. The GT generates a lower execution time than the other three algorithms.

Fig. 12
figure 12

Expected execution time (a) and cost (b) for the workflow of 11 tasks using the four scheduling algorithms

Fig. 13
figure 13

Expected execution time (a) and cost (b) for the workflow of 14 tasks using the four scheduling algorithms

Fig. 14
figure 14

Expected execution time (a) and cost (b) for the workflow of 25 tasks using the four scheduling algorithms

As shown in Figs. 12b, 13b, and 14b, for the three workflows, the execution cost using the GT algorithm is higher, but when using GWTSA and MGC, it is reduced as the deadline is relaxed. For the first two workflows (11 and 14 tasks), the execution cost using MGC is lower than GWTSA, while for the third workflow (25 tasks), the execution costs using GWTSA and MGC are too close with lower deadlines, but MGC generates lower execution costs with higher deadlines. The GC generates a lower execution cost than the other three algorithms.

As can be seen from these results, GWTSA tries to optimize both the execution time and cost, the MGC algorithm tries to minimize the cost while keeping the execution time within the required deadline, whereas the GT and GC algorithms try to minimize the execution time and cost, respectively.

In the second type of experiment, we have studied the effect of varying the weighting coefficients, w1 and w2, of the BDSGA objective function (Eq. 7). We have applied GWTSA to the workflow of 14 tasks with DL = 350 s and different values for w1, and w2, where w1 + w2 = 1. Figure 15 shows the effect of varying w1 and w2 on the behavior of the objective function F and the expected execution time and cost. It shows that F reached its minimum at two points (w1 = 0, w2 = 1) and (w1 = 1, w2 = 0) while reaching its maximum at the point (w1 = 0.6, w2 = 0.4). It also shows that increasing the time weighting coefficient (w1) while decreasing the cost weighting coefficient (w2), gives more emphasis to the time minimization, whereas increasing w2 while decreasing w1, gives more emphasis to the cost minimization. This means that the optimal schedule varies with the weighting coefficients. So, users can control the workflow schedule by choosing weighting coefficients to assign a preference order to the time and cost objectives.

Fig. 15
figure 15

The effect of varying the weighting coefficients, w1 and w2, of the BDSGA objective function, on the objective function F and expected execution time and cost

6.3 Reasons for optimal performance of the proposed GWTSA

  • The problem of scheduling workflow tasks on grid is formulated as a problem of multi-objective optimization, where the execution time and cost are minimized, such that the optimized time be within the deadline imposed by the user.

  • It employs a GA-based technique to compute the optimal execution sub-schedule for each set of sequential tasks, represented by a branch division in the workflow DAG.

  • This technique uses a novel chromosome representation, in which the chromosome represents a branch division, where each gene holds the id of the service provider, chosen from the list of service providers capable of executing the corresponding task in the branch; and the fitness function is formulated as a multi-objective function of time and cost.

  • The optimal sub-schedules of all task divisions are used to obtain the execution schedule of the entire workflow.

7 Conclusion

This paper presented a proposed GA-based approach, GWTSA, for scheduling workflow tasks on grid services based on users’ QoS constraints in terms of time and cost. For a given inter-dependent set of workflow tasks, GWTSA generates an optimal schedule, which minimizes the execution time and cost, such that the optimized time be within the deadline imposed by the user. In this approach, a DAG is used to represent the dependency between the workflow tasks. The DAG is divided, then the optimal sub-schedules of task divisions are computed and utilized to generate the schedule for executing the entire workflow. A GA-based technique is employed in GWTSA to compute the optimal execution sub-schedule for each branch division, which consists of a set of sequential tasks.

Experiments have been carried out to assess GWTSA’s performance. The results were compared with three other scheduling algorithms: GC, GT, and MGC. The results indicated that GWTSA tries to optimize both the execution time and cost; the MGC algorithm tries to minimize the cost while keeping the execution time within the required deadline; whereas the GT and GC algorithms try to minimize the execution time and cost, respectively.

We have also studied the effect of varying the weighting coefficients, w1 and w2, of the BDSGA objective function. The results indicated that the optimal schedule varies with the weighting coefficients. So, users can control the workflow schedule by choosing weighting coefficients to assign a preference order to the time and cost objectives.

In the future work, we intend to modify the proposed workflow scheduler GWTSA to consider resource dynamics, such that the schedule is adapted and updated during scheduling according to these dynamics. We also intend to augment BDSGA with a heuristic algorithm, such as simulated annealing (SA), to improve the optimal execution schedule it produces for each branch division.