Scheduling Jobs to Minimize a Convex Function of Resource Usage

In this paper we describe polynomial time algorithms for minimizing a separable convex function of the resource usage over time of a set of jobs with individual release dates and deadlines, and admitting a common processing time.


I. INTRODUCTION
I N THIS paper we study variants of the following schedul- ing problem.There are n jobs J = {J 1 , J 2 , . . ., J n }, and a common resource required by a subset of the jobs.Each job J i has a release date r i , a deadline d i , and requires µ i ∈ {0, 1} unit of the common resource.All jobs have the same processing time p.A schedule S specifies a starting time S i for each job J i , and it is feasible, if r i ≤ S i ≤ d i − p holds for each job J i .
The goal is to find a feasible schedule S, which minimizes a convex function f : R ≥0 → R of the load of the resource throughout the scheduling horizon, i.e., min S dmax rmin f (ℓ S (t))dt, where r min = min i r i is the earliest release date and d max = max i d i is the last deadline, and ℓ S (t) is the load of the resource at time point t in schedule S, i.e., ℓ S (t) = |{i | S i ≤ t ≤ S i + p, µ i = 1}|.
A variant of this problem, where p = 1, µ i = 1 for all J i ∈ J , and for each job J i a subset of time slots D i ⊂ Z + is given, rather than an interval [r i , d i ], is known as the load balancing problem and it has been extensively studied by several authors, see e.g., [9], [10], [6].As it is established in all these papers, this special case has some very nice properties: (i) there always exists a universally optimal solution U , which is optimal for any convex function f of the load ℓ U , and (ii) if a schedule S is not optimal, then there exists a pair of time slots t 0 , t 1 ∈ Z, such that ℓ S (t 0 ) ≥ ℓ S (t 1 ) + 2 along with a subset of jobs, which can be rescheduled such that the load of t 0 decreases by one, while the load t 1 increases by one, and This research has been supported by the TKP2021-NKTA-01 NRDIO grant on "Research on cooperative production and logistics systems to support a competitive and sustainable economy".the load of all other time slots do not change.The convexity of f ensures that the objective function value of the new schedule is smaller than that of S. Yet another variant is when the jobs have arbitrary integer processing times, but the preemption is allowed, i.e., the processing of any job can be interrupted and resumed later.This variant is studied in [8].The authors have shown that the above two properties of optimal solutions are preserved.Drótos and Kis [7] study the following resource leveling problem.There is a set of m machines, a set of renewable resources, and a set of n jobs associated with release times, deadlines and resource requirements, each pre-assigned to one of the machines.The jobs have to be sequenced on the machines, while minimizing the sum of the convex functions of the loads of the resources over time.They show that if the starting times of all tasks on all but one machines are fixed, the problem is NP-hard.However, if the ordering of tasks on the remaining machine is also given, then a polynomial time algorithm exists.They also give a heuristic as well as exact branch-and-bound algorithm for solving the problem.
The above scheduling problem can be extended to parallel machine problems, where the jobs have to be assigned to machines, and the jobs assigned to the same machine have to be sequenced.The latter problem was introduced by Blazewicz [4], where all jobs have processing time p = 1, and require 0 or 1 unit of a common resource of capacity c.In a feasible solution the jobs are scheduled between their release dates and deadlines, and at most m jobs are processed concurrently, where m is the number of the parallel machines.Moreover, at most c jobs of resource requirement 1 are processed in parallel at any time.Blazewicz described a proprietary polynomial time algorithm for deciding whether a feasible schedule exists.This problem can be reformulated as a scheduling problem with a separable convex cost function.We define a piecewiselinear convex function f as follows: f (x) = 0 for x ≤ c and f (x) = x−c for x ≥ c.It is easy to see that there is a feasible schedule in which at most c jobs with resource requirement 1 are scheduled concurrently if and only if there exists a feasible schedule of cost 0 w.r.t function f .
In this paper, we deal with two variants of the scheduling problem with non-preemptive jobs, all of processing time p: Problem P 1 .All jobs require one unit of the common resource, i.e., µ i = 1 for each job J i , and the common processing time p is arbitrary positive integer.We will show by way of an example that in unlike the load balancing problem with p = 1, for general p, there is no universally optimal solution (Section III).Furthermore, improving a non-optimal schedule may be far more complicated than in the case with unit length jobs.We will reduce the problem to a minimum cost circulation problem with convex cost functions on the arcs in an appropriately defined network, which permits the application of efficient combinatorial methods for finding optimal solutions (Section IV).Problem P 2 .Only a subset of the jobs require one unit of the common resource, and p = 1.In addition, there are m machines (resources of unit capacity), and each job has to be assigned to one of the machines.The jobs assigned to the same machine must be processed in non-overlapping time slots.
We describe a network-flow based method with convex cost functions on the arcs in Section V.As a by-product, our method can also answer the decision problem of [4].

II. RELATED WORK
We have already summarized the most relevant results on load balancing, resource leveling, and deadline scheduling of jobs on parallel machines using a bounded capacity resource in the introduction.In the following we focus on parallel machine scheduling problems with equal job processing times.
Brucker and Kravchenko [5] investigate the problem where equal-length jobs have to be scheduled on m identical parallel machines.For each job, a release time and a deadline is given.They present a polynomial time algorithm that finds a feasible schedule and minimizes the weighted sum of the completion times.Their method is based on an integer programming formulation of the problem, solving the linear relaxation and rounding the solution appropriately.A similar problem is considered by Kravchenko and Werner [12], but the time interval between the earliest release date and the latest deadline is divided into several smaller intervals, and for each of them, the number of available machines is given.They present a linear programming approach to find a feasible schedule that minimizes the maximum number of machines used by the jobs.Further results can be found in [2], [3], and for a survey, see [13].

III. PROPERTIES OF OPTIMAL SOLUTIONS
In the introduction we emphasized that the load balancing problem with common job processing time p = 1 admits a universally optimal solution, i.e., one which is optimal for any convex cost function.The following example shows that for p > 1 this is not the case by providing two different convex functions with two different unique optimal solutions.
Example III.1.There are 9 jobs, where J 1 and J 2 have release dates r 1 = r 2 = 0 and deadlines d 1 = d 2 = 5, and J 3 through J 8 , have release dates r 3 = • • • = r 8 = 5 and deadlines d 3 = • • • = d 8 = 10.Furthermore, job J 9 has release date r 9 = 0 and deadline d 9 = 14.The processing time of all the jobs is p = 5.Notice that in a feasible schedule, the place of jobs J 1 , . . ., J 8 is fixed: J 1 and J 2 are processed from 0 to 5, and J 3 , . . ., J 8 are processed from 5 to 10.The feasible schedules differ only in the starting time of J 9 .Firstly, we want to minimize the function f 1 (x) = x 2 of the load.It is not difficult to check that in the optimal solution, J 9 is processed in the interval [9,14].Let S 1 denote this solution, and the cost of S 1 is 5 • 2 2 + 4 • 6 2 + 7 2 + 4 • 1 2 = 217.We get a feasible, but not optimal solution by processing J 9 in [0, 5].Let S 2 denote the solution we get in this way.The cost of S 2 with respect to f 1 is 5•3 2 +5•6 2 = 225 > 217, and indeed, S 2 is not an optimal solution w.r.t.f 1 .Now consider the convex function f 2 (x) = 0 for x ≤ 6, and f 2 (x) = x − 6 for x ≥ 6.It is easy to show that S 2 is the only optimal solution w.r.t.f 2 .
The example above suggests that the approaches for p = 1 may not be straightforwardly generalized for p > 1.

IV. A COMBINATORIAL APPROACH FOR PROBLEM P 1
We first give a linear programming formulation of problem P 1 in Section IV-A.Then, we show that the problem can be equivalently described as a minimum-cost circulation problem in a network with piecewise-linear convex cost functions on the arcs (Sections IV-B), and how to determine an optimal solution for our scheduling problem from an optimal circulation in Section IV-C.Finally, based on these results, we propose a new combinatorial algorithm for a parallel machine scheduling problem (Section IV-D).

