INTRODUCTION

The main distinguishing feature of real-time computing systems is that each application module must be executed in a strictly specified time interval and completed no later than a predetermined deadline. Such systems are widely used in various fields of human activity. For example, during the design, testing, and operation of complex technical objects (airplanes, rockets, power plants), during development work, in civil and military construction, when assessing mineral reserves in deposits, when processing large amounts of information, during the design and operation of transport and conveyor systems, and in many other areas. In this case, one of the main tasks is to distribute the computer system’s resources between software modules and build the optimal schedule for their execution. A large number of publications study algorithms for solving such problems. Here we note fundamental works such as [13], in which the authors study various formulations (drawing schedules with interruptions and switching from one processor to another and without interruptions, tasks for performance and meeting deadlines, construction of uniprocessor and multiprocessor schedules). In [3], NP-hard problems of performance and minimization of the maximum time offset for one and several devices are studied. A new approach to find approximate solutions is proposed. In [4, 5], a technique for constructing optimal schedules in problems with nonfixed parameters (durations, consumed resources) is considered. The technique is based on the use of the branch-and-bound method and the construction of polyhedra of the solution’s stability. In [68], a technique was developed for checking the fulfillment of real-time constraints, which consist in the fact that each job must be performed within the given guideline interval. Research was carried out for a multicore real-time computing system and was based on the construction of a simulation model using generalized finite state machines with a timer stop. Using this model, a timing diagram of the system’s operation is constructed, allowing for direct verification of compliance with real-time constraints. In [8], a pseudopolynomial algorithm for solving the problem was proposed, which constructs a schedule that is optimal in terms of performance for executing tasks with logical precedence conditions. In this problem, each job is given a list of its immediate predecessors and the number of completed immediate predecessors required to begin executing it. The problem is reduced to a cyclic game. In [9, 10], some work scheduling problems are reduced to minimax problems.

The publications mentioned above study the distribution of renewable resources (processors, machines, actuators, devices, workers), i.e., resources that can be used repeatedly. A number of publications examine issues of the distribution of nonrenewable resources (finance, fuel, electricity, various materials, computer RAM assigned to certain software modules). Unlike renewable resources, nonrenewable resources cannot be reused. In relation to this, we note the works [11, 12], in which it is assumed that the duration of tasks linearly depends on the size of the resource allocated to them. In [13], a problem with mixed types of resources—renewable and nonrenewable—was studied. We consider the problem of creating an admissible schedule with interruptions in a multiprocessor system in the case where policy intervals are specified, processors can have arbitrary performance, there are several types of nonrenewable resources, and the duration of work execution linearly depends on the amount of the resources allocated to them. Polynomial algorithms are constructed based on reducing the original problem to a flow problem in a network of a special type.

Fig. 1.
figure 1

Streaming network G to find an admissible schedule.

We note some interesting articles on planning in industrial production. In [14], the authors explored a methodology for the joint planning of production capacity development and scheduling taking into account market opportunities, and also detailed an integrated production capacity planning model with several discrete and continuous variants for changing short-term and medium-term capacity and developed a heuristic algorithm based on the reduction of the initial problems to a nonlinear mixed integer problem. In [15], some issues in the field of production planning and control are presented, and a hierarchical architecture for production planning and control is developed. In [16] a two-tier single-product storage system in which a regional center replenishes orders from several independent local distribution centers over a set period of time is presented. The developed model determines the values of the product’s price, required replenishment time, and required delivery time that maximize the expected system-wide profit for the given period, taking into account product storage costs and fixed equipment costs.

In [17] a problem in which scheduling is carried out in two stages is studied: first, the sequence of activities is determined, then idle time is inserted into the schedule to minimize the sum of early and late costs. The sequence of activities is determined using a heuristic method, and the task of inserting idle time is solved using linear programming to set the start and end times of activities. In [18] the task of planning lead times is presented and the trade-offs that should be taken into account when setting these deadlines are also identified. A model is proposed to show how the scheduled execution time of an operation depends on the stochastic variability of the resource requirements for that operation, as well as the resource utilization related to that operation. In [19] the task of scheduling and routing two robots that deliver products to specific locations is described. The problem of minimizing the time required to complete all operations and return the robots to their original position is solved. The problem is proved to be NP-hard. The solution is based on the use of integer linear programming and genetic algorithm, as well as dynamic programming to evaluate the quality of the solutions.

