Abstract

In real-time systems, where tasks have timing requirements, once the workload exceeds the system’s capacity, missed due dates may cause system overload. In this situation, finding an optimal scheduling that minimizes the cumulative values of late tasks is critical in both theory and practice. Recently, formalizing scheduling problems as a class of generalized problems, such as Satisfiability Modulo Theory (SMT) and Maximum Satisfiability (MaxSAT), has been receiving immense concern. Enlightened by the high efficiency of these satisfiability-based methods, this paper formulates the single-machine scheduling problem of minimizing the total weight of late tasks as a Weighted Partial Maximum (WPM) Satisfiability problem. In the formulation, scheduling features are encoded as rigidly enforced hard clauses and the scheduling objective is treated as a set of weighted soft ones. Then an off-the-shelf WPM solver is exploited to maximize the total weight of the satisfied soft clauses, provided that all the hard clauses are satisfied. Experimental results demonstrate that, compared with the existing satisfiability-based methods, the proposed method significantly improves the efficiency of identifying the optimal schedule. Moreover, we make minor changes to apply the WPM formulation to parallel-machine scheduling, showing that the proposed method is sufficiently flexible and well scalable.

1. Introduction

Real-time systems, which are designed to handle tasks with completion due dates, play an important role in a variety of modern applications, such as robotics [1], pacemakers [2], chemical plants [3], telecommunications [4], and multimedia systems [5]. Under ideal circumstances, a real-time system completes all tasks before their due dates expire. However, in reality, the workload may exceed the system’s capacity, leading to missed deadlines [6]. Such a phenomenon is called overload. A classic example is a switch in a communication network which polls its incoming links to forward packets that have arrived since its previous servicing of the link [7]. On each link, different packets may have different processing times, deadlines, and importance values. When packages flood the switch, overload happens. In this situation, designing a suitable scheduling strategy to maximize the total value of forwarded packages is critical to maintain a service’s stability.

Generally, scheduling algorithms can be classified as online scheduling and offline scheduling, depending on whether tasks’ information is known a priori. In online scheduling, the scheduler receives tasks that arrive over time and must schedule tasks without any knowledge of the future. On the contrary, offline scheduling algorithms aim at solving the problem optimally, provided that all data are known beforehand 1(note that an offline algorithm does not contradict with a real-time system. An offline scheduling algorithm allows a scheduler to make decision based on the total knowledge of the problem, while a real-time system assigns each task with a specific due date). Although online scheduling is more flexible, in many situations, it is necessary to obtain optimal schedules by offline algorithms, especially in time-critical systems or for the evaluation of heuristics [8]. In this paper, we take an interest in designing an offline scheduling method on a single machine to minimize the total weight of tasks that miss their due dates.

To date, there has been an immense amount of work devoted to characterizing scheduling problems and analyzing the complexity of problems with specific characteristics. When preemption is prohibited, Michael Moore [9] presented an optimal algorithm in polynomial time to minimize the number of late tasks on a single machine, under the assumption that all tasks are released simultaneously without dependency relations. In the standard three-field notation [10], this problem is . Adding weights on the criteria and setting precedence constraints may complicate the problem. Richard [11] showed that is binary -hard but can be solved by dynamic programming in time [12], where is the number of tasks and is the processing time of task . Garey and Johnson [13] showed that the problem of unit-time tasks subject to precedence constraints, that is, , is -hard. Furthermore, Lenstra and Rinnooy Kan [14] proved that, even for chain-like precedence constraints, where each task has at most one immediate predecessor and at most one immediate successor, the problem is also -hard. Another prevailing common knowledge is that usually preemptive problems are not harder than their nonpreemptive counterparts. For example, the problem with release dates is -hard [10], while the preemptive version can be solved in [15], where is the number of distinct release dates. Further complexity results for single-machine scheduling problems are listed by [16] and the scheduling problems with the late work criteria are surveyed by [17].

Algorithms for solving scheduling are generally classified as online scheduling and offline scheduling, depending on whether the full information about tasks is known a priori or not. Online algorithms aim to return high-quality results within reasonable CPU time [1821], whereas offline algorithms are devoted to optimally solving scheduling problems, given that all data are known beforehand. For large-scale problems that are computationally intractable, finding optimal solutions requires a significantly long computation time and heuristics are proposed to seek for suboptimal solutions within a short computation time [2224]. Nevertheless, it is still of great significance to design optimization algorithms as a testbed for suboptimal solutions and reap huge benefit when the scheduled application is executed many times [8]. Previous attempts at finding optimal solutions to single-machine scheduling problems are mainly based on dynamic programming and branch-and-bound algorithms, with promising results. For a comprehensive survey, see the work by [25]. In the last decade, formalizing scheduling problems as a class of generalized problems, such as Mathematical Programming (MP) [2631], Satisfiability Modulo Theory (SMT) [8, 3234], Boolean Satisfiability (SAT) [3537], and Partial Maximum (PM) Satisfiability [38], has received considerable attention. Motivated by the significant progress in solving these generalized problems, the formalized scheduling problem can be efficiently addressed with the corresponding solving algorithms.