A. Initial problem formulation and solution method
Firstly, we introduce additional notation.Let I = {I 1 , I 2 , . . ., I L } be the set of all different time slots of length p in The following lemma states an important property about the structure of an optimal schedule, and it generalizes Lemma 3 of [2].Lemma 1.There is an optimal schedule, where each job is processed in one of the intervals in I.
Proof.Suppose the statement of the lemma does not hold for a problem instance with jobs J and processing time p.Let S * be an optimal schedule such that the number of jobs which are not scheduled in some time slot in I is minimal.Let H be the subset of all those jobs that are not scheduled in some time slot in I by S * .
Let δ ∈ R n+1 be a vector representing the load of the resource in S * , that is, for ℓ ∈ {0, . . ., n}, δ ℓ equals the total size of time intervals in which the load of the resource is ℓ.Clearly, Unless ∆ = 0, this implies that S * is not optimal.Hence, ∆ = 0, and S 1 is an optimal schedule in which some job in H is scheduled in a time slot in I, which contradicts the choice of S * .
Let C = {c 0 , c 1 , . . ., c H } be the ordered set of all different left and right endpoints of For any subset X of the jobs, let N (X) consist of all those time slots I k ∈ I, which are feasible for at least one of the jobs in X, that is, In our formulation we have the following three types of variables: • x k : the number of jobs processed in time slot I k ; • b X : the number of jobs scheduled in the time slots N (X); • t h : the number of jobs that require the resource in K h , that is, x k ∈ Z, for all k = 1, . . ., L.
Note that In order to show that (IP ) is a proper formulation for problem P 1 , we define the bipartite graph G (x,b,t) = (V I ∪ V J , E) for a feasible solution (x, b, t) of (IP ).For each job J ∈ J , V J contains a unique node v J , and for each time slot k ) for l = 1, . . ., x k .For any X ⊆ J , let V X denote the set of nodes {v J | J ∈ X}, and N (V X ) the set of time slot nodes adjacent to any node in V X in G (x,b,t) .Then, constraints in ( 1) and ( 2) ensure that for any subset of jobs X ∈ X , N (V X ) ≥ |V X |.The following result shows that this condition holds for all nonempty subsets of the nodes, not only for those in X .
Lemma 2. Let (x, b, t) be a feasible solution to (IP ).Then, for every nonempty subset X of the jobs J Proof.Let X ⊆ J be arbitrary subset of the jobs and let V X denote the corresponding subset of nodes in V J .Let N (V X ) ⊆ V I denote the nodes that are adjacent to at least one node in Constraint (3) ensures |V J | = n, therefore, we have: Lemma 3. Let (x, b, t) be a feasible solution to (IP ).Then G (x,b,t) admits a perfect matching.
Proof.It follows from Lemma 2 and from the well-known theorem of Hall (see e.g.[1]).
The following result shows how to map feasible solutions of (IP ) to feasible schedules of the same cost and vice versa.Lemma 4. For any feasible solution (x, b, t) of (IP ), there is a feasible schedule, where x k jobs are processed in time slot I k and the load of the interval K h is t h .Conversely, from every feasible schedule, where the jobs are scheduled in the time slots of I, one can obtain a solution (x, b, t) of the same cost satisfying ( 1) - (6).
Proof.To prove the first part of the lemma, suppose (x, b, t) satisfies ( 1) - (6).Then by Lemma 3, G (x,b,t) admits a perfect matching M .If (v J , v I ) ∈ M , schedule job J in time slot I. Then for any I k ∈ I, the number of jobs processed in I k is the number of nodes in V I representing I k which is exactly x k .t h represent the load of interval K h in the solution by eq. ( 4), therefore, the load of K h is t h in the schedule.
To show the second part, let S denote a feasible schedule.For all time slots I k ∈ I, let x k denote the number of jobs processed in I k , and for each interval K h , h = 1, . . ., H, let t h denote the number of jobs that are executed during K h .For an arbitrary X ∈ X , let b X denote the total number of jobs that are processed in the time slots of N (X).Then (x, b, t) satisfies ( 1) - (6) and it has the same cost as S.
The following statement shows how to map optimal solutions (x, b, t) to perfect matchings in G (x,b,t) , and vice versa.
Proposition 1.If (x, b, t) is an optimal solution to (IP ), then any perfect matching in G (x,b,t) corresponds to an optimal Algorithm 1 Calculation of optimal schedule Require: n ≥ 0, p ≥ 1, {r i , d i } for i = 1, . . ., n, function f Ensure: Optimal schedule S; 1: Solve (IP ), and let (x, b, t) be an optimal solution; 2: Define the graph G (x,b,t) , and find a perfect matching M in it; 3: Construct schedule S by assigning the jobs to the time slots as specified by M ; schedule.Conversely, any optimal schedule S induces an optimal solution (x, b, t) to (IP ).
Proof.Follows easily from Lemma 3 and Lemma 4.
By Proposition 1, we can solve the scheduling problem by Algorithm 1: Since finding a perfect matching in a bipartite graph can be done in polynomial time [1], it remains to solve (IP ) efficiently.In the remainder of this section, we sketch our approach for solving (IP ) in polynomial time by a combinatorial method based on network flows.
Firstly, we observe that the size of (IP ) can be polinomially bounded in the size of the input.
Lemma 5.The size of the linear system ( 1)-( 6) is polynomial in the size of the input.
Proof.To prove that the size of system (1)-( 6) is polynomial in the size of the input, it is enough to show that the number of constraints in ( 2) and ( 4) is polynomial in the input size.Observe that L = |I| is O(n 2 ).All X ∈ X can be obtained the following way.One can construct O(L 2 ) possible connected N (X) sets of time slots by determining the earliest and latest time slot.Then it remains to check whether there is an X ⊆ X such that N (X) is exactly the set of time slots feasible for at least one jobs in X. Therefore |X | is polynomial in L. There are H intervals K h and the endpoints of each of them coincide with endpoints of time slots in I, therefore H = O(L) and the number of constraints in (4) is polynomial in the input size.
Since we are only interested in the values of f at integer loads only, we can replace f with a piecewise linear convex function f with integer break points, where f (z) = f (z) for all z ∈ Z ≥0 .Furthermore, one can assume that the first break point of f is at 0 and the last one is at most n, since there are n jobs.It is not difficult to see that for such an f , the optimal value of (IP ) coincides with the optimal value of In fact, the matrix of (1) -( 6) is totally unimodular, see Lemma 6, which permits to get rid of the integrality condition (6) by a result of Meyer.Meyer [14] has shown that an optimization problem with a separable piecewise linear convex cost function with integer break points, and a totally unimodular constraint matrix always admits and integer optimal solution.This means that in (IPWL) we can drop constraint (6), while preserving integer optimal solutions: (1) − (5).[11] describe efficient polynomial time algorithms for minimizing a separable convex cost function over the linear space M x = 0, provided M is a totally unimodular matrix.More specifically, for every coordinate x e of x, there is a convex function w e : R → R. If E is the set of coordinates of x, the problem is to find x such that M x = 0, while e∈E w e (x e ) is minimized.It is assumed that {x : M x = 0} contains a non-zero point and the minimization problem has a finite optimal solution.The authors have shown how to solve the problem efficiently for different classes of convex functions, assuming there is an oracle that solves the following problems: 1) given a point r ∈ R, return c ⊢ e (r) and c ⊣ e (r), where c ⊢ e (r) and c ⊣ e (r) are the right and left derivatives of w e at r.The convexity of w e implies the existence of the right and left derivatives; 2) given a slope s ∈ R, return a point r with c ⊣ e (r) ≤ s ≤ c ⊢ e (r).In the case of piecewise linear convex functions, such an oracle is easy to implement.