This paper studies the computation scheduling problem on a multiprocessor system under the following assumptions. At the given points in time, requests are received to perform sets of work with known durations and target intervals. Interrupts and switches from one processor to another are allowed. Two formulations of the problem are considered. In each of them, the moments at which requests arrive are known in advance. However, in the first setting, the composition of all complexes and the characteristics of the work are also known in advance, and therefore, in this case, the execution of all tasks can be planned before the first request arrives. In the second formulation, the composition of task sets and their characteristics become known only at the time of receipt of each request. Then it is possible to plan the execution of the work only after receiving the corresponding request, i.e., in real time. In both settings, it is necessary to determine whether there is an acceptable schedule for the entire set of work packages and construct it in the case of a positive answer. The problem is also considered for the case when, in addition to processors, the jobs use a nonrenewable resource. In this case, the duration of a task is a decreasing function of the amount of the nonrenewable resource allocated to it. Unlike [13], this function is not expected to be linear. The solution to the problem is based on constructing a network flow model and searching for the maximum flow.

1. PROBLEM STATEMENT

At moments in time \({{\tau }_{k}}\) requests to complete K packages of work (tasks) are received: Wk = \(\{ w_{k}^{1},~w_{k}^{2},~ \ldots ,~w_{k}^{{{{r}_{k}}}}\} \), \(k = \overline {1,~K} \), \({{\tau }_{1}} < {{\tau }_{2}} < \ldots < ~\,\,{{\tau }_{K}}\). To do this, in each interval \(\left[ {{{\tau }_{k}},~{{\tau }_{{k + 1}}}} \right]\), mk processors are available (\({{\tau }_{{K + 1}}}\) is the point in time after which these processors cannot be used). All the processors are identical. Every task \(w_{k}^{i}\) has the following characteristics: \([b_{k}^{i},~c_{k}^{i}]\) is the guideline interval (work \(w_{k}^{i}\) can only be executed in this interval), \(b_{k}^{i} \geqslant \) \({{\tau }_{k}}\), \(t_{k}^{i}\) is its duration, and \(t_{k}^{i} \leqslant c_{k}^{i} - b_{k}^{i}\), i \( = \overline {1,~{{r}_{k}}} \). When executing the tasks, interruptions and switching from one processor to another are allowed, which, by assumption, do not require time. In addition, parallel execution of one task by several processors and simultaneous execution of several jobs by one processor are not allowed.

Two formulations of the problem are considered. In each of them, moments \({{\tau }_{k}}\) are known in advance. However, in the first formulation, the composition of all complexes Wk and the characteristics of the works included in them are also known in advance. Therefore, in this case, it is possible to schedule the work of all tasks up to the point in time \({{\tau }_{1}}\). In the second setting, the composition of the set of tasks Wk and their characteristics become known only at the moment \({{\tau }_{k}}\). Then, the work Wk can only be planned after receiving the corresponding request, which arrives at the moment \({{\tau }_{k}}\), i.e., in real time.

In both settings, it is necessary to determine whether there is an acceptable schedule for the entire set of works

$$W = \bigcup\limits_{k = 1}^K {{{W}_{k}}} $$

(i.e., a schedule in which each task is executed in its own guideline interval) and build it in the case of a positive answer. It is assumed that the operating time of the scheduling algorithm itself can be neglected in both cases.

The solution to the problem is based on constructing a network flow model and searching for the maximum flow. Therefore, the next section describes one of the most effective streaming algorithms, whose modification will be used to construct the schedule.

2. BRIEF DESCRIPTION OF A POLYNOMIAL ALGORITHM FOR FINDING THE MAXIMUM FLOW IN A NETWORK

Given the network \(G = \left( {V,~A} \right)\), V is the set of peaks, u is the source, \({v}\) is the drain, \(u,~{v} \in V\), A is the set of oriented arcs, and \(U\left( {a,b} \right)\) is the throughput of arc \(\left( {a,b} \right) \in A\). The following polynomial algorithm for finding the maximum flow in the network G is proposed in [20].

Step 1. Select f as the initial zero thread , i.e., put \(f\left( {a,~b} \right) = 0\) for all \(\left( {a,b} \right) \in A.\)

Step 2. Build the residual network \(G\left( f \right) = \left( {V,~A\left( f \right)} \right)\):

if \(f\left( {a,~b} \right) < U\left( {a,~b} \right)\), then include arc \(\left( {a,~b} \right)\) with bandwidth \(U\left( {a,~b} \right) - f\left( {a,~b} \right)\) in \(A\left( f \right)\); and if \(f\left( {a,~b} \right) > 0\), then include arc \(\left( {b,~a} \right)\) with bandwidth \(f\left( {a,~b} \right)\) in \(A\left( f \right)\).