As a pioneering work in satisfiability formalization, Crawford and Baker [35] first encoded scheduling problems into a SAT problem, paving the way for subsequent work [36] that solved six types of open job-shop scheduling problems. Venugopalan and Oliver [27], Liu et al. [37], and Malik et al. [8] presented optimization frameworks to address task graph scheduling with communication costs based on MIP, SAT, and SMT, respectively. Qi et al. [34] utilized task duplication strategy-based SMT formulation to mitigate the negative impact of the interprocessor communication delay in the task graph scheduling problem. Qamhan et al. [31] presented a new MILP model to schedule a set of tasks on a single-machine subject to nonzero release date, sequence-dependent setup time, and periodic maintenance. The objective of all the above formulations is to minimize the maximum completion time makespan.

To achieve the goal of minimizing the number of late jobs, Ourari et al. [26] designed a mathematical integer programming formulation for single-machine scheduling without preemption, and Hung et al. [29] developed a nonstandard MIP formulation to address the arbitrary preemptive version on parallel machines. The restricted preemptive counterpart on a single machine was solved by Cheng et al. [32], which encoded the problem as a set of first-order formulas that are tackled by an SMT solver called Z3. By running the Z3 solver repeatedly to identify the maximum number of on-time tasks, the optimal schedule could be finally determined. The SMT-based scheduling is sufficiently flexible because it handles various task properties and objectives with very few changes in adaption procedure. For example, when tasks have different importance values and the objective turns to minimizing the total weight of late tasks, only the target constraints need to be modified [33]. Later on, Wang et al. [39] enhanced Cheng’s SMT formulation by removing redundant constraints and eliminating successive calls of the Z3 solver. Experiments illustrated that the updated formulation improved the efficiency by more than two orders of magnitude. Recently, Liao et al. [38] encoded the unweighted version of the same scheduling problem into Boolean propositional logic and showed that PM solvers are a competitive alternative to SMT solvers. However, we notice that when encoding scheduling features, PM formulation generates redundant variables and clauses. Such redundancy may create extra calculations and decrease the overall performance. Furthermore, PM formulation presented in [38] is incapable of handling weighted problems where the scheduling goal is to minimize the total weight of late tasks.

In this paper, we present a Weighted Partial MaxSAT (WPM) formulation to optimally solve scheduling in overloaded situations, with the aim of minimizing the total weight value of late tasks. The minimization objective is equivalent to maximizing the total weight of the tasks meeting their due dates. Confronted with a weighted scheduling problem, we first identify scheduling features that uniquely characterize the problem, facilitating the WPM formulation in the encoding phase. Then, enlightened by the WPM characteristics that satisfy all hard clauses and maximize the total weight of the satisfied soft clauses, we recast the weighted scheduling problem as a WPM problem. Finally, in the problem-solving phase, we exploit the off-the-shelf WPM solver to satisfy all the scheduling features and maximize the total weight of tasks meeting their due dates, thus deriving the optimal schedule from the output of the WPM solver. Specifically, we make the following contributions:(i)We extend the PM formulation in [38], which was originally designed for scheduling tasks without weights, to adapt to the weighted cases.(ii)Having noticed that redundant Boolean variables and clauses exist in the previous formulation [38], we develop a more compact encoding to characterize the scheduling problem. Particularly, to denote a task’s completion time, the number of Boolean variables generated by [38] is proportional to the number of possible preemptions of the task. In contrast, the novel compact encoding generates only one Boolean variable to represent the task’s completion time, no matter how many times the task may be preempted. Theoretical analysis shows the correctness of the compact encoding and experiments demonstrate the substantial advantages over the previous PM encoding [38] and SMT formulation [39], which was enhanced from [33].(iii)In the WPM encoding, task features are encoded by several separate rules. This means if some of the task features happen to change, only partial rules need to be modified. To demonstrate the flexibility of our formulation, we extend the current WPM encoding to adapt to parallel-machine scheduling with little modification. We believe that the proposed WPM encoding can help users readily and effectively design scheduling for practical systems with low design cost.

Confronted with a weighted scheduling problem, we first identify scheduling features that uniquely characterize the problem, facilitating the WPM formulation in the encoding phase. Then, enlightened by the WPM characteristics that satisfy all hard clauses and maximize the total weight of the satisfied soft clauses, we recast the weighted scheduling problem as a WPM problem. In the WPM formulation, tasks’ features are encoded as a set of hard clauses, and the goal of completing tasks before their due dates is transformed into a set of weighted soft clauses. Finally, in the problem-solving phase, we exploit the off-the-shelf WPM solver to satisfy all the scheduling features and maximize the total weight of tasks meeting their due dates, thus deriving the optimal schedule from the output of the WPM solver.

To evaluate the performance of the proposed WPM formulation, we compare it with the state-of-the-art SMT formulation [39]. Our evaluation shows that WPM formulation has a dominant advantage over the SMT-based method in finding out the optimal schedule. We also compare WPM with the latest PM formulation [38] on a special case, where all the tasks have equal weights. We reveal redundancies in PM and discuss how they can be avoided in WPM. Experiments show that our WPM encoding is more compact and more time-efficient than PM for solving the same set of problem instances. Furthermore, we show that the presented approach is sufficiently flexible to adapt to parallel-machine scheduling problems with minor changes.

The remainder of this paper is organized as follows. The scheduling model is described in Section 2, followed by the WPM-based optimization framework in Sections 3. We make theoretical comparisons between WPM and PM formulation [38] in Section 4 and provide experimental results to show the superiority of WPM in Section 5. Section 6 exhibits how to extend the WPM formulation of single-machine scheduling to parallel-machine scheduling. Finally, we conclude this paper in Section 7.

2. Scheduling Model

We adhere to the definition of scheduling problems in previous works [33, 39]. For convenience, the notations used in the model are summarized in Table 1.

The problem involves tasks to be processed. All the tasks request a uniprocessor for execution when they arrive in the system. Each task is represented by a 4-tuple , where , , , and are all nonnegative integers 2(assuming all parameters to be integers does not make the problem less general since real numbers can be scaled to integers with a few orders of magnitude) representing the release date, the execution time, the due date, and the weight of , respectively. Naturally, . Weight reflects the importance of task . The larger is, the more important is. Given due date , if task is completed at or before , is on time and weight is obtained by the system. Otherwise, is late and worthless to the system.

To allow preemption, which indicates that a running task may be interrupted and resumed later, each task is split into nonpreemptive subtasks (fragments) and is defined as a chain of indivisible fragments . Symbol stands for the required execution time of . Clearly, . For , can only start to run after is completed.

In practical systems, tasks usually have dependency relations. For example, if task requires the computed result of , cannot start until is finished. Such a dependency relation between tasks is written as , where is the immediate predecessor of , and is the immediate successor of . Obviously, if , the constraint should be satisfied; otherwise, can never be completed no matter when its predecessor finishes. The set of task pairs that have dependency relations over is denoted by .

A system is defined as overloaded if no scheduling algorithm can meet the due dates of all the tasks that have been submitted to it. This paper focuses on designing an exact method to tackle overloaded single-machine scheduling problems. The scheduling objective is to maximize the total weight of the on-time tasks. In particular, if all tasks have equal weights, then a schedule that maximizes the total weight will be one that maximizes the number of on-time tasks.

3. WPM-Based Optimization Framework

In this section, we provide the WPM formulation for solving the task scheduling problem on a single machine. The overview of the WPM formulation is illustrated in Figure 1.

Feature preprocessing identifies the scheduling problem with two types of constraints, that is, constraints on scheduling features and those on objective. Given a set of tasks , scheduling features uniquely characterize the problem over and the objective is to seek for a schedule that completes all tasks on time subject to constraints on the scheduling features. In overloaded situations, making all the tasks complete by their due dates is impossible, and the scheduling problem is then treated as an optimization problem, which aims to maximize the total weight of tasks that are completed by their due dates. After feature preprocessing, WPM encoding can be implemented separately on the scheduling features and objective. Specifically, scheduling features, which are intrinsic and determined when tasks are released, are encoded into a set of hard clauses that should be satisfied without exception. On the other hand, the objective in overloaded situations is encoded as a set of weighted soft clauses that are allowed to be unsatisfied. By conjunction of hard clauses with weighted soft clauses, the problem turns to a WPM problem that can be addressed by any off-the-shelf WPM solver. In the problem-solving phase, a WPM solver tries to satisfy all the hard clauses and maximize the total weight of satisfied soft clauses. The output of the WPM solver includes the assignment of all Boolean variables, from which the optimal schedule can be derived.

Section 3.1 shows how to identify fragments’ critical time points to characterize the scheduling problem, paving the way for the WPM encoding described in Sections 3.2. Section 3.3 exhibits an example to show how the scheduling problem is addressed with the presented WPM encoding. Details on the problem-solving phase are also exhibited in Section 3.3.

3.1. Feature Preprocessing

Given a task set , where each task is characterized by , , cannot start before its release date . Thus, the possible Earliest Start Time (EST) of , denoted by , is equal to its release date , and the Earliest Completion Time (ECT) of , denoted by , is . , is jointly restricted by and . Specifically, if , then ; otherwise, , suggesting that should wait until is finished. Typically, let be the set of predecessors of ; then .

After for each in has been determined, EST and ECT of each fragment in can be calculated as follows:(i)Earliest Start Time (EST) of is denoted by , where . and , should start at or after , indicating that cannot be started before all its previous fragments are finished. Typically, .(ii)Earliest Completion Time (ECT) of is denoted by , where . No fragment can be completed before . Particularly, .

In addition to EST and ECT, , each fragment is characterized by the two following types of time:(i)Latest Start Time (LST) of is denoted by , where . If fails to start before , cannot end by its due date , and thus this task becomes worthless to the system.(ii)Latest Completion Time (LCT) of is denoted by , where . Particularly, .

Note that, in the above four critical time points, ECT is unrelated to our WPM encoding. Nevertheless, it is indispensable in the previous work [38], which will be discussed in Section 4..

3.2. WPM Formulation

This section introduces how to encode the scheduling problem as a WPM problem. A WPM instance consists of a number of clauses that need to be managed by the WPM solver. To formulate all the necessary constraints that characterize the scheduling model, we introduce the three following Boolean variables:(i), which is true if starts at time or later(ii), which is true if precedes (iii), which is true if ends by its due date

Based on the generated Boolean variables, the WPM encoding can be implemented. In what follows, several rules are presented to encode the features of fragments into a set of hard clauses. The main encoding is derived and enhanced from previous work [35, 36, 38]. Logical implication is equivalent to in classical logic.(i)(C1) , the first fragment of , that is, , starts at or after :(ii)(C2) and , precedes :(iii)(C3) , , and , if , , , and , and then and may require the processor at the same time. In this condition, precedes or precedes :(iv)(C4) , if fails to be completed by its due date, then cannot even start at :(v)Furthermore, if , the first fragment of cannot start until the last fragment of finishes. That is, if , then the constraint that precedes is enforced:(vi)(C5) and , if starts at or after time , then it starts at or after time :(vii)(C6) , if ends before its due date , then last fragment must start at or before time . In other words, cannot start at or after time :(viii)(C7) , , and , if starts at or after time and follows , then cannot start until is finished. That is, for each asserted by (C2)(C4), one clause is generated:where varies in and

This formula reveals the following facts: First, if ends after (i.e., ), then cannot start at or before . Second, if finishes before (i.e., ), then starts at or after . Otherwise, must start at or after time finishes, that is, .

Up to this point, we have encoded the scheduling features as Boolean formulas that can be converted to a set of clauses. Since the scheduling features are intrinsic properties inherent in the tasks and their fragments, such clauses are specified as hard, indicating that all of them must absolutely be satisfied. For convenience, we refer to the set of hard clauses introduced in (C1)(C7) as .

A task is said to be on time if and only if it is completed before its due date. Thus, the scheduling objective can be directly encoded by the following rule:

(O) Maximizing the sum of the weights of on-time tasks:

Equation (10) indicates that if clause is satisfied (i.e., evaluating to true), then weight is gained; otherwise, the gain is zero. To simplify the discussion, we introduce to denote the set of clauses in equation (10). In an overloaded system, not all tasks can be completed before their due dates. To handle such situations, we declare the clauses in to be soft, indicating that completing all the tasks by their due dates is a soft constraint. Conjunct with , the problem is then . This leads to a WPM problem, which tries to find an assignment of variables to satisfy all the hard clauses in and to maximize the sum of the weights of the satisfied soft clauses in , that is, to maximize .

3.3. A Pedagogical Example

Let us consider a simple scheduling problem to describe how WPM formulation works. As shown in Figure 2(a), there are a set of real-time tasks , where both and rely on the computed result of , represented as and ; that is, . The release dates, the execution times, the due dates, and the weights of these tasks are, respectively, defined as , , and . Suppose that has two fragments, that is, . and each have one, denoted by and , respectively. The execution time of each fragment is 1.

The refined problem exhibition and the critical time points after feature preprocessing are summarized in Figure 2(b) and Table 2, respectively. Since ECT has nothing to do with the WPM encoding, we omit this entry in Table 2 for conciseness.