Karzanov and McCormick
Karzanov and McCormick proposed two different algorithms for solving such problems: the Minimum Mean Canceling Method (MMCM) and the Cancel and Tighten algorithm.Both methods are iterative, and in general case, these algorithms involve solving linear programs in each iteration.Although the number of iterations is polynomial in the size of the input, the running time is not as impressive due to solving linear programs.However, when {x : M x = 0} is the space of circulations in a graph G (that is, M is the node-edge incidence matrix of G), then there is no need to solve linear programs, and each iteration of the Cancel and

B. Reformulation as a circulation problem in a network
First of all, observe that in the objective function of (P W L), we have convex functions only for variables t h , and the system has lower or upper bound constraints for variables x k and b X .The function corresponding to t h is |K h | f (•).The breakpoints of f (•) are 0, 1, . . ., n, and the slopes between these breakpoints are PROCEEDINGS OF THE FEDCSIS.WARSAW, POLAND, 2023 b l is not a real breakpoint, but it is not a problem).Then we have It is not difficult to show that we get an equivalent problem by introducing convex cost functions w k and w X for the variables x k and b X and moving the lower and upper bound constraints to w k and w X the following way.Let K be a sufficiently large positive number.Since we want a variable x k to be non-negative, w k has a breakpoint at 0 and the slope before 0 is −K and the slope after 0 is 0, that is Similarly, if X ̸ = J , w X has a breakpoint at |X| and the slope before |X| is −K and after |X| is 0, i.e., If X = J , w X has a breakpoint at n and the slope before n is −K and after n it is K, that is Therefore, (P W L) can be reformulated as minimize (P W L2) : x k − b X = 0 for all X ∈ X ; The following lemma plays a crucial role in our method.
Lemma 6.Let M denote the matrix of the following system: Then M T is a network matrix.
Proof.Observe that M can be written as M = (A, −I), where A ∈ R a×L is an interval matrix and −I ∈ R a×a is a negative identity matrix, where a = |X | + H is the number of constraints in ( 1) and ( 4).Therefore if y is a column of M T , then y has some 1 entries in consecutive positions in the first L coordinates, and in the remaining a coordinates, y has a unique -1 entry.All other coordinates of y are 0. We construct a network D with a spanning tree T and show that each non-tree edge corresponds to a column of M .
a directed path of length L, where the kth edge v k−1 → v k represents the kth p-length time slot I k , and we say it corresponds to variable x k .At the beginning, D = P and T = P .Then we add new nodes and edges to D and T the following way: we take all constraints from (1) and ( 4) one by one, and for each of them, we connect nodes representing the first and the last time slot in the constraint with a new path of length 2.More precisely, consider constraints in (1) and suppose equation We add a new node denoted by v bX .Let X 1 denote the index of the first time slot and X 2 the index of the last time slot in N (X).We add edges v X1−1 → v bX and v bX → v X2 .We extend T with the first new edge v X1−1 → v bX , and we say the tree edge v X1−1 → v bX corresponds to variable b X .The other new edge v bX → v X2 becomes a non-tree edge.We proceed similarly with equations in (4) of the form k:I k ⊇K h x k − t h = 0: we connect the first and the last time slot in I k : I k ⊇ K h with a 2-length path containing two new edges and extend T with the first new edge in the same way as before.Fig. 1 illustrates the network constructed this way.It is not difficult to check that a column in M T corresponding to a constraint from (1) or ( 4) is represented by a non-tree edge in the network.Fig. 2: A piecewise linear convex function and its dual.
For simplicity, tree edges in D corresponding to variables x k , b X and t h are denoted by e x k , e bX and e t h .In the next part, we dualize the problem and solve the dual problem instead of the original primal formulation.To this end, we need dual variables for non-tree edges represented by the rows of M .For a non-tree edge, let z X denote the corresponding dual variable if the edge derives from a constraint in (1), and let z h be the dual variable if it derives from a constraint in (4).For a nontree edge e, let C e denote the tree edges in e's fundamental cycle.
In order to obtain the dual of (P W L2), we have to determine the duals of the functions w k , w X and w h , respectively.It is known (see e.g.[11]) that the dual f * (•) of a piecewiselinear convex function f (•) is obtained by exchanging the slopes and breakpoints of f , that is, the slopes of f will be the breakpoints of f * and the breakpoints of f will be the slopes f * , see Fig. 2 for an illustration.
The dual functions of w X , w k and w h are denoted by w * X , w * k and w * h , respectively, and these functions have the following forms.
If X ̸ = J , we have For w * k , we have and finally w * h can be written as Using w * X and w * h , the dual of (P W L2) can be concisely expressed as follows: Notice that the lower bound for λ k coincides with the left endpoint of the domain of w * k , and the lower and upper bounds for z X and z J coincide with the left and right endpoints of the domain of w * X and w * J .Since the matrix of problem (P W L2) is the transpose of a network matrix, (DP ) is a network circulation problem, the only problem with it is that in the objective function we have w * h (−z h ), i.e., the negative of z h is substituted in the convex function w * h .However, it is easy to overcome this issue by reversing the arcs e t h .So, our final network has the same set of nodes and arcs as D, except that the arcs e t h are directed oppositely.For an edge e x k , the lower bound for the flow value λ k is 0 and there is no upper bound, while the cost is 0. For an edge e bX , let the cost function be the piecewise linear w * X and if X ̸ = J , the lower bound is 0 and the upper bound is K, and when X = J , the lower bound is −K and the upper bound is K.For an edge e t h , we have no lower or upper bounds and the cost function is the piecewise linear w * h .There are no lower or upper bounds for the flows on non-tree edges in D, and the cost function is 0.

Proposition 2. The minimum cost circulation problem defined above is equivalent to the problem (DP ). The cost of a minimum cost circulation is equal to the optimal value of (DP ).
The minimum cost circulation problem defined above can be solved by the Cancel and Tighten method described in [11].Remember, the number of iterations

C. Solution of the primal problem (P W L2)
By Proposition 2, an optimal solution to (DP ) can be obtained by solving a minimum cost network circulation problem with convex cost functions on the arcs, using an algorithm of [11].It remains to show how to determine the primal optimal solution for (P W L2). Since the dual space of circulations is the space of co-circulations, the optimal primal solution is represented by an appropriate co-circulation.One can read out the following lemma from [11]. ) are integral values in our case, the optimal co-circulation found by a shortest path algorithm is integral as well.

D. Application to a parallel machine scheduling problem to minimize the total completion time of the jobs
In this subsection we show how to apply the previously introduced techniques to a problem investigated by Brucker and Kravchenko [5].There are n jobs with common processing time p, each of them having a release date and deadline.In addition, there are m identical parallel machines.In a feasible schedule each job is processed between its release date and deadline on one of the machines, and at most m jobs are processed concurrently at any time.The goal is to find a feasible schedule, if one exists, that minimizes C i , where C i denotes the completion time of J i .
To begin with, we formulate the problem similarly to (IP ).Recall the definitions of the set of time slots I, and set of intervals {K h } h=1,...,H .Let C(I k ) denote the right endpoint of I k ∈ I. Variables x k , b X and t h denote the same quantities as in (IP ). s.t.
The objective function (7) expresses the total completion time of the jobs.The rest of the constraints are analogous to that of (IP ).For a feasible solution (x, b, t), one can construct a bipartite graph G (x,b,t) = (V I ∪ V J , E) in the same way as in Section IV-A.Analogously to Lemma 2, one can show that G (x,b,t) admits a perfect matching and Proposition 1 holds.Therefore, the problem can be solved efficiently if one can solve (IP ′ ) efficiently.From Lemma 5, it follows that the size of (IP ′ ) is polynomial in the size of the input, and similarly to Lemma 6, one can show that the transpose of the matrix of the system is a network matrix.Since the cost functions on the arcs are linear functions of the flows, the dual is a circulation problem with liner costs on the arcs, and a simple minimum cost flow computation finds an optimal solution.

V. A SOLUTION TO PROBLEM P 2
This section is devoted to problem P 2 .We aim to schedule the jobs on m parallel machines in a way that the load is as balanced as possible.We deal only with the case, where the processing time of the all jobs is p = 1, but the resource requirement of the jobs can be 0 or 1.We show that this problem can be solved by a single minimum cost flow computation in a network with convex costs on the arcs in Section V-A.Then, we apply our formulation to the decision problem of [4] in Section V-B.

A. A network flow formulation to solve P 2
In order to describe a network flow representation of the scheduling problem, we define the time slots for the jobs.Let I ′ = {I 1 , . . ., I L ′ } be the set of all different unit-length time slots in the set Note that for each job it suffices to consider only the first n unit-length time slots, since there are n jobs.We define the network D ′ as follows.For every job, there is a job node in , where jobs J 1 and J 2 require one resource unit and jobs J 3 and J 4 require 0. The cost is measured by the convex function f on three edges, the remaining edges have zero cost.D ′ .For simplicity, the job nodes are denoted by J 1 , . . ., J n .For each I k ∈ I ′ , there are two time slot nodes in D ′ denoted by I 1 k and I 2 k .Furthermore, there is a source node s and a sink node t.From s, there is an arc to every job node of capacity 1.If J i requires 1 unit of the resource, that is, µ i = 1, then there are arcs from J i to all the nodes I 1 k such that I k is feasible for J i .When µ i = 0, there are arcs from J i to all the nodes I 2 k , such that I k is feasible for the job.All these arcs have infinite capacity.For all I k ∈ I, there is an arc from I 1 k to I 2 k of infinite capacity, and the cost function on this arc is f .The cost function on all other arcs is 0.Moreover, there is an arc from I 2 k to t of capacity m.See Fig. 3 for an illustration.Proposition 3. The optimal feasible schedules are in one to one correspondence with the integral minimum cost feasible flows, where the total flow leaving s is n.
Despite of D ′ having convex costs on some edges, a similar network having only linear costs can be constructed in a similar way as in [8], and the problem can be solved by any minimum cost network flow algorithm.

B. Application to a scheduling problem with a resource of bounded capacity
By choosing the convex function f properly, one can decide the feasibility problem considered by Blazewicz [4] as described in Section I.If c denotes the resource capacity, then let f denote the following piecewise linear function: f (x) = 0 if x ≤ c and f (x) = x − c if x ≥ c, where c is the capacity of the resource.Then there exists a feasible schedule using m machines, where each job is processed in a time slot between its release time and deadline if and only if there is feasible flow of zero cost in the previously constructed network D ′ .Notice that there is no need to solve a flow problem with arc costs.Let the network D ′′ be obtained from D ′ by removing all arc costs and setting the capacity of the arcs from I 1 k to I 2 k to c. Then we have the following result.
Proposition 4. The scheduling problem of [4] with a bounded capacity resource admits a feasible solution if and only of the network D ′′ admits a feasible flow of value n.

VI. PRELIMINARY COMPUTATIONAL RESULTS
We have implemented Algorithm 1 including the Cancel and Tighten method in C++ for solving Problem P 1 on randomly generated problem instances.The goal of the test runs was to assess how sensitive is the method to two problem parameters: the number of the jobs n, and the ratio of the common processing time and the size of the time windows of the jobs, i.e, q = p/(d i − r i ).We generated three problem instances for each combination (n, q) ∈ {20, 50, 100} × {0.1, 0.4}.The common job processing time was p = 8.The time horizon spanned 100 time units, and for each job J i the release date and deadline satisfied the constraint r i ≥ 0, d i = ⌈r i + p/q⌉, and d i ≤ 100.We used the same piecewise linear convex function f in all cases, where f (0) = 0, f has breakpoints at 1, 2, . . ., n, and the slope after breakpoint i is i.
The code was compiled with Visual Studio 2019, and the tests were run on a notebook computer with Intel Core I7 processor and Windows 11.We summarize the computational results in Table I.We provide averages (rounded to nearest integers) over 3 problem instances for each combination of the parameters n and q.In each case, we provide the average number of nodes and edges of the network D, the average number of iterations, the average CPU time, and also the average optimum values.All values are rounded to the nearest integers.As we can see, the CPU time strongly correlates with the number of graph edges.On the other hand, the number of iterations lightly increases with the number of the jobs, but for the same number of jobs, it is smaller for q = 0.4 than for q = 0.1.In fact, this is what we expected, since problem instances with a larger ratio q permit less freedom to choose the starting times of the jobs.

VII. CONCLUSION
In this paper we gave polynomial algorithms to two load balancing problem.A possible direction for a future research is to investigate a problem slightly more general than Problem P 2 .While the common processing time in P 2 is one time unit, it is an interesting question what can be said if the common processing time is greater than one time unit.The complexity of this problem is still open.One possible next step would be to derive an approximation algorithm for the problem.
and the cost of S * is n ℓ=0 f (ℓ)δ ℓ .Let ϵ > 0 be the smallest value such that starting all the jobs in H by ϵ time earlier, or later, at least one of the jobs in 792 PROCEEDINGS OF THE FEDCSIS.WARSAW, POLAND, 2023 H is scheduled in a time slot I ∈ I. Let S 1 be the resulting schedule.Such a shift induces a vector µ ∈ R n+1 such that δ + µ represents the load of the resource in schedule S 1 .The cost of the schedules S * and S 1 are related by cost(S 1 ) = cost(S * ) + ∆, where ∆ = n ℓ=0 f (ℓ)µ ℓ .Since n ℓ=0 ℓ • µ ℓ = 0 must hold, δ − µ also represents the resource usage of some feasible schedule S 2 , namely, the one obtained by shifting all jobs in H in the opposite direction by ϵ.The cost of S * and S 2 are related by cost(S 2 ) = cost(S * ) − ∆.
Tighten algorithm takes O(|E(G)| log |V (G)|) time, and the total number of iterations is O(|V (G)| log(|V (G)|C)), where C denotes the absolutely largest finite slope.The impressive running time motivates the question whether our problem can be reformulated as a minimum cost circulation problem in a network with piecewise-linear convex cost functions on the arcs.

Fig. 1 :
Fig. 1: Network D. Thin arcs correspond to non-tree edges, thick arcs are the edges of T .
The dual piecewise linear convex function.The breakpoints are the slopes and the slopes are the breakpoints of the function in Fig.2a.
is O(|V (G)| log(|V (G)|C)), and one iteration takes O(|E(G)| log |V (G)|) time.Observe that C = O(n) holds in our case.It can be assumed that the length of the scheduling horizon d max − r min is at most 2np.Therefore, the number of different p-length time slots is O(n 2 ), and the number of constraints in (1) and (4) is O(n 4 ).Hence, |V (G)| = O(n 4 ) and |E(G)| = O(n 4 ) in our case.

Lemma 7 .
Let x * e , e ∈ E denote an optimal solution to the minimum cost circulation problem.If h e , e ∈ E is a co-circulation satisfying c ⊣ e (x * e ) ≤ h e ≤ c ⊢ e (x * e ) for all e ∈ E, then h e , e ∈ E is an optimal solution to the dual problem, where c ⊣ e and c ⊢ e are the corresponding left and right derivatives, respectively.If an optimal solution x * e , e ∈ E is given, then by Lemma 7, an optimal co-circulation is easy to obtain.For e ∈ E, let u e and v e denote the starting and ending node of e, respectively.Then finding a co-circulation satisfying c ⊣ e (x * e ) ≤ h e ≤ c ⊢ e (x * e ), e ∈ E is equivalent to finding node potentials π satisfying π(v e ) − π(u e ) ≤ c ⊢ e (x * e ) and π(u e ) − π(v e ) ≤ −c ⊣ e (x * e ) for all e ∈ E. Such node potentials π can be found by a shortest path algorithm in the directed graph we get by adding edges e ∈ E to the graph in reverse direction as well.The edge lengths are c ⊢ e (x * e ) for edges with original orientation and −c ⊣ e (x * e ) for edges with reverse orientation.Since c ⊢ e (x * e ) and c ⊣ e (x * e