Step 3. If in the network \(G\left( f \right)\) there is no direct path from u to \({v}\), then f is the maximum flow; and the algorithm is completed. Otherwise, go to step 4.

Step 4. Build a layered network \(G{\text{*}}\left( f \right) = \left( {V{\text{*}}\left( f \right),~A{\text{*}}\left( f \right)} \right)\). It contains all the shortest oriented paths from u to \({v}\).

Step 5. Find a dead-end flow g in the network \(G{\text{*}}\left( f \right)\). (A dead-end flow is a flow with respect to which there is no direct increasing path.)

Step 5.1. Define node \({{a}_{0}} \in V{\text{*}}\left( f \right)\) with the minimal throughput. (The capacity of a node is the minimum of the maximum amount of the flow that can enter that node and the maximum amount of the flow that can leave it.)

Step 5.2. “Push” out maximum possible flow from node \({{a}_{0}}\) to the left up to source u and to the right all the way to drain \({v}\). The resulting flows along the arcs determine flow g.

Step 5.3. Remove from network \(G{\text{*}}\left( f \right)\) node \({{a}_{0}}\) and all other nodes with zero residual capacity, arcs incident to these nodes, all fully saturated arcs, the resulting “hanging” nodes (if any), and all arcs incident to them.

Step 5.4. If there is a path from u and \({v}\) in the rest of the network \(G{\text{*}}\left( f \right)\), then go to step 5.1. Otherwise a dead-end flow g is built in the network \(G{\text{*}}\left( f \right)\).

Step 6. Correct the flow f in the network G:

if arc \(\left( {a,~b} \right) \in A\) corresponds to arc \(\left( {a,~b} \right) \in A{\text{*}}\left( f \right)\), then put \(f\left( {a,~b} \right) = f\left( {a,~b} \right) + ~g\left( {a,~b} \right)\); if arc \(\left( {a,~b} \right) \in A\) corresponds to arc \(\left( {b,~a} \right) \in A{\text{*}}\left( f \right)\), then put \(f\left( {a,~b} \right) = f\left( {a,~b} \right)\,\, - ~\,\,g\left( {b,~a} \right)\). Go to step 2.

The computational complexity of the described algorithm is \(O\left( {{{{\left| V \right|}}^{3}}} \right)\).

3. BRIEF DESCRIPTION OF THE ALGORITHM BY V.S. TANAEV FOR CONSTRUCTING AN ADMISSIBLE SCHEDULE

The further study of the problem is based on the use of the algorithm of V.S. Tanaev for constructing an admissible multiprocessor schedule with interruptions and switchings [1]. Let us give a brief description of this algorithm for the task formulated in Section 1 at K = 1. We will assume that in this case the set of jobs \(W = \left\{ {{{w}_{1}},~{{w}_{2}},~ \ldots ,~{{w}_{n}}} \right\}\), their duration is \({{t}_{i}}\), guideline intervals are \(\left[ {{{b}_{i}},~{{c}_{i}}} \right]\), and m is the number of identical processors.

Assume \({{y}_{0}} < {{y}_{1}} < \ldots < {{y}_{p}}\) are all different quantities \({{b}_{i}},~{{c}_{i}}\), \(i = \overline {1,~n} \), \({{I}_{j}} = \left[ {{{y}_{{j - 1}}},~{{y}_{j}}} \right],\) \({{\delta }_{j}} = {{y}_{j}} - {{y}_{{j - 1}}},\) \(j = \overline {1,~p} \). A streaming network \(G = \left( {V,~A} \right)\) (see figure) is being built, where \(V = \left\{ {u,~{{I}_{j}},~{{w}_{i}},~{v}} \right\}~\) is the set of peaks, u is the source, v is the drain, and \(A = \{ \left( {u,~{{I}_{j}}} \right),~~\left( {{{I}_{j}},~{{w}_{i}}} \right),~\)(\({{w}_{i}},~{v})\} \) is the set of oriented arcs. Arc \(\left( {{{I}_{j}},~{{w}_{i}}} \right)\) is entered in the network if \({{I}_{j}} \subseteq \left[ {{{b}_{i}},~{{c}_{i}}} \right]\). Note that for all j and i either \({{I}_{j}} \subseteq \left[ {{{b}_{i}},~{{c}_{i}}} \right]\) or \({{I}_{j}} \cap \left[ {{{b}_{i}},~{{c}_{i}}} \right] = \emptyset \). Bandwidths U of the arcs are defined as follows: \(U\left( {u,~{{I}_{j}}} \right) = m{{\delta }_{j}}\), \(U\left( {{{I}_{j}},~{{w}_{i}}} \right) = ~\,\,{{\delta }_{j}}\), and \(U\)(\({{w}_{i}},~{v}) = {{t}_{i}}\).

It was proved in [1] that an admissible schedule exists if and only if the maximum flow f of network G saturates all output arcs (\({{w}_{i}},~{v})\), i.e., when \(f\left( {{{w}_{i}},~{v}} \right) = {{t}_{i}}\) for all \(i = \overline {1,~n} \). Magnitude \(f\left( {{{I}_{j}},~{{w}_{i}}} \right)\) is equal to the CPU time allocated to job \({{w}_{i}}\) in the interval Ij. To construct an admissible schedule, in each interval Ij, apply the packing algorithm [1], whose computational complexity is \(O\left( n \right)\). To find the maximum flow in network G, we can use the polynomial algorithm described in Section 2. Since \(p \leqslant 2n\), the computational complexity of Tanaev’s algorithm in this case is \(O({{n}^{3}})\).

4. CONSTRUCTION OF A SCHEDULE FOR THE CASE WHEN INFORMATION ABOUT SETS W k, k = \(\overline {1,~K} \), ARRIVES UNTIL τ1

Let us consider the case when the composition of all sets Wk and characteristics of the works included in them are known in advance (i.e., before the moment of time \({{\tau }_{1}}\)). In this case, we can create a schedule for the entire set of tasks W even before requests for work Wk are received at moments in time \({{\tau }_{k}}\) (i.e., until the point in time \({{\tau }_{1}}\)).

Assume \(y_{k}^{j}\) are all different quantities \({{\tau }_{k}}\), \(b_{k}^{i}\), and \(c_{k}^{i}\), \(k = \overline {1,~K} ,\) \(i = \overline {1,~{{r}_{k}}} \). Further, as in Section 3, intervals \(I_{k}^{j}\) and streaming network \({{G}_{k}} = \left( {{{V}_{k}},~{{A}_{k}}} \right)\) are determined, where \({{V}_{k}} = \left\{ {u,~{v},~I_{k}^{j},~w_{k}^{i},~~j = \overline {1,~{{p}_{k}}} } \right\}\) is the set of nodes, u is the source, \({v}\) is the drain, and \({{A}_{k}} = \{ (u,I_{k}^{j}),(I_{k}^{j},w_{k}^{i}),(w_{k}^{i},{v})\} \) is the set of oriented arcs. Arc \(\left( {I_{k}^{j},~w_{k}^{i}} \right)\) is introduced into the network \({{G}_{k}}\) if \(I_{k}^{j} \subseteq [b_{k}^{i}\), \(c_{k}^{i}]\).

Further, to solve the question of the existence and construction of an admissible schedule, an algorithm similar to the one described in Section 3 can be used. The computational complexity of the algorithm is

$$O\left( {{{{\left( {\mathop \sum \limits_{k = 1}^K {{r}_{k}}} \right)}}^{3}}} \right).$$

5. CONSTRUCTION OF A SCHEDULE FOR THE CASE WHEN INFORMATION ABOUT THE SET W k ARRIVES AT THE MOMENT τk, k = \(\overline {1,K} \)

The case is considered when the moments \({{\tau }_{k}}\) of the receipt of requests for work Wk are known in advance, and the composition of each set Wk and the characteristics of the tasks included in it become known only at the moment \({{\tau }_{k}}\). First, we consider the problem of constructing a schedule for \({{W}_{1}}\).

5.1. Constructing a Network Model and Making an Admissible Schedule for W1

Assume \(y_{1}^{0} < y_{1}^{1} < \ldots < y_{1}^{{{{p}_{1}}}}\) are all the different quantities among \({{\tau }_{1}},\) \({{\tau }_{2}}\), \(b_{1}^{i}\), \(c_{1}^{i}\), \(i = \overline {1,~{{r}_{1}}} \), belonging to the interval \(\left[ {{{\tau }_{1}},~{{\tau }_{2}}} \right]\). We define the intervals \(I_{1}^{j} = [y_{1}^{{j - 1}},~y_{1}^{j}]\), \(j = \overline {1,~{{p}_{1}}} \), and network \({{G}_{1}} = \left( {{{V}_{1}},~{{A}_{1}}} \right)\), where \({{V}_{1}} = \left\{ {u,{v},~I_{1}^{j},~~w_{1}^{i}} \right\},\) and the set of oriented arcs A1 and their throughputs \({{U}_{1}}\left( {i,~j} \right)\) are determined analogously to how it was done in Section 3 at \(m = {{m}_{1}}\), \(n = {{r}_{1}}\).