The MaxSAT formulation applied to the scheduling problem is shown in Figure 3. Constraint (C1) states that each task starts at or after its EST. Constraints (C2) and (C3) work together to specify the execution sequence of the fragments. (C2) forces all the fragments in a single task to be executed sequentially, and (C3) guarantees no overlap of the execution times of any two fragments in different tasks. In the three tasks, only has more than one fragment, and hence constraint (C2) only applies to , ensuring that precedes . Constraint (C3) applies to pairs of fragments and satisfying and . If both conditions are met, then and may simultaneously occupy the processor, and thus we need to decide in what order to execute them. Constraint (C3) tackles this ordering dilemma, which states that either one can precede the other. Consider and . As seen in Table 2, and ; hence, we must explicitly specify that precedes or precedes ; otherwise, the execution time of these two fragments may overlap. Constraint (C4) applies to a situation where tasks have dependency relations. In the example, is the predecessor of both and ; thus we should give up processing and if misses its due date. In addition, given and , there is no need to explicitly specify the execution sequence of the predecessor and successors since must have finished before and start. Constraints (C5)(C7) are partially extracted from a collection of coherence conditions [35] on the introduced variables for all the fragments of all the tasks. Finally, constraint (O) gives the problem’s objective, that is, completing the last fragment of each task by its due date.

All the clauses are conjunct with to form a WPM problem in CNF, where clauses (C1)(C7) are declared hard and those in (O) are soft. Then the CNF formula is input to a WPM solver. The solver’s output includes the maximum sum of the weights of the satisfied soft clauses as well as the corresponding assignment of all the Boolean variables.

In the exemplified problem, the assigned truth values of all the Boolean variables are listed in Figure 4, from which the exact start time of each fragment can be derived. Consider . and indicate that starts at or after time 0, but it does not start at or after time 1. Then we can readily determine that starts at time 0. A similar reference can be made on , which starts at time 1. Both and can be completed by their due dates. This is ensured by and . Now, consider . Figure 4 shows that and . Since , that means that cannot start at or before . Similarly, as indicated by the fact that , cannot start at or before either. Thus, we infer that cannot finish on time. This is confirmed by . As a result, the maximized total weight of the completed on-time tasks is , achieved by completing and by their due dates.

4. Theoretical Discussion

Recall that, in the scheduling model described in Section 2, each task is represented as a 4-tuple . Consider a special case where the weights of all the tasks are equal to a constant , that is, , . According to Section 3.2, to encode this problem, a set of weighted soft clauses are introduced, where . Conjunct with hard clauses , problem becomes a special WPM problem with equal weights, which tries to find an assignment of variables to satisfy all hard clauses in and to maximize . Obviously, the essence of maximizing is equivalent to maximizing . This is a PM problem encoded by [38], where each task is modeled as a 3-tuple , and the scheduling goal is to maximize the total number of on-time tasks. In this section, we make theoretical comparisons between PM-based [38] and our WPM-based optimization frameworks when all the tasks have equal weights.

4.1. Similarities of PM and WPM Formulations

Essentially, the purpose of solving the scheduling problem is to determine the start time of each fragment to construct an optimal scheduling solution. To describe such crucial information, and , a set of Boolean variables are introduced to indicate whether starts at or after time . As long as the truth values of variables are all assigned, we can readily determine the exact start time of each fragment. To be specific, if we find a certain time such that for and for , then we can determine that the start time of is . If is constantly true when varies in , we can conclude that is late. Note that it is impossible to designate as true while making false, since if starts at or after time , must start at or after . This constraint is interpreted by rule (C5) in our encoding. In addition, and , the start time of should be at or after . Compared with PM, WPM encodes this constraint in a more concise way by (C1). We postpone the discussion later in Section 4.2.

Aside from the inherent properties of a fragment’s start time specified in (C1) and (C5), whether a fragment can start at a certain time is constrained by two other factors. The first is the execution order of the fragments, which should be explicitly pointed out in the following two situations: if two fragments belong to the same task, then they should be executed sequentially; if two fragments from different tasks may simultaneously occupy the processor, then either one can precede the other. The execution order of two fragments, and , is characterized by Boolean variable , and the constraints specified in the above two cases are interpreted by rules (C2) and (C3), respectively. If the execution order of the two fragments is determined, the relation of their start times should be specified. To be specific, if precedes , then must start after finishes. This constraint is guaranteed by rule (C7). Up to this point, all the Boolean variables and clauses introduced by PM and WPM are identical. That is, rules (C2), (C3), (C5), and (C7) are all consistent with those introduced in PM.

4.2. WPM Improvement

As mentioned in Section 4.1, and , the start time of cannot be earlier than . PM interprets this constraint by introducing one hard clause for ; thus, a total of clauses are generated for . In comparison, as described by (C1) in Section 3.2, WPM generates only one clause for each task no matter how many fragments contains. By combining (C1) with constraints (C2) and (C7), we can easily obtain for , which is the same as that declared by PM. Therefore, the updated rule (C1) reduces the number of generated clauses while maintaining the correctness of the encoding.

For tasks with dependency relations, their execution sequence may be explicitly or implicitly specified. In particular, , PM indistinguishably generates for the dependency relation . In fact, if the due date of is no later than the EST of , that is, , naturally starts after is completed; thus the constraint that is explicitly imposed on the execution sequence is unnecessary and can be omitted safely. WPM formulation refined the encoding in (C4) by introducing to interpret the constraint that precedes only when ; thus, redundant variables and clauses are eliminated.

Another factor that affects a fragment’s start time is the completion time of a task. In general, if a task is expected to be completed by a particular time, then each fragment of the task should not start later than its LST. The relation of completion time and LST is encoded by PM and WPM in different ways. In PM, for each fragment , a set of Boolean variables are introduced to indicate whether finishes at or before time . Then a set of hard clauses are generated to restrict the values of the variables.(i)(H1) If ends by , then it ends by time :(ii)(H2) if is completed by its due date, then, , should finish by :(iii)(H3) if starts at or after time , then it cannot end before time :

In fact, not all the variables and clauses in (H1)(H3) are requisite. Given a task, instead of generating variables to characterize each fragment’s completion time, it suffices to create only one variable to declare the task’s due date and introduce one clause to clarify how the task’s due date both restricts and is restricted by its start time. In particular, , WPM introduces Boolean variable to describe whether can finish by its due date. Then a constraint is set to correlate the due date and the start time of as follows: if ends by , then must start at or before . In other words, if fails to start at or before , then it cannot end by . This constraint is encoded by just one clause described in rule (C6), as declared in Section 3.2:

Theorem 1. Given task , if in PM (resp., in WPM) is evaluated as true, then for in both PM and WPM are false.

Proof. In PM, according to (H2), makes for . This indicates that, , should finish by . Combined with (H3), it can be inferred that for .
In WPM, that leads to by (C6). In addition, based on (C2) and (C7), it is clear that holds. Under the condition where , it can be immediately inferred that . By repeatedly substituting (C2) into (C7), we finally obtain for .

Theorem 2. Given task , if that makes be evaluated as true, then in PM (resp., in WPM) is false.

Proof. In PM, by (H3), makes . Combined with (H2), it is obvious that .
In WPM, we discuss the two following cases:(1)If critical , which makes , is the last fragment in , that is, , it is obvious that by (C6).(2)If , according to (C2) and (C7), we have . Since , it is clear that . The step of substituting (C2) into (C7) can be repeated until . Finally, we have . Then, by (C6), is obtained.Theorem 1 shows that if in PM (resp., ), both PM and WPM guarantee that for . Theorem 2 shows that when there exists a fragment that leads to , both PM and WPM come to the same conclusion that cannot finish by , pointed out by and in PM and WPM, respectively. Therefore, the variables introduced in PM and WPM have the same impact on the variables and vice versa. Note that, , if , a WPM solver always prefers in PM (resp., in WPM) to satisfy soft clause (resp., ). In other words, a WPM solver never prefers in PM (resp., in WPM) as long as all the hard clauses input to the solver are satisfied.

Example 1. This example shows the differences between the PM and WPM formulations when dealing with the completion time. Assume that is a task in , which contains two fragments . Each fragment has execution time 1. Table 3 shows the Boolean variables and the hard clauses introduced by PM and WPM to characterize the fragments’ completion times.
First, we can determine that , , , and . To encode , PM introduces a series of Boolean variables, and for and , respectively, representing whether each fragment is completed by time point , where for . The relation of and is specified by rule (H1). To make finish by its due date, should be completed no later than time 2. This is guaranteed by rule (H2). Finally, the relation between a fragment’s start and completion times is indicated by rule (H3). Therefore, to constrain the completion time of each fragment, six Boolean variables and eleven hard clauses are generated by PM. By contrast, WPM introduces only one variable to indicate whether is completed by its due date. Then a hard clause is generated to constrain ’s due date and its last fragment’s start time. In this way, both the Boolean variables and clauses generated by the WPM formulation are reduced.
The experimental comparison of these two encodings is demonstrated in Subsection 5.3.

5. Experiments

In this section, we scrutinize the performance comparisons of the presented WPM formulation and two satisfiability-based formulations on a set of randomly generated problems. The experimental design is described in Section 5.1, followed by the evaluation of WPM, SMT [39], and PM formulations [38] in Section 5.2 and Section 5.3. All tests were conducted on a 3.4 GHz Intel E3-1230 processor with 8 GB RAM. The selected solver to evaluate WPM and PM is QMaxSAT [40], which is a SAT-based solver using the CNF encodings of cardinality constraints. The solver for SMT is Z3 [41], which is a high-performance theorem prover chosen by the previous SMT formulations [33, 39].

5.1. Experimental Design

The procedure for generating test instances is similar to [33, 38, 39], with a variety of parameter values. Tasks’ release times are randomly generated following a discrete uniform distribution with an arriving rate , which represents the number of tasks that arrive during 100 time units. Clearly, a larger indicates that more tasks arrive in the system during a specific period of time, thus causing heavier overload. For each task , the execution time and the number of fragments in (denoted by ) are also randomly generated according to a discrete uniform distribution. The value of deadline is calculated by the formula , where is a slack factor that reflects the tightness of the due date. Weight of task is randomly chosen from 1 to in Section 5.2 and is taken as constant 1 in Section 5.3. The number of rule pairs with dependency relations is set to the total number of tasks.

We study the factors that may affect the performance of the satisfiability-based formulations. These factors include the number of tasks , the task density (determined by ), the execution time , the number of fragments , and the slack factor . In the rest of this section, we run different types of experiments to test the possible changes on these parameters. Table 4 provides a summary of the experimental design, where means the discrete uniform distribution over integer interval . For each individual scenario, 100 problem instances are generated. For each instance and solver, we set a time limit of 300 seconds. If the solver fails to output the optimal result of an instance within the time limit, we terminate the procedure and move to the next problem instance.

5.2. Comparison on Weighted Case

This subsection evaluates the behavior of WPM and SMT formulations [39] for maximizing the total weight value of on-time tasks. The main metrics for comparison include (1) the proportion of instances solved within the given time limit and (2) the average computation time spent on solved instances. The performances of these two formulations in different types of scenarios are shown in Figure 5. Each data point is the average computation time of the solved problem instances. A number with an arrow in the figures denotes the proportion of instances solved within the time limit and is omitted if the solver addresses all the 100 instances. When the proportion of the solved instances drops to zero, the corresponding curve is omitted.

As shown in Figure 5, both formulations perform worse with the increasing values of all parameters. Nevertheless, in all the varied scenarios, WPM substantially outperforms SMT in terms of both the average computation time and the proportion of successfully solved instances.

5.3. Comparison on Unweighted Case

A Partial MaxSAT (PM) formulation for optimal scheduling on a single machine was recently presented [38]. The scheduling objective tackled by PM differs from our WPM formulation in that PM aims to maximize the total number of on-time tasks, while WPM tries to maximize the total weight of the on-time tasks. When all the tasks have equal weights, these two objectives become identical, and thus formulations on these two objectives are directly comparable. In this subsection, we compare the SMT, PM, and WPM formulations on the objective of maximizing the number of on-time tasks.

The overall results with varied , , , , and are shown in Figure 6. MaxSAT encodings (both PM and WPM) solved substantially more instances than SMT within the time limit in all cases. As to the performance comparison between PM and WPM, the completion percentage of WPM is always no less than that of PM no matter how the experimental parameters change. To be specific, with the number of tasks increasing from 50 to 300, both PM and WPM solved all the instances within the time limit (Figure 6(a)). In comparison, as any of the parameters , , , and increases, WPM formulation gradually surpasses PM with more completed schedules (Figures 6(b)6(e)).

To compare the performances of PM and WPM more clearly, we provide more criteria for evaluation. The first criterion is the average runtime of PM and WPM formulations on their respective completed schedules. Note that when PM and WPM solve different numbers of instances within the time limit, the average runtime on solved instances may not clearly reflect the efficiency of these two formulations. For example, when , WPM solved more instances than PM (as shown in Figure 6(d)) and meanwhile consumed longer time on solved instances (as shown in Figure 7(a)). In this case, the average runtime is on longer the proper metric to indicate the performance. On the other hand, we notice that, in all the tested scenarios, the instances that were solved by PM could also be addressed by WPM. Therefore, we provide a secondary criterion on runtime, that is, the average runtime of WPM, in solving the same set of instances as PM solved. Furthermore, since the computation time of MaxSAT-based methods is closely related to the numbers of variables and clauses, we collect such information for reference. The comparison results are illustrated in Figures 811 . Criteria for evaluating PM and WPM are summarized as follows:(i)The average runtime of MaxSAT formulations on their respective completed schedules. The corresponding information of PM and WPM is depicted in Figures 8(a), 9(a), 10(a), 7(a), and 11(a) labeled “PM” and “WPM,” respectively.(ii)The average runtime of WPM in solving the same set of instances as PM solved. The corresponding information is depicted with label “WPM on .” If the percentages of schedules completed by PM and WPM are the same, then “WPM on ” is omitted (e.g., Figure 7(a)).(iii)The average number of variables generated by MaxSAT formulations.(iv)The average number of clauses generated by MaxSAT formulations.

Overall, the WPM formulation is more efficient than PM in both runtime criteria. The only exception appears in Figure 7(a), where the average runtime of WPM and PM on solved instances when is around 140 and 80 seconds, respectively. Although the average computation time taken by WPM is longer than that by PM, Figure 6(d) shows that WPM managed to solve 14 instances, while PM solved only 8 within the time limit. In this case, we resort to the secondary criterion on runtime. As shown in Figure 7(a), WPM consumed merely 60 seconds to solve all the instances completed by PM. Thus, it is correct to say that WPM can make a considerable improvement to the solving time. In addition, WPM achieved more compact encodings by significantly reducing the number of Boolean variables and slightly decreasing the number of clauses. In general, the computation time increases as the numbers of variables and clauses grow. This in turn explains why WPM achieves higher efficiency in our experiment.

6. Adaption for Parallel-Machine Scheduling Problem

While the WPM formulation is designed for single-machine scheduling, the encoding can be extended to parallel identical machines with minor changes. This section shows how to apply the WPM formulation to parallel identical machine scheduling problems.

The parallel-machine scheduling involves processing tasks on identical machines . Each machine can handle only one task at a time, and each task cannot be processed in parallel. Other settings of the problem are consistent with the single-machine scheduling problem described in Section 2. Given a set of tasks and that of machines , the optimization problem is not only to find a schedule that gives the start execution time of each fragment in but also a mapping for to a machine in .

To indicate on which machine a fragment is executed, , , and , we extend the single-machine scheduling formulation by introducing one more Boolean variable . if is executed by and otherwise. Correspondingly, rule (C3) in Section 3.2 is replaced with the two following additional constraints:(i)(R1) and , is allocated and executed on a single machine:(ii)(R2) , , and , if , , , and , and then and may require the processor at the same time. In this condition, precedes or precedes :

We refer to the set of hard clauses introduced in (R1) and (R2) as and rules in excluding (C3) as . Conjunct with the set of weighted soft clauses defined in Section 3.2, the problem is , which tries to find an assignment of variables to satisfy all the hard clauses in and to maximize the sum of the weights of the satisfied soft clauses in . Thereby, the parallel identical machine scheduling problem of maximizing the total weight of on-time tasks can be optimally solved with any off-the-shelf weighted Partial MaxSAT solver.

7. Conclusions and Perspective

We concentrated on a Weight Partial MaxSAT (WPM) formulation for optimal scheduling in overloaded situations. The aim is to maximize the (weighted) number of on-time tasks. Motivated by the WPM feature that distinguishes between hard clauses and weighted soft clauses, we encoded the properties of tasks as hard clauses and the goal of completing tasks on time as a set of weighted soft clauses. Then an off-the-shelf WPM solver was employed to satisfy all the hard clauses and maximize the total weight of the satisfied soft clauses. From the output of the WPM solver, the optimal schedule can be obtained.

The WPM formulation’s performance was compared with that of the recent SMT and Partial MaxSAT (PM) formulations. First, we compared the performance of WPM and SMT, demonstrating that WPM is significantly superior to SMT. Then, we considered a special case where WPM and PM formulations are directly comparable. Results indicate that the WPM formulation achieves more compact encoding and higher efficiency than PM. Finally, we applied the WPM formulation to parallel identical machines with very little modification, highlighting the flexibility and scalability of the encoding.

The restricted preemptive scheduling model considered in this paper is built upon earlier works [33, 38, 39], where each task is split into several nonpreemptive fragments, and preemptions can only take place at the fragments’ boundaries. This preemptive model with fixed points is too rigid to apply in many practical systems. Our future work is to design exact methods to adapt to variations of preemptive models. One example is to execute tasks continuously without interruption for at least a certain portion of time [4244]. Instead of splitting tasks into fragments in advance, this restricted preemptive model only guarantees the minimum “granularity” of preemption without predefined subtasks and thus is more suitable for real-world applications.

Data Availability

All the datasets are available from the corresponding author upon request.

Disclosure

This paper is an extended version of the authors’ paper published in Pacific Rim International Conference on Artificial Intelligence, Yanuca Island, Fiji, 08, 2019 (Springer).

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This research was funded by the National Natural Science Foundation of China (Grant no. 61806171) and JSPS KAKENHI (Grants nos. JP17K00307 and JP19H04175).