Scheduling Conflicting Jobs: Problems and Techniques Guy Kortsarz, Rutgers University, Camden

Download Report

Transcript Scheduling Conflicting Jobs: Problems and Techniques Guy Kortsarz, Rutgers University, Camden

Scheduling Conflicting Jobs:
Problems and Techniques
Guy Kortsarz, Rutgers University,
Camden
1
Scheduling dependent jobs
Jobs compete on resources
Create a graph. Each job is a vertex.
Two vertices are adjacent if dependent
Two possibilities:
Single unit jobs
Jobs that require more than one unit of
processing
Two conflicting jobs can not be executed
at the same time unit
2
Relation of single units jobs to
graph coloring
•
•
Given a graph G, find
a mapping :VN so
that if (v)=(u) then
uvE
Objective, usually, is
to minimize the
number of colors
used.
Classic applications:
Timetabling, frequency allocation
3
Multicoloring bipartite graphs
3
4
2
2
1
4
4
Multicoloring bipartite graphs
3
4
2
2
1
4
5
Formal definition of the
multicoloring problem
• Input: Graph G=(V,E), with lengths x(v) on
the vertices
• Output: An assignment :V 2N such that
adjacent vertices do not receive
overlapping times. (v)(u)   implies
that uvE
• Goal: minimize the maximum integer:
• Minimize MaxuV { f(u) }
• f(u)- The largest color of u.
6
Multicoloring is often easy
6-clique
More generally, chordal graphs, even perfect,
are no harder to multicolor than to color.
Maybe one reason why multicolorings are not
more common.
7
Some other objectives than
makespan (= number of colors)
•
•
•
•
Sum of completion times of jobs
– For each vertex, count the last time unit
assigned, and sum these values up
Weighted sum of completion times
– Vertices additionally have importance value
attached
Total lateness
– Assumes deadline for each task
Sum of flow times
– Assumes release time of each job
8
“Sum of completion times” in Graph
coloring?
•
•
•
Recall we color with numbers, :VN
Sum of a coloring = Sum of the values assigned to
the vertices
Sum coloring problem:
– Find a coloring that minimizes the chromatic
sum,
 (v)
vV
•
This measure is more favorable to the users (as
a whole), while the makespan is desired by the
system (machines)
9
The Sum Multicoloring problem
 Each vertex v V requires x(v)  1 distinct colors.
 A proper coloring of G is a function Ψ: V → 2N, such that
adjacent vertices are assigned distinct sets of numbers
(colors). Let fΨ(v) denote the maximum color assigned to v
by Ψ.
 The sum multicoloring (SMC) problem: find a multicoloring
Ψ that minimizes vV fΨ(v).
• The preemptive model (pSMC): each vertex can get
any set of colors.
• The no-preemption model (npSMC): assign to each
vertex a contiguous set of colors.
10
Is “Sum coloring” any different
from ordinary coloring? YES!
12
1
2
3
11
11
Ok, isn’t at least the sum of an
ordinary coloring “good enough”?
Factor k for kchromatic
graphs.
Any 3-coloring has sum of 2n...
... while a certain 4-coloring has sum of n+6
12
Applications
• Wire minimization in VLSI design; The
conflict graph is an interval graph
• Train scheduling; Permutation graphs
• Minimizing distance in storage allocation;
Interval graphs
• Session scheduling in path arrays
• Biprocessor scheduling; Line graphs
• Data migration; Line graphs
• Dynamic storage allocation; Interval graph
• Open shop scheduling; Line graphs of bipartite
graphs
13
Some interesting results in sum
coloring; Upper bounds
•
•
•
NP-hard on planar graphs, but approximation scheme
(PTAS) exists. Halldorsson, K.
Bipartite graphs: 27/26 approximation.
The following problem is polynomial: Color the vertices
by 3 colors, so that the sum is minimized but the third
color-class may not be an independent set.
M. Malafiejski , K. Giaro, R. Janczewski and M. Kubale
Approximable within factor 4, with an oracle for Max
Independent Set
It was well known that produces O(log n) colors
Bar-Noy, Bellare, Halldorsson, Schachnai,Shapira
14
Some hardness results
• APX-hard on bipartite graphs. [Bar-Noy,
K. 98]
• Sum coloring is as hard as Graph Coloring
in general, i.e. n1-o(1) -approximation
hardness [Feige-Killian 96, Bar-Noy+ 96]
• Therefore, SMC is at least as hard.
• APX-hard on interval graphs [Gonen 01]
• Open shop scheduling APX-hard;
[Hoogoveen, Shurman and Woeginger 98]
• Hardness not well understood
15
Very Few Exact Results
• Sum multicoloring non preemptively of trees is
in P. [Halldórsson, K, Proskurowski, Salman,
Shachnai and Telle]
• Preemptive sum multicoloring of Paths is in P.
An ICALP paper (!) [Kovács]
• Preemptive coloring of trees is NPC (!) [Marx]
• See the collection of papers maintained by
Daniel Marx for more results:
http://www2.informatik.huberlin.de/~dmarx/sum.php
16
Tools and techniques
“The craftsman is known by his tools”
17
Techniques
Geometric series and randomization
Grouping by length
Universal colorings
Delaying long vertices
Reducing to Independent Set, via SC
Rounding and scaling
Reducing sum to makespann
LP techniques
18
A simple guessing game
•
•
•
Player A decides on a number x.
Player B tries a sequence x1, x2, ..., of
guesses until it finds xi that Player A says
satisfies xi ≥ x.
The value of the game is the performance
ratio
 xi

i
x
19
A simple deterministic strategy
• Guess 1, 2, 4, 8, 16, ...
• Performance ratio of 4:
– The last number is at most 2x
– The next-to-last number is less than x
– The previous numbers are a geometric
series, at most x.
• Bad instance:
– x=2k+1, then =(2k+2-1)/(2k+1)  4
• This is also best possible...deterministic.
20
Lower bound on a deterministic
algorithm
• We show that no deterministic
approximation can have ratio better
than 4-
• Let >0 be a small enough constant
• xi=iji-1 xj;
• xi+1=µixi
21
Assumptions
• The start point assumption:
x1  max{4,1/}
Otherwise, wait for the guess to be large
enough
• We may assume that i 4.
Otherwise the adversary waits a bit and
then stops. Declares x=xi+1.
• The ratio is
(4xi+xi)/(xi+1)=5xi/(xi+1)4
The last inequality follows as x14
22
Strategy for an adversary
• Stopping condition: If at some iteration
µi (1-/8)(1+i)
the adversary stops and says x=xi+1
• Else: let r=x2/x1 and =8ln (3/r)/
• If for +2 times the stopping condition
does not apply then the adversary stops
• Answers: your last guess xq equals x
23
Analysis
•
•
If at one of the +2 iterations
µi (1-/8)(1+i)
The ratio is:
(1/i +1+µi)xi/(xi+1)  4-
The last inequality is proved using:
1)  small enough
2) i 4
3) x1  1/2
4) x2+1/x  2 for every x
24
If +2 consecutive failures
• For every i: i+1=µii/(i+1)  (1-/8) i
• Thus +2<(1-/8)<1/3
• Thus: 3xq< j q-1 xj
• The ratio is at least: (xq+3xq)/xq=4
25
A randomized strategy
• Defeat the worst-case instance, by
randomizing the initial guess.
• Work in the log scale
– Choose an arithmetic series with a
fixed multiple; for instance, e.
– Randomize the starting point, R[0,1)
– Define guess xi = ei+
0

+1
+2
+3
log length
+4
26
•
Analysis of randomized
strategy
Write x=et, or t = ln x and
let i=i be such that i-1+ ≤ t ≤ i+.
i 
E[x i]  E[ e ]  E[e
•
]  e  E[e
t
i  t
] x
As  ranges from 0 to 1, i+ -t also ranges
uniformly from 0 to 1.
i-2
•
i  t
Thus,
t
i-1
i
1
E[e i t ]  E[e ]   et dt  (e  1)
t 0
27
Analysis, cont.
•
The expected amount spent by the algorithm is
then
i
i
j 0
j 0
E[ x j ]  E[  e
•
i 
]  E[e
i  1
/( e  1)]  e  x
Hence, a performance ratio of 2.71
28
Applications of strategy
• Geometric series has been used on different
measures for different problems
– Lengths of vertices [BBHST’98]
Non-preemptive SMC of bipartite graphs
– Maximum k-colorable subgraph [HKS’01]
Sum coloring interval graphs
– LP values of vertices [GHKS, WAOA’04]
SMC of line graphs (pre and non-pre) and
interval graphs (non-pre)
• All, in some sense, are lower bounds on the
optimal solution
29
Grouping by length
• The challenge of multicoloring is that
vertices can have widely divergent
lengths
• Handling separately vertices with
roughly similar lengths often
simplifies the problem
• It is also natural to expect that
vertices of like length go together
30
Grouping by length
•
Divide the real line into segments:
V1
V2
V3
V4
V5
length
•
•
Vertices of lengths that fall within the same
induce a subproblem that is solved separately.
Subsolutions are pasted together in order to
produce final solution
31
How to group
VSMALL
VBIG
length
• Cost of whole (given that we break)=
Cost of coloring VSMALL
+ | VBIG | * #colors used on VSMALL
+ Cost of coloring VBIG
• Avoid
x
x xx
SMALL
x
x
BIG
32
The Markov Inequality: Several
Break Points
• The Markov inequality: Given a collection of n
positive numbers with average µ :
• |{ ai | ai  2µ }| n/2
• |{ ai | ai  3µ }| n/3
• What happens if we consider all break points r,
r+1, r+2,…….,s? Can we get a point where there are
less than 1/i numbers that are at least i times the
average?
33
The basic breakpoint lemma
Consider the collection of breakpoints
r,r+1,…..,s
There exists r  j  s so that:
|{ ai | ai  jµ }| n/(j ln(s/r))
34
Breakpoint lemma [Halldorsson,K ’98]
• Can break into size groups BIG and
SMALL such that
– The largest item in SMALL is negligible
in comparison with the average item in
BIG
• Thus, if the number of colors used is
proportional to the largest item, then the
cost of breaking up is minor
– Holds for constant-colorable graphs
Breakup overhead = | VBIG | * #colors used on VSMALL
35
Breakpoint Lemma
•
For any q, there is a sequence of breakpoints bi
satisfying
bi
q
q
bi  1
such that the total breakpoint overhead is at
most
1
ln q
b1
b2
  xi 
i
1
ln q
b3
 OPT
b4
36
PTAS for planar graphs of roughly
equal length vertices
•
•
Let [a,b] be the range of vertex lengths
Round the lengths of the jobs to a multiple of a
  factor overhead
• Scale the lengths by a factor [-2 , -1b/a]
 No overhead for nonpreemptive problems
• Baker decomposition into k-outerplanar Gk and
outerplanar and small GO.
• Solve optimally by dp, but truncate the coloring
after (1/)b/a colors.  Cost ≤ OPT
• Finish by 4-coloring GO and remaining vertices
 Cost of O(n/k)* c (1/)b/a ≤  n/c when k >> -2 (b/a).
37
Input graph G
Round and scale, by factor of a
Baker’s decomposition
Solve optimally by DP
Color with minimal
amount of colors
Retain the (1/)b/a
smallest colors
Combine
Output a coloring
38
Preemptive multicoloring of planar
graphs
• A general tool for O(1) makspan coloring:
preemptive scaling.
We are able to reduce job lengths paying
only (1+)
• Claim 1: Say that all x(v) are divisible by q.
Then then if x(v)/qc ln n for every v then:
(I) q(I/q)(1+)(I)
39
Proof
• Take the optimum for I
• Include every independent set with
probability (1+’)/q in a solution for I/q
• With constant probability the makespan is
not larger than (1+’)(1+ ’’) (I)/q
• By the Chernoff bound and the union bound
every vertex gets at least x(v)/q
scheduling units
40
A general lemma on reducing jobs
lengths
• Assume that a graph is constant colorable
• It is possible to reduce all job lengths to
O(log n) with only (1+) penalty
• The number of preemption can be reduce to
O(log n)
• This holds true even if tasks are initially of
size exponential in n (!)
41
Proof
• Split jobs to (roughly) log n most significant
bits and the rest
• The large parts of numbers are all divisible by some
large q
• Reduce these numbers to log n bits (small loss). The
O(log n) is derived
• Color firs by round robin the small parts nonpreemptively
• Small delay because constant colors and small
numbers
• Then take the solution to the O(log n) instance
• The coloring for x’/q is repeated q times
42
Planar decomposition
• A planar graph G can be decomposed into
two graphs G’ and G’’ so that:
• G’ has treewidth k2
• G’’ has treewidth 2, and color requirement
sum O(S/k2)
• If we have an approximation for p-SMC for
graphs with treewidth k, we can use to get
c’ and c’’ for G’ and G’’
• To get the combine coloring: Each k color
classes of c’ put one of c’’
43
Universal family of colorings
• Works for graphs that have constant treewidth
• It is a family of colorings so that for every
instance there exists a coloring in the family that
approximates the SMC by (1+) factor
• The key property: the number of different
colorings of v in the family is polynomial in n
• This allows finding the best solution via DP if
treewidth constant
• The existence is proven by modifying OPT
44
A somewhat surprising fact
• The colorings in our family depend only on a
specific k-coloring of the graph, on n and
on p
• In particular, it does not depend on the
actual connections in the graph, nor on the
distribution of color requirements
• Hence the name universal
45
The universal family
• Split the colors of every vertex in powers
of (1+)
• Segment i: colors (1+)i to (1+)i+1
• In every segment, treat the coloring as a
makespann instance
• Thus in every segment O(log n) colors
• Make the number of segments in which a
vertex is colored, constant
46
How to bound # of segments
• For every vertex v, its colors that are
smaller than x(v) or larger than (2/)x(v)
are removed from OPT
• Instead they are replace by round robins
that are performed every (roughly) 1/
rounds
• The key: the number of “non-standard”
segments for every v is O(log 1+ (2 ) )
47
The number of preemption for v
In every segment v has O(log n)
preemptions
• # colors per segment clog n. Choose c’ log
n of them for v
• The number of possibilities for v is
O((2clog n) f() ) hence polynomial in n
• The round robin, executed only every 1/
rounds and adds O( opt)
48
Delay of large jobs
• This technique is illustrated via its
Application on two classical problems:
• 1) Data migration
• 2) Open shop scheduling
49
Data migration
pe
pe
pe
•
•
pe
Storage
Area
Networks
= length of data transfer along edge e
At most one active transfer per storage device
Minimize (weighted) sum of completion times of the
storage devices
pe
50
m1 3
Open Shop Scheduling
m2 4
m4 2
wt=40
Jobs
m1 2
m3 5
m4 3
m1
m2
wt=30
In
The
Sho
p
Out
m1 4
m2 1
wt=15
m3 6
m3
m4
m2 2
m3 2
m4 2
wt=100
51
Graph formulation of Open Shop
w 1= 0
0
0
0
v1
v2
v3
v4
Machines
v6
v7
v8
Jobs
30
100
15
pe=3 4
v5
2
w5= 40
• Assign interval (Ce-pe,Ce] to each edge e;
intervals of adjacent edges non-overlapping;
minimizing vV wvCv
(Cv = maxve Ce )
• minimizing eE weCe operation completion sum
is the SMC problem in bipartite line graphs
52
History
Data Migration
• Coffman+ ’85
• Kim ’03
• GHKS 05
2
9
5.06
makespan
 v wv C v
v wv Cv, rv
Open shop scheduling
•
•
•
•
Chakrabarti+ ’96
Hoogeveen+ ’98
Queyranne+ ’02
GHKS
05
5.78
fixed#
APX-hard fixed#
5.83
5.06
53
Problems with greediness
1
1
1
1
1
Q
Long job delays short ones
1
1
2
2
1
1
2
2
1
2
Q
Maximality can cause long delays
54
Linear programming relaxation
• From [Hall+ 96, Kim ´03]
• Let Ev = the set of edges incident on vertex v
• Let p(X) =  pe = sum of lengths of edges in set X
eX
(LP)
minimize
 wv Cv
vV
subject to:
Cv  Ce, for each edge e and incident vertex v
Cv  p(Ev),
for each vertex v
 pe Ce  ½ [p(Sv)2 + p(Sv2)], for any Sv  Ev
eSv
Ce  0,
for each edge e
•Solvable in poly-time using ellipsoid method [Queyranne]
55
Capacity inequality
e1
e2
e3
e4
e5
Sv
v
• When the edges are scheduled in some sequence,
without a break:
Denote pi = pei
p1
p2
p3
p4
p5
C1
C2
C3
C4
C5
i pi Ci = p1p1 + (p1+p2)p2 +..+(p1+p2+    +pt)pt
eSv
= ij pi pj
= ½ [(ij pi)2 + ij pi2] = ½ [p(Sv)2 + p(Sv2)]
56
Delay technique
An edge is...
• active for pe steps, once it becomes active.
• finished, after being active
• delayed, if an adjacent edge is active
• waiting, until it has waited We steps
• waiting/active/finished, if no active nbor
Priority rule:
If two adjacent edges can become active,
give priority to the smaller LP value
57
The first delay function
We = 1Ce*
Ce* is the value of Ce in LP sol.
• Theorem: With this weight function and 1 chosen
optimally, each vertex v completes within
5.83 Cv* steps
•  5.83 ratio
Same as Queyranne & Sviridenko!
58
The second delay function
Edges w/ LP-value  Ce*
Se(u)
u
e
Se(v)
v
We = 2 max (p(Se(u)), p(Se(v))
•  Also 5.83-ratio on per-vertex basis
•  5.0553-ratio by trying both weight functions,
and using the one that gives a better result
59
The last edge
incident on u that
the algorithm
completes
Proof outline: Ratio 6
Edges e w/ Ae < Aeu
Du
u
eu
Dv
v
• The algorithm’s completion time of u:
Au = Aeu = [Time eu is waiting] = Weu = Ceu*  Cu*
+ [eu is active]
By LP
 Cu*
}
+ [eu delayed by Du]
inequality
+ [eu delayed by Dv]
= p(Dv)
60
Bounding size by LP values
• Let Xt = {eEv : Ce* t} = edges incident on
v with LP-value at most t
• [Hall+’96] p(Xt)  2t
Proof follows from main LP-inequality.
• Tight example: 2t edges, pe = 1. All Ce*= t
1
1
1
1
1
61
Edge
in D with
Proof outline:
Ratio
6 largest
(cont)LP-value.
v
Du
u
eu
Dv
e’
v
• Time that eu is delayed by neighbors of v :
p(Dv)  2 Ce’* = 2 We’
If e’ is waiting, then edges incident on v are inactive
We’  [(eu waiting) + (eu delayed by Dv)]
 2 Cu*
• Algorithm’s completion time of u is then
Au = Cu* + Cu* + p(Dv)  2 Cu* + 2 We’  6 Cu*
62
Simulating the algorithm
We=pe
3
3
4
1
Waiting
Delayed
Active
Finished
2
1 2 3
63
Simulating the algorithm
We=pe
3
3
4
1
Waiting
Delayed
Active
Finished
2
1 2 3 4 5
64
Simulating the algorithm
We=pe
3
3
4
1
Waiting
Delayed
Active
Finished
2
1 2 3 4 5 6
65
A stronger property of the LP
• Recall Xt = {eEv : Ce* t}
Know p(Xt)  2t
• Suppose p(Xt/2) =t, what is then p(Xt) = t
• New:
p(Xt)  t + sqrt(t2 – 2  (t – t/c))
where  = p(Xt/c)
• E.g. if p(Xt/2) =t, then p(Xt) = t !
• Or, if p(Xt) =2t, then p(Xt/2) = 0 !
66
Combining weight functions
6
1=2=1
h()=2max(1,)+2
5
f()=(4-2)+4
4
0
1
2
 = p(Se(v)Dv )/Cu*
67
The Effect of Lambda
Du
u
eu
Dv
v
• If  = 2 then only “short” edges are
responsible for the delay of eu.
So, by the stronger LP property
p(Dv)  2 Cu* for a ratio of 4
68
Reducing sum multicoloring to
makespann
•
A general technique to reduce sum
problems to makespann problems
• Leads to the first constant approximation
for SMC non-preemptively interval graphs
• Independently invented by Queyranne and
Sviridenko (a few months before us). But
we gave new applications
69
The Generic Algorithm
ACS(G,q)
r uniformly random in (0,1].
i  0, mi  1
while (G  ) do
ci  max(1, qi+r)
Gi  DualThruput(G, ci)
Approximate
throughput with
resource
augmentation
Color Gi next
(with new colors mi, mi+1,…, mi+ ci-1)
G G- Gi, mi+1  mi+ci,,, i  i+1
end
=d*
70
Approximating Non-preemptive SMC
Overview:
• Formulate npSMC as an integer program. Find an optimal
fractional solution, f*(v), for all v V. Let Ft be the set of
vertices with f*(v)  t, then f*(v) satisfies
Property 1: max vFt f*(v)  (Ft)/d, for some d  1, where
(Ft) is the maximum weight of any clique in Ft.
• Partition the time axis into intervals (cm-1, cm], m=1,2…, M,
and let Vm={v V: f*(v) (cm-1, cm] }.
• Let A be an approximation algorithm for graph
multicoloring that uses  (Vm) colors for Vm.
71
Approximating npSMC (Cont’d)
• Assign colors to the vertices in Vm using algorithm A.
• Let u be the vertex satisfying f*(u)= maxvVm f*(v),
then, by Property 1, f*(u)  (Vm)/d, for some d  1; the
largest color assigned to any vertex v by A is
fv   (Vm)   d f*(u)
• Suppose that cm /cm-1  , for some   1, then we get a
 d – approximation for npSMC.
In general, we can argue that d=2. An algorithm of
[Gergov 1996] achieves the ratio =3 for multicoloring
interval graphs. By optimizing on  we have:
Theorem: There is a 11.273 approximation algorithm for
npSMC on interval graphs.
72
Application for sum-coloring
• The sum set-cover problem was studied by
Feige, Lovats and Tetali. The motivation:
Heuristics for speeding Semidefinite
solvers
• Input: G(A,B,E) as in Set-cover
• Output: An ordered subset S={a1,…,ak}A and a
function :BS so that (b,(b)) E
• The input is as in set-cover and the output too
except that the set-cover is ordered
73
Objective function
• Let Bi={b B | (b)=ai}
• Intuitively, Bi the set of ``jobs” covered
at time i.
• Objective function:
Minimize: i i |Bi|
• Example: If vertices in A represent
independent sets in a graph, we get
sum-coloring
74
Approximation results
• Bar-Noy, Bellare, Sachnai and Shapira
showed: The algorithm that iteratively
picks an maximum independent set gives
ratio 4 (if IS can be found in poly time)
• The same proof implies: the classic greedy
algorithm has ratio 4 approximation for
minimum sum set-cover
75
Lower bound
• Bar-Noy, Halldorsson, K.
There is a (rather complex)
example where the greedy maximum
independent set algorithm has indeed ratio 4
• Feige, Lovats and Tetali: The lower bound
for greedy MIS of [BHK] can be adapted to
show that unless P=NP no 4- ratio is possible
for sum set-cover for any constant 
76
Better result for sum-coloring
• The following was shown by Gandhi,
Halldorsson, K. and Shachnai
• The reduction from sum to makespann
gives an 3.591 approximation algorithm
for sum-coloring assuming a maximum
independent set can be found
• This ratio can be apllied for all PERFECT
graphs
77
Open problems
• For graphs that admit a polynomial time
exact algorithm for maximum independent
set is there an O(1) for npSMC on this
class? Example: Chordal graphs(?)
• Lower bounds (maybe 4??) for open shop
scheduling? The only APX hardness has a
very small constant [Hoogeveen, Schurman
and Woeginger 98]
• Can minimum makespann of PLANAR graphs
be approximated within 4/3?
Ratio 2 easy: 4-colorable, Bip graph
solvable
78