When finding the maximum flow f1 in the network \({{G}_{1}}\), the following modification of the algorithm described in Section 2 is used. When pushing the flow from the peak \(I_{1}^{j}\) to the right (step 5.2, Section 2), the arcs \((I_{1}^{j},~w_{1}^{i})\) should be used first for works \(w_{1}^{i}\) for which \(c_{1}^{i} \leqslant {{\tau }_{2}}\). This is because such jobs can only be executed within the interval \(\left[ {{{\tau }_{1}},~{{\tau }_{2}}} \right]\), and for works with a deadline longer than \({{\tau }_{2}}\), the CPU time can be allocated even after the moment \({{\tau }_{2}}\).

The quantity of the flow \({{f}_{1}}(I_{1}^{j},~w_{1}^{i})\) is equal to the amount of the CPU time allocated to job \(w_{1}^{i}\) in interval \(I_{1}^{j}\). The schedule in interval \(I_{1}^{j}\) is built using a packing algorithm.

If for at least one job \(w_{1}^{i}\) with deadline \(c_{1}^{i} \leqslant {{\tau }_{2}}\), it turned out that \({{f}_{1}}\left( {w_{1}^{i},{v}} \right) < t_{1}^{i}\) (i.e., arc \(\left( {w_{1}^{i},{v}} \right)\) is not completely saturated), then the admissible schedule for W1, and, therefore, for the entire set of tasks W does not exist. In the case \({{f}_{1}}\left( {w_{1}^{i},{v}} \right) = t_{1}^{i}\) for all works \(w_{1}^{i}\) with deadline \(c_{1}^{i} \leqslant {{\tau }_{2}}\), the construction of an admissible schedule will continue at moment \({{\tau }_{2}}\) for unfinished works from \({{W}_{1}}\) (if any) and newly received works from \({{W}_{2}}\).

5.2. Constructing a Network Model and Making Admissible Schedules for \({{W}_{1}} \cup \,\, \ldots \,\,~ \cup \,{{W}_{k}},~k = \overline {2,~K} \)

We assume that we have built a streaming network \({{G}_{{k - 1}}},~k = \overline {2,~K} ~\), and the maximum flow \({{f}_{{k - 1}}}\) is found in it. If for at least one job \(w_{r}^{i},~r = \overline {2,~k - 1} \), for which \(c_{r}^{i} \leqslant {{\tau }_{k}}\), after finding the maximum flow \({{f}_{{k - 1}}}\) in the network \({{G}_{{k - 1}}}\), it turned out that \({{f}_{{k - 1}}}\left( {w_{r}^{i},~{v}} \right) < t_{r}^{i}\), i.e., arc \(\left( {w_{r}^{i},~{v}} \right)\) is not completely saturated, then the admissible schedule for \({{W}_{1}} \cup \,\, \ldots \,\,~ \cup \,\,{{W}_{{k - 1}}}\), and, therefore, for the entire complex W does not exist. If \({{f}_{{k - 1}}}\left( {w_{r}^{i},~{v}} \right) = t_{r}^{i}\) for all arcs \(\left( {w_{r}^{i},~{v}} \right)\), \(r = \overline {1,~k - 1} \), for which \(c_{r}^{i} \leqslant {{\tau }_{{k - 1}}}\), then constructing an admissible schedule for W continues at the moment \({{\tau }_{k}}\) for unfinished works from the set \({{W}_{1}} \cup \,\, \ldots \,\,~ \cup {{W}_{{k - 1}}}\) (if any) and newly received tasks from \({{W}_{k}}\).

Assume \(y_{k}^{0} < y_{k}^{1} < \ldots < y_{k}^{{{{p}_{k}}}}\) are all different quantities \({{\tau }_{k}},\) \({{\tau }_{{k + 1}}}\), \(b_{k}^{i}\), \(c_{k}^{i}\), \(i = \overline {1,~{{r}_{k}}} \). We define the intervals \(I_{k}^{j} = \left[ {y_{k}^{{j - 1}},~y_{k}^{j}} \right]\) and assume \(\delta _{k}^{j} = y_{k}^{j} - ~y_{k}^{{j - 1}}~\). From the network \({{G}_{{k - 1}}}\), we remove the following elements:

—nodes \(I_{{k - 1}}^{j}\), \(j = \overline {1,~{{p}_{{k - 1}}}} \), and all the arcs incident to them \(\left( {u,~I_{{k - 1}}^{j}} \right)\), \(\left( {I_{{k - 1}}^{j},~w_{{k - 1}}^{i}} \right)\), \(j = \overline {1,~{{p}_{k}}} \), \(i = \overline {1,~{{r}_{{k - 1}}}} \);

—nodes \(w_{z}^{i}\) for which

$${{f}_{{k - 1}}}\left( {w_{z}^{i},~{v}} \right) = t_{z}^{i}$$
(5.1)

and the corresponding arcs \(\left( {w_{z}^{i},~{v}} \right)\), \(z = \overline {1,~k - 1} \), \(i = \overline {1,~{{r}_{z}}} \) (since the fulfillment of condition (5.1) means the completion of work \(w_{z}^{i}\)).

Next, the duration of each remaining job \(w_{z}^{i}\) decreases by the amount of the flow \({{f}_{{k - 1}}}\left( {w_{z}^{i},~{v}} \right)\) along the arc \(\left( {w_{z}^{i},{v}} \right)\). Network \({{G}_{k}}\) is built from the remaining nonremote part of the network \({{G}_{{k - 1}}}\) by adding to it nodes \(I_{k}^{j}\), \(w_{k}^{i}\) and arcs \(\left( {I_{k}^{j},~w_{z}^{i}} \right)\), \(j = \overline {1,~{{p}_{k}}} \), \(i = \overline {1,~{{r}_{z}}} \), \(z = \overline {1,~k} \), \(\left( {w_{k}^{i},~{v}} \right)\), \(i = \overline {1,~{{r}_{k}}} \), analogously to how it is described in Section 3 at \(m = {{m}_{k}}\), \(n = {{n}_{k}}\) + (the number of remaining vertices Gk – 1). The maximum flow \({{f}_{k}}\) is found in the network \({{G}_{k}}\). By analogy with Section 5.1 when pushing the flow from the vertex \(I_{k}^{j}\) to the right (step 5.2, Section 2) arcs \(\left( {I_{k}^{j},~w_{k}^{i}} \right)\) should be used first for works \(w_{k}^{i}\) for which \(c_{k}^{j} \leqslant {{\tau }_{{k + 1}}}\). The quantity of the flow \({{f}_{k}}\left( {I_{k}^{j},~w_{k}^{i}} \right)\) is equal to the amount of CPU time allocated to the job \(w_{k}^{i}\) in the interval \(I_{k}^{j}\). Schedule of work execution in the interval \(I_{k}^{j}\) is found using the packing algorithm [1].

The computational complexity of the proposed algorithm is

$$O\left( {K{{{\left( {\mathop \sum \limits_{k = 1}^K {{r}_{k}}} \right)}}^{3}}} \right).$$

6. DISTRIBUTION OF A HETEROGENEOUS SET OF RESOURCES

It is assumed that when performing work, in addition to processors, a nonrenewable resource is used, the amount of which in the interval \(\left[ {{{\tau }_{k}},~{{\tau }_{{k + 1}}}} \right]\) amounts to \({{S}_{k}}\), \(k = \overline {1,~K} \). The work \(w_{k}^{i}\) of a nonrenewable resource can only be allocated at the point in time \({{\tau }_{k}}\). If its volume is \(s_{k}^{i}\), then the duration of the task \(w_{k}^{i}\) is

$$t_{k}^{i} = \varphi _{k}^{i}\left( {s_{k}^{i}} \right),$$
(6.1)

where

$$s_{k}^{i} \in \left[ {0,~~\bar {s}_{k}^{i}} \right],$$
(6.2)
$$\mathop \sum \limits_{i = 1}^{{{r}_{k}}} s_{k}^{i}~~ \leqslant {{S}_{k}}.$$
(6.3)

Here, \(\varphi _{k}^{i}\) is a strictly decreasing function in the interval \(\left[ {0,~\bar {s}_{k}^{i}} \right]\) that takes positive values and \(\bar {s}_{k}^{i}\) are the specified values, \(i = \overline {1,~{{r}_{k}}} \).

Under these assumptions, to solve the problem posed in Section 1, we will need a generalization of Tanaev’s algorithm.

6.1. Generalization of Tanaev’s Algorithm in the Case a Nonrenewable Resource is Available

We will use the notation introduced in Section 3. In addition, the characters \(t_{k}^{i}\), \(s_{k}^{i}\), \(\bar {s}_{k}^{i}\), \({{S}_{k}}\), \(\varphi _{k}^{i}\), \({{W}_{k}}\), and \(w_{k}^{i}\) are replace by \({{t}_{i}}\), \({{s}_{i}}\), \({{\bar {s}}_{i}}\), \(S\), \({{\varphi }_{i}}\), W, and \({{w}_{i}}\), respectively. In this case, restrictions (6.1)–(6.3) are written as follows:

$${{t}_{i}} = {{\varphi }_{i}}\left( {{{s}_{i}}} \right),$$
(6.4)
$${{s}_{i}} \in \left[ {0,~\overline {{{s}_{i}}} } \right],$$
(6.5)
$$\mathop \sum \limits_{i = 1}^n {{s}_{i}} \leqslant S.~$$
(6.6)

Let us prove the following statements.

Lemma 1. An acceptable schedule for executing a set of jobs W in a problem without a nonrenewable resource (without restrictions (6.4)–(6.6)), in which the task \({{w}_{i}}\) is given CPU time amounting to fi, exists if and only if in the network G there is a flow \(f\left( {a,~b} \right),\,\,~\left( {a,b} \right) \in A\) such that the equalities

$$f\left( {{{w}_{i}},~{v}} \right) = {{f}_{i}}$$
(6.7)

are satisfied in front of all \(i = \overline {1,~n} \).

The proof follows from [1]. Assume \(\varphi _{i}^{{ - 1}}\left( {{{s}_{i}}} \right)\) is a function inverse to \({{\varphi }_{i}}\left( {{{s}_{i}}} \right)\).

Lemma 2. An acceptable schedule for executing a set of jobs W in a problem with a nonrenewable resource (taking into account restrictions (6.4)–(6.6)), in which the task \({{w}_{i}}\) is given CPU time amounting to fi, exists if and only if in the network G there is a flow \(f\left( {a,~b} \right),~\,\,\left( {a,b} \right) \in A\) such that equalities (6.7) and the following inequalities are valid:

$$\mathop \sum \limits_{i = 1}^n \varphi _{i}^{{ - 1}}({{f}_{i}}) \leqslant S,$$
(6.8)
$$\varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right) \leqslant \overline {{{s}_{i}}} ,\quad i = \overline {1,~n} .$$
(6.9)

Proof. 1. Assume that in the network G there is a flow f for which relations (6.7)–(6.9) are valid. In this case, from (6.8) it follows that each work \({{w}_{i}}\) can be allocated a nonrenewable resource in the amount of \({{s}_{i}} = \varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right)\). In this case, inequality (6.6) will be true, and due to (6.4), the duration of work \({{w}_{i}}\) (i.e., required CPU time) will be \({{\varphi }_{i}}(\varphi _{i}^{{ - 1}}({{f}_{i}})) = {{f}_{i}}\). Since \(\varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right) = {{s}_{i}}\), (6.5) follows from (6.9). Then Lemma 1 implies the existence of an admissible schedule for W taking into account restrictions (6.4)–(6.6).

2. Now assume there is an admissible work schedule W in a problem with a nonrenewable resource (taking into account restrictions (6.4)–(6.6)), in which the task \({{w}_{i}}\) is allocated CPU time in the amount of \({{f}_{i}}\). Assume in this case work \({{w}_{i}}\) is allocated a nonrenewable resource in the amount \({{s}_{i}}\). Then, by (6.4) \({{f}_{i}} = {{\varphi }_{i}}\left( {{{s}_{i}}} \right)\) or \({{s}_{i}} = \varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right)\). In this case, inequalities (6.8) and (6.9) follow from (6.6) and (6.5), respectively. The proof now follows from Lemma 1. The lemma is proved.

From (6.7), (6.9), it follows that when constructing an admissible schedule in a problem with a nonrenewable resource, we must look for the flow f in the network G for which \(f({{w}_{i}},~{v}) = {{f}_{i}} \leqslant \varphi ({{\bar {s}}_{i}})\) in front of all \(~i = \overline {1,~n} \). Considering that the functions \(\varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right)\) are strictly decreasing, quantities \({{f}_{i}}\) need to be maximized. Therefore, the following algorithm is proposed to solve this problem.

In the network G, first the vertex \({{w}_{{{{i}_{1}}}}}\) is determined, for which the maximum value of flow g from u to \({{w}_{i}}\) is the largest among all vertices \({{w}_{i}}\), \(i = \overline {1,~n} \). Next, number \({{i}_{1}}\) is included in the set N and the throughput capacities of all arcs \(\left( {a,~b} \right) \in A\) of network G decrease by the quantity \(g\left( {a,~b} \right)\). This procedure is then repeated for vertices \({{w}_{i}}\), \(i = \overline {1,~n} \), \(i \notin N\). Next, condition (6.8) is checked.

Algorithm 1.

Step 1. In the network G put \(U\left( {{{w}_{i}},{v}} \right) = {{\varphi }_{i}}\left( {\overline {{{s}_{i}}} } \right)\), \(N = \emptyset \).

Step 2. For \({{i}_{0}} = \overline {1,~\,\,n} ,~\,\,\,{{i}_{0}} \notin N\), follow steps 3–5.

Step 3. Remove from network G all arcs \(\left( {{{w}_{i}},~{v}} \right)\), \(i = \overline {1,~n} \),  \(i \ne {{i}_{0}}\).

Step 4. Find the maximum flow g in the network G and assume \({{g}_{{{{i}_{0}}}}}\) is its magnitude.

Step 5. Connect to network G the arcs removed in step 3.

Step 6. Let \(\mathop {\min }\limits_{{{i}_{0}} = \overline {1,n} ,~~{{i}_{0}} \notin N} \varphi _{{{{i}_{0}}}}^{{ - 1}}\left( {{{g}_{{{{i}_{0}}}}}} \right) = {{g}_{{{{i}_{1}}}}}\). Include \({{i}_{1}}\) in N. Put \({{f}_{{{{i}_{1}}}}} = g\left( {{{w}_{{{{i}_{1}}}}},~{v}} \right) = {{g}_{i}}_{1}\). Reduce the throughput capacities \(U\left( {a,~b} \right)\) of all arcs \(\left( {a,~b} \right) \in A\) of network G by quantity \(g\left( {a,~b} \right)\).

Step 7. If \(\left| N \right| < n\), then go to step 2. If \(\left| N \right| = n\), then go to step 8.

Step 8. If inequality (6.8) is satisfied, then an admissible schedule exists. In this case, work \({{w}_{i}}\) is allocated a nonrenewable resource amounting to \(\varphi _{i}^{{ - 1}}\left( {{{f}_{i}}} \right)\), \(i = \overline {1,~n} \). The duration of work \({{w}_{i}}\) amounts to fi. The schedule is constructed as described in Section 3. If inequality (6.8) is not satisfied, then an admissible schedule does not exist. The algorithm is completed.

The computational complexity of Algorithm 1 is \(O({{n}^{5}})\).

6.2. Generalization of the Original Problem in the Case of the Presence of a Nonrenewable Resource

Let us now turn to the problem formulated in Section 1, with additional restrictions (6.1)–(6.3) related to the distribution of the nonrenewable resource. We return to the notations \(t_{k}^{i}\), \(s_{k}^{i}\), \(\bar {s}_{k}^{i}\), \({{S}_{k}}\), \(\varphi _{k}^{i}\), \({{W}_{k}}\), and \(w_{k}^{i}\), which were previously replaced by \({{t}_{i}}\), \({{s}_{i}}\), \(\overline {{{s}_{i}}} \), \(S\), \({{\varphi }_{i}}\), \(W\), and \({{w}_{i}}\), respectively.

Taking into account the research carried out in Sections 5.1, 5.2, and 6.1, the following algorithm is proposed for solving the original problem formulated in Section 1, for the case of the presence of a nonrenewable resource.

Algorithm 2.

Step 1. Put \(k = 1\).

Step 2. Build network \({{G}_{k}}\) (see Sections 5.1, 5.2).

Step 3. From network \({{G}_{k}}\) remove nodes \(w_{m}^{i}\), corresponding to works with deadline \(c_{m}^{i} > {{\tau }_{{k + 1}}}\), and the arcs incident to them.

Step 4. Apply Algorithm 1 to the resulting network. If at step 8 of Algorithm 1 it turns out that an admissible schedule does not exist, then Algorithm 2 is completed and there is no solution. Otherwise, go to step 5.

Step 5. Connect to network \({{G}_{k}}\) the nodes and arcs removed in step 3. Put \(k = k + 1\). If \(k \leqslant K\), then go to step 2. If \(k > K\), then the solution is constructed. The algorithm is completed.

The computational complexity of Algorithm 2 is

$$O\left( {K{{{\left( {\mathop \sum \limits_{k = 1}^K {{r}_{k}}} \right)}}^{5}}} \right).$$

CONCLUSIONS

The problem of creating a multiprocessor admissible schedule for a set of work complexes, for which execution requests arrive at the given points in time, has been studied. The composition of each complex and the characteristics of the works included in it become known at the time the request is received. When executing the tasks, interruptions and switching from one processor to another are allowed. Setups with and without a nonrenewable resource were studied. A polynomial algorithm for solving the problem, based on constructing a network flow model and searching for the maximum flow, has been developed.