Minimum Dissatisfaction Personnel Scheduling

In this paper we consider two problems regarding the scheduling of available personnel in order to perform a given quantity of work, which can be arbitrarily decomposed into a sequence of activities. We are interested in schedules which minimize the …

Authors: Mugurel Ionut Andreica, Romulus Andreica, Angela Andreica

MINIMUM D ISSATISFACTION P ERSONNEL SC HEDULING Mugurel Ionut Andreica Politehnica University of Bucharest mugurel.andreica@cs.pub.ro Romulus Andreica and Angela Andreica Commercial Academy Satu Mare academiacomerciala@yahoo.com Abstract: In this paper we consider two problems regarding the scheduling of available personnel in o rder to perform a given quantity of work, which can be arb itrarily d ecomposed in to a sequence of activities . We are interested in schedu les which minimize the overall dissatisfaction, where each em ployee’s dissatisfaction is modeled as a time -d ependent linear f unction. For the two situations considered we provide a detailed ma thematical analysis, as well as efficient algorithms for determining optimal sc hedules. 1. Introduction Personnel scheduling prob lems are very important in many activity do mains and ef ficient scheduling techniques are being so ught increasi ngly o ften. Co mmon scheduling objectives are: maximizing productivit y, minimizing los ses, maximizing pro fit and others. In this paper we co nsider t wo pro blems regard ing the scheduling of employees, in order to p erform a giv en quantity of work which can be arbitrarily decom posed into a sequence of activities. The objective is to determine a time schedule of the activ ities a nd an assignme nt of employees to the activities wh ich mini mizes the o verall dissatisfaction, subject to several types of co nstraints. The dissatisfaction of ea ch emplo yee is m odeled as a time- dependent linear function. We present a d etailed mathematical anal ysis of t he prob lems, as well a s efficient algorithms for determining opti mal sched ules. Our result s are significant both from a theoretical and a practical point of view. The rest of this p aper is structured as follo ws. In Sectio ns 2 and 3 we present the t wo personnel scheduling problems we mentioned, together with co mplete analysis and algorithms. I n Section 4 we discu ss related work and in Section 5 we conclude. 2. M inimum Dissatisfact ion Scheduling w ith Personnel Ordering Restrictions An economic age nt has N employees, numbered with natural numbers from 1 to N, which have to perfor m some quantity of w ork. The overall quan tity o f w ork can be divided into any number of activities, which can be performed sequentially. Each activity i ca n be realized in negligible time (zero time), thus its only par ameter of interest will be the moment when the activity i s sc heduled ta i . Let’s consider that the quantity of w ork has been divided into k activities, sc heduled at times 0 ≤ ta 1 t (but not at a t ime moment t’tas gn[j]. We will compute an array incsum , where    N j p p dinc j incs um ] [ ] [ Thus, incsum[j] is the sum of the i ncreases of dissatisfac - tion o f t he e mployees j, j +1, …, N. We will select t he minimum value o f the array incsu m: let this value be incsum[p]. If i ncsum[p] ≥ 0, then the algorith m will stop . If incsum[p]<0, then, b y assi gning a ll the e mployees p, p+1, …, N to a an acti vity scheduled later than their current activity, the overall d issatisfactio n will decrease. We will find the lar gest negative valu e T shift from the set {tasgn[q]- te q | p ≤ q ≤ N }, i.e. that value which is close st to 0. Then, we will increase a ll the val ues tasg n[q] (p ≤ q ≤ N) by |T shift |. After doing this, we w ill recompute the arrays dinc and incs um a nd p erform anot her iteration. T he pseudocode o f the algorithm is given belo w: GreedyPersonnelSche duling: Step 1. for i=1 to N do ta sgn[i]=0 Step 2. compute the arrays dinc and incsum Step 3. choo se the minimum value (incsum[p ] ) in the array incsum Step 4. if ( incsum[p] ≥ 0 ) then goto Step 8 . Step 5. find the minimum value T shift =min{tasgn[q]- te q | (p ≤ q ≤N) and (tasgn[q]-teq < 0) } Step 6. for i=p to N do ta sgn[p]=tasgn[p]+|T shift | Step 7. go to Step 2. Step 8. compute    N 1 i ta s g n [ i]) d s (i, D Step 9. return D The algorithm above can be easil y imple mented i n tim e O(N 2 ). We w ill no w e xplain ho w its time co mplexity ca n be reduced to O(N ·log(N)). For this, we will use the segment tree data struct ure and , in par ticular, the se gment tree framework i ntroduced in [ 1]. We will maintain three segment trees, as sho wed in th e pseudocod e below: GreedyPersonnelSche duling- O(N ·logN): for i=1 to N do tasgn[i]=0 if ( te i ≤ tasgn[i] ) then dinc[i ] =w i else dinc[i]=-w i incsum[N]=dinc[N ] for i=N-1 downto 1 do incsum[i]=dinc[i]+incsum[i- 1] // compute two auxiliary arrays: incsum_aux and tasgn_aux for i=1 to N do incsum_aux[i]=(incsum[i ] , i ) if ( dinc[i ] ≥ 0 ) then tasgn_aux[i]=(- ∞ , i ) else tasgn_aux[i]=(tasgn[i]- te i , i) st_iaux = the se gment tree for the a rray incsum_aux, with update function uFunc=plus_poz and query function qFunc=min_poz st_taux = the segment tree fo r the array tasgn_au x, with update function uFunc=plus_poz and query function qFunc=max_poz st_tasgn = t he segment tree for the array tasgn, with update function uFunc=+ and query function qFunc=min while ( true ) do ( vmin, pozmin )= STrangeQuery ( st_iaux.root, 1, N ) if ( vmin ≥ 0 ) then break ( T shift , pozshift )= STrangeQuery ( st_taux.root, pozmin, N ) STrangeUpdate ( st_taux.root, (-Tshift, 0), pozmin, N ) STrangeUpdate ( st_tasgn.root, -Tshift, pozmin, N ) STrangeUpdate ( st_taux.root, (- ∞ , 0), pozshift, pozshift ) STrangeUpdate ( st_iaux.root, (2·w pozshift , 0), 1, pozshift ) for i=1 to N do tasgn[i] = STrangeQuery ( st_tasgn.root, i, i ) The functions plus_po z , min_po z and max_poz are defined below: plus_poz((v x , poz x ), (v y , poz y )): return ( (v x +v y ) , max ( poz x , poz y )) min_poz((v x , poz x ), (v y , poz y ) ): if ( v x v y ) then return ( v x , poz x ) else return ( v y , poz y ) The functions STrangeUpda te and STrangeQuery are part of the segment tree framework de fined in [1]. The al gorithm works a s follows: we find the minimum value of the arr ay incsum ( vmin) and the p osition of t he minimum value (poz min) using the se gment tr ee st_iaux . If vmin ≥ 0, then the e xecutio n ends. Afterwards, we find the largest non-positi ve value T shift in the ar ray tasgn_au x, together with its position p ozshift , using the se gment tree st_taux . Then, we increase b y |T shift | all the positions in the arrays tasgn_ aux and tasgn , between pozmin and N . We set the value of tasgn_aux[ pozshift] to (- ∞ , pozshift) , in order to ignore this positio n fro m no w on. After all these operations, the value din c[pozshift] changes from - w pozshift to + w pozshift . T hus, all the val ues incsum[p] (1 ≤ p ≤ pozshift) increa se by 2 · w pozshift . All the operations are p erformed in O(log(N)) ti me per iteration a nd t he algorithm per forms O(N) iter ations, arrivin g at a time complexity of O(N·lo g(N)). 3. Mini m um Dissatisfactio n Scheduling with Increasing Optimal Employee Times This situatio n is si milar to the previous one, excep t that the op timal employee t imes te 1 , te 2 , …, te N are sorted in increasing order, i.e. te 1 ≤ te 2 ≤…≤ te N . There are also other restrictions: the number of activitie s is fixed to a given value k and they can be sche duled only at time moments equal to op timal emplo yee ti me m oment s. Furthermore, any two activities must b e scheduled at d ifferent time moments. We w ill en hance the model by considering the dissatisfaction of the e mployer in the following way: if a n activity is sc heduled at time moment te j , the n the employer’s dissatisfactio n will be de j ≥ 0. T he obj ective is to minimize the o verall dissatisfact ion (the dis satisfaction of the employees plus the d issatisfaction of the e mployer). We will solve t his prob lem by d ynamic programming. We will compute two sets of values: D min [i,j,0] and D min [i,j,1]:  D min [i,j,0]=the m inimum overall dissatisfaction if t he i th activity is scheduled at ti me te j (and all the employees 1,2 ,…,j are assigned to one of t he activities 1,2,..,i)  D min [i,j,1]=the m inimum overall dissatisfaction if the i th activity is sc heduled at a time moment t ≤ te j (and all the e mployees 1,2,…,j are assi gned to one of t he activities 1,2,..,i) We have the follo wing recurrence equations: } ) ( ] 1 , ' , 1 [ { min ] 0 , , [ 1 ' m in ' 0 m in            j j p p j p j j j te te w de j i D j i D } ) ( ] 0 , ' , [ { min ] 1 , , [ 1 ' ' m in ' 1 m in          j j p j p p j j te te w j i D j i D The initial values are: D min [0,0,0]=D min [0,0,1]=0 and D min [0,j,0 ]=D min [0,j,1]=+ ∞ (for j>0). The minimum overall dissatisfaction is equal to D min[k,N,1] and the activity schedule and assignment of e mployees to activities can be determined b y traci ng back the way the D min [i,j,p] values were co mputed. A naive algorit hm implements the equatio ns directl y and has time complexity O(N 2 ·k), considering that we ca n evaluate in O(1) time the s ums with the p argument. We can achieve this by computing the ar rays wsum , wright and wleft :  wsum[i] = the sum o f the weights of t he employees 1,2,…,i; wsum[0]=0 and wsu m[i] = wsum[i-1]+w[i]  wright[i] = the total d issatisfaction of the e mployees i, i+1, …, N, if they are assigned to a n acti vity scheduled at time te N ; w right[N+1]=0 ; wright[i] = wright[i+1]+ w i ·( te N - te i )  wleft[i] = the total d issatisfaction o f the e mployees 1, 2,…,i, if the y are assigned to an activity scheduled at time te 1 ; wleft[0]=0 ; w left[i] = wleft[i-1] + w i ·( te i - te 1 ) With these arrays, we can write      j j p p j p te te w 1 ' ) ( as (w right[j’+1] – wright[j+1] – (wsum[j] – w sum[j’ ])· ( te N - te j )) . Similarly,      j j p j p p te te w 1 ' ' ) ( is eq ual to (wleft[j] - w left[j’] -(wsum[j] -w sum[j’ ])· ( te j’ - te 1 ). We can improve the al gorithm to O(N·K) , b y introducing the following concepts : for each activity i (1≤i≤k) and each e mployee j (1≤j≤ N ), we will define t wo funct ions: f i,j and g i,j , which will b e used in o rder to compute t he values D min [i,j,0] and D min [i,j,1]. T he functions f i,j are d efined on the i nterval [ te j , te N ] . f i,j (te p ) represents t he minimum dissatisfaction of t he e mployees 1 ,2,…,p if i ac tivities were scheduled, the i th activity is scheduled at time te p and the e mployees j , j +1, .., p are assigned to activity i. With this de finition, D min [i,j,0] is the minimum v alue f i,j’ (te j ) ( 0≤ j’j , then the function f i,j will never hav e the minimum value (among all the functio ns) at an y of the subsequent steps.  if the va lue of a functio n f i,j (te p+1 ) is smaller than the value o f a functio n f i,j’ (te p+1 ), with j’>j , then the function f i,j will be “ surpassed ” by the fu nction f i,j’ at a time mome nt t surpass, i,j ,j’ ; f i,j’ will not ha ve the minimum value among all the functions f i,j (j≤j’) before a time moment equal t o the maximum val ue of the set {t surpass,i, j,j’ |jj’. Thus, the time moment when the function f i,j’ surpasses the function f i,j is t surpass,i,j,j’ =te j’ +dC/( dP j - dP j’ ). In order to compute the values D min [i,j,1], we will proceed in a similar manner. We will define so me functio ns g i,j :[wsum[j], wsum[N]], whose value s g i,j (w sum[p]) represent the minimu m dis satisfaction of t he e mployees 1,2,…,p, if the i th activit y is scheduled at ti me te j a nd the employees j , j+1, …,p are assigned to acti vity i. T hese functions are defined on t he partial sums o f the weights of the e mployees, in order to be able to use a similar reasoning. Ever y functio n g i,j will be a half -line ( with constant slope) in b etween two “consecutive” poi nts wsum[j’ - 1] and wsum[j’]. The slope of a function g i,j will be, acco rding to this de finition, eq ual to te j’ - te j . The pseudocode o f the algorithm is given belo w: DPPersonnelScheduling : compute the arrays wsum, wright and wleft initialize D min [0,j,0] and D min [0,j,1] (0≤j≤N) for i=1 to k do dq 0 =empty; dq 1 =empty for j=0 to k-1 do D min [i,j,0 ]= D min [i,j,1 ]=+∞ for j=k to N do // clean up the front of dq0 while ( dq 0 .size()>1 ) and ( dq0.getSecond().t early 1 ) and ( dq 1 .getSecond().w e

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment