A Quadratic Edge-Finding Algorithm
for Cumulative Resource Constraints
R. Kameugne1,2
L.P. Fotso2
Y. Ngo-Kateu2
1
2
J. Scott3
Department of Mathematics
University of Maroua
Departments of Mathematics and Computer Science
University of Yaoundé
3
ASTRA Group, Computing Science Division
University of Uppsala
SweConsNet, 2011
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Overview
Edge-๏ฌnding is a ๏ฌltering algorithm used in constraint-based
scheduling applications
For disjunctive scheduling, there are edge-๏ฌnding algorithms
with complexity of (๐ log ๐).
For cumulative edge-๏ฌnding, the best algorithm to this point was
(๐๐ log ๐) [Viliฬm, 2009].
Today I will present an algorithm for cumulative edge-๏ฌnding in
๐2 time.
โข Complexity doesnโt strictly dominate previous algorithms, but
offers a practical improvement.
2. SweConsNet | Quadratic Edge-Finding
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Outline
1. Introduction: Cumulative Scheduling
2. Edge-Finding
3. A Quadratic Algorithm
Minimum Slack and Maximum Density
Filtering Algorithm
4. Experimental Results
3. SweConsNet | Quadratic Edge-Finding
Results
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
The cumulative resource scheduling problem
Set of tasks ๐ , sharing a ๏ฌnite resource of constant capacity .
Inelastic: task has ๏ฌxed resource requirement ๐ and duration ๐
โข Energy of the task is ๐ = ๐ โ
๐
Non-preemptive: task may not be interrupted once started.
A task is bounded by earliest and latest start times, est and lst .
โข With ๏ฌxed ๐, can reason on last completion time lct instead.
est ๐ = 0
lst ๐ = 7
๐๐
4. SweConsNet | Quadratic Edge-Finding
๐๐
๐๐
.
0
lct ๐ = 10
5
10
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
The cumulative resource scheduling problem
Raise several of these concepts to apply to a set of tasks ฮฉ:
est ฮฉ = min est ๐
lct ฮฉ = max lct ๐
๐โฮฉ
๐โฮฉ
eฮฉ =
e๐
๐โฮฉ
est ๐ด,๐ท = 0
lct ๐ด,๐ต,๐ถ = 5
๐ถ
lct ๐ท = 10
๐ท
๐ด
๐ต
.
0
est ๐ต,๐ถ = 2
example due to [Viliฬm, 2009]
5. SweConsNet | Quadratic Edge-Finding
5
10
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
The cumulative constraint
Need to ๏ฌnd a start time for each task, so that at any given time
the tasks that are executing do not require more of the
resource than is available.
The cumulative constraint enforces the rule:
โ๐ก
๐๐ โค
๐โ๐
๐ ๐ โค๐กโค๐ ๐ +๐๐
Will only enforce bounds consistency
โข Try to tighten earliest and latest start times
โข Not concerned with infeasible start times inside the domain
cumulative is NP-complete
โข Polynomial time ๏ฌltering algorithms for cumulative, such as
edge-๏ฌnding, apply relaxations of the constraint
6. SweConsNet | Quadratic Edge-Finding
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Edge-๏ฌnding detects required ordering
Consider the set of tasks ฮฉ = {๐ด, ๐ต, ๐ถ}.
Is there a feasible schedule in which ฮฉ and ๐ท both end by lct ฮฉ ?
โข If not, ๐ท must end after the end of every task in ฮฉ.
eฮฉโช{๐ท} >
โ
(lct ฮฉ โ est ฮฉโช{๐ท} ) โน ฮฉ โ ๐ท
est โ๐ท = 3
est ฮฉ = 0
๐ถ
lct ฮฉ = 5
lct ๐ท = 10
๐ท
๐ด
.
0
8. SweConsNet | Quadratic Edge-Finding
๐ต
5
10
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
How much can the bound be updated?
Consider eฮฉ in two parts:
โข energy which may be scheduled without affecting ๐ท,
โข and the rest , which must affect ๐ท.
est ฮฉ = 0
rest(ฮฉ, ๐๐ท )
.
๐ท
๐ท
est โ๐ท = 3
0
rest(ฮฉ, ๐๐ ) =
10
5
eฮฉ โ( โ ๐๐ )(lct ฮฉ โ est ฮฉ )
0
est โ๐ โฅ est ฮฉ +
9. SweConsNet | Quadratic Edge-Finding
lct ๐ท = 10
lct ฮฉ = 5
rest(ฮฉ, ๐๐ )
๐๐
if ฮฉ โ โ
otherwise
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Must consider subsets of ฮฉ
{๐ต, ๐ถ} not energetic enough to require {๐ต, ๐ถ} โ ๐ท.
{๐ด, ๐ต, ๐ถ} โ ๐ท, and lct ๐ด,๐ต,๐ถ โฅ lct ๐ต,๐ถ ,
โข therefore ๐ท must end after lct ๐ต,๐ถ .
est ๐ท = 0 est ๐ต,๐ถ = 2
lct ๐ต,๐ถ = 5
lct ๐ท = 10
๐ท
.
0
est โ๐ท = 4
5
Must ๏ฌnd ฮ โ ฮฉ that yields the strongest update.
10. SweConsNet | Quadratic Edge-Finding
10
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
The Edge-Finding Rule
โ
โ
rest ฮ, ๐๐
est โ๐ = max โest ๐ , max max est ฮ +
ฮโฮฉ
ฮฉโ๐
โ
๐๐
๐โฮฉ rest ฮ,๐๐ >0
โ
๐ผ(ฮฉ,๐)
โ
โ
โ
โ
โ
โ
โ
with
๐๐๐
๐ผ (ฮฉ, ๐) =
lct ฮฉ โ est ฮฉโช{๐} < ๐ฮฉโช{๐} โจ est ๐ +๐๐ โฅ lct ฮฉ
rest ฮ, ๐๐ =
๐ฮ โ
0
โ ๐๐
lct ฮ โ est ฮ
if ฮ โ โ
otherwise
(The rule for adjusting lct is symmetric.)
11. SweConsNet | Quadratic Edge-Finding
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Task Intervals
An edge-๏ฌnder only needs to consider task intervals:
all the tasks that must be scheduled within a ๏ฌxed window.
est ๐ด,๐ต,๐ถ = 0
est ๐ด,๐ต = 0
lct ๐ด,๐ต,๐ถ = 5
lct ๐ด,๐ต = 5
๐ถ
๐ด
๐ด
๐ต
.
0
.
5
0
De๏ฌned by upper and lower bound tasks:
ฮฉ๐
๐ฟ = ๐ โ ๐ โฃ est ๐ โฅ est ๐ฟ โง lct ๐ โค lct ๐
To update est ๐ , only need to consider:
โข ฮฉ๐
๐ฟ such that lct ๐ < lct ๐
โข ฮ๐ข๐ such that est ๐ฟ โค est ๐ โค lct ๐ข โค lct ๐
12. SweConsNet | Quadratic Edge-Finding
๐ต
5
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Complexity
Naive: compare all tasks with all pairs of intervals.
โข
๐5
Precompute potential updates outside
the precedence detection loop.
๐3
โข Can reduce to
๐๐2 , where ๐ is the number of distinct
resource requirements [Mercier and Van Hentenryck, 2008].
โข
ฮ-tree: use a binary tree to compute
one bound of each interval [Viliฬm, 2009].
โข
(๐๐ log ๐)
Quadratic
โข Previous
incomplete.
13. SweConsNet | Quadratic Edge-Finding
๐2 algorithm [Baptiste, et al., 2001] was
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
De๏ฌnition: Slack
Slack is a measure of the capacity that is not required by the
tasks of an interval ฮฉ:
๐๐ฟ(ฮฉ) = (lct ฮฉ โ est ฮฉ ) โ ๐ฮฉ
est ๐ด,๐ต,๐ถ = 0
lct ๐ด,๐ต,๐ถ = 5
๐ถ
๐๐ฟ
๐๐ฟ({๐ด, ๐ต, ๐ถ}) = 5
๐ด
.
0
15. SweConsNet | Quadratic Edge-Finding
๐ต
5
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Minimum Slack
For an upper bound ๐ and a task ๐, there is a lower bound
๐(๐, ๐) with est ๐(๐,๐) โค est ๐ which de๏ฌnes the interval of
minimum slack:
๐
โ๐ฟ โ ๐, est ๐ฟ โค est ๐ โถ ๐๐ฟ ฮฉ๐
๐(๐,๐) โค ๐๐ฟ ฮฉ๐ฟ
For an ฮฉ โ ๐ and task ๐ โ ฮฉ
ฮฉ โ ๐ โบ e๐ > ๐๐ฟ ฮฉ๐
๐(๐,๐)
If ฮ๐ข๐ โ ฮฉ is the interval responsible for the maximum est โ๐ , and
est ๐ โค est ๐ , then:
est โ๐
16. SweConsNet | Quadratic Edge-Finding
โก rest ฮ๐ข๐(๐ข,๐) , ๐๐
= est ๐(๐ข,๐) + โข
๐๐
โข
โข
โค
โฅ
โฅ
โฅ
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
De๏ฌnition: Density
For a task interval ฮ, the density of ฮ is given by:
eฮ
๐ท๐๐๐ (ฮ) =
lct ฮ โ est ฮ
est ฮ = 0
lct ฮ = 5
est ฮ = 0
lct ฮ = 5
๐ถ
๐ด
.
0
17. SweConsNet | Quadratic Edge-Finding
๐ท๐๐๐ (ฮ)
๐ต
.
5
0
5
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Maximum Density
For an upper bound ๐ข and a task ๐, there is a lower bound ๐(๐ข, ๐)
with est ๐ < est ๐(๐ข,๐) which de๏ฌnes the interval of maximum
density:
โ๐ โ ๐, est ๐ < est ๐ โถ ๐ท๐๐๐ ฮ๐ข๐(๐ข,๐) โฅ ๐ท๐๐๐ ฮ๐ข๐
If ฮ๐ข๐ โ ฮฉ is the interval responsible for the maximum est โ๐ , and
est ๐ < est ๐ , then:
est โ๐
18. SweConsNet | Quadratic Edge-Finding
โก rest ฮ๐ข๐(๐ข,๐) , ๐๐
= est ๐(๐ข,๐) + โข
๐๐
โข
โข
โค
โฅ
โฅ
โฅ
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
for ๐ โ ๐ by increasing lct ๐ do
๐ธ๐๐๐๐๐ฆ โ 0, ๐๐๐ฅ๐ธ๐๐๐๐๐ฆ โ 0, est ๐ โ โโ, ๐๐๐๐๐ฟ โ โโ
for ๐ โ ๐ by decreasing est ๐ do
if lct ๐ โค lct ๐ then
๐ธ๐๐๐๐๐ฆ โ ๐ธ๐๐๐๐๐ฆ + e๐
if lct๐ธ๐๐๐๐๐ฆ
> lct๐๐๐ฅ๐ธ
then
โ est
โ est
๐ข
๐
๐
๐
๐๐๐ฅ๐ธ โ ๐ธ๐๐๐๐๐ฆ, est ๐ โ est ๐
else
๐ท๐ข๐๐๐ โ max ๐ท๐ข๐๐๐ , est ๐ +
๐๐๐ฅ๐ธโ( โ๐๐ )(lct ๐ โ est ๐ )
๐๐
๐ธ๐ โ ๐ธ๐๐๐๐๐ฆ
for ๐ โ ๐ by increasing est ๐ do
if (lct ๐ โ est ๐ ) โ ๐ธ๐ < ๐๐๐๐๐ฟ then
est ๐ โ est ๐ , ๐๐๐๐๐ฟ โ (lct ๐ โ est ๐ ) โ ๐ธ๐
if lct ๐ > lct ๐ then
๐๐๐ ๐ก โ ๐๐ (lct ๐ โ est ๐ ) โ ๐๐๐๐๐ฟ
if est ๐ โค lct ๐ โง๐๐๐ ๐ก > 0 then
๐๐ฟ๐ข๐๐๐ โ max ๐๐ฟ๐ข๐๐๐ , est ๐ +
if ๐๐๐๐๐ฟ โ e๐ < 0 then
๐ฟ๐ต โ max(est ๐ , ๐ท๐ข๐๐๐ , ๐๐ฟ๐ข๐๐๐ )
20. SweConsNet | Quadratic Edge-Finding๐
๐๐๐ ๐ก
๐๐
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Completeness
The quadratic algorithm in [Baptiste, et al., 2001] is weaker than
edge-๏ฌnding (misses some bound updates).
The algorithm presented here correctly detects all ฮฉ โ ๐.
Will not always make the strongest update on the ๏ฌrst iteration,
but will make some update.
โข Does make the strongest update if:
โถ est โค est , or
ฮ
๐
โถ est < est โค est .
๐
ฮ
๐
โข Otherwise, requires ๐ โ 1 iterations in the worst case.
โLazyโ evaluation, which makes sense for ๏ฌltering algorithms.
21. SweConsNet | Quadratic Edge-Finding
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Experimental Results
Implemented in Gecode (3.4.2)
โข Compared with existing implementation of the cumulative
ฮ-tree ๏ฌlter
โข Propagators executed each edge-๏ฌnding ๏ฌlter in sequence with
time-tabling and overload checking.
Benchmarks from the PSPLib single-mode sets: 480 instances
each of 30, 60 and 90 tasks.
On average, less than 1% difference in number of propagations
required to ๏ฌnd solution.
โข For J60 and J90, the quadratic propagator ranged from <2%
fewer propagations to <5% more.
โข For J30, one instance of 30% fewer, another of 15% more.
23. SweConsNet | Quadratic Edge-Finding
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Runtime Comparison
PSPLib Single-Mode RCSP benchmarks J30, J60, and J90
Quadratic runtimes (sec)
250
j30
j60
j90
200
150
100
50
0
0
50
100
150
ฮ-tree runtimes (sec)
24. SweConsNet | Quadratic Edge-Finding
200
250
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Summary
Using a combination of minimum slack and maximum density,
cumulative edge-๏ฌnding can be performed in
๐2 time.
Reaches same ๏ฌxpoint as a complete edge-๏ฌnder,
but may take additional iterations to ๏ฌnd it.
While not strictly dominating (๐๐ log ๐) ฮ-tree edge-๏ฌnding,
experimental results suggest quadratic edge-๏ฌnding is faster in
practice.
Further work:
โข
๐2 extended edge-๏ฌnding (in preparation)
โข Is it possible to use a ฮ-tree to reduce the complexity further?
25. SweConsNet | Quadratic Edge-Finding
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Thanks to. . .
The Swedish Research Council, as the fourth author is
supported by grant 2009-4384;
Christian Schulte, for providing a patch for the Gecode
cumulative propagator;
and last but not least: to all of you, for your attention today.
Questions?
26. SweConsNet | Quadratic Edge-Finding
Conclusion
Introduction
Edge-Finding
Quadratic EF
. . . . . .
Results
Conclusion
Further Reading
P. Baptiste, C. Le Pape, and W.P.M. Nuijten
Constraint-based scheduling: applying constraint programming to scheduling
problems
Kluwer, 2001
L. Mercier and P. Van Hentenryck
Edge ๏ฌnding for cumulative scheduling
INFORMS Journal on Computing, 20:143โ153, 2008
P. Vilím
Edge ๏ฌnding ๏ฌltering algorithm for discrete cumulative resources in
O(kn log n)
In I.P. Gent, ed., CP2009 (LCNS 5732) , pp. 802โ816, 2009.
Springer-Verlag
27. SweConsNet | Quadratic Edge-Finding
© Copyright 2025 Paperzz