Backmarking
The backmarking technique is implemented as fol-
lows. Firstly, the time horizon is infinite so that
the structures BackTo and Mark cannot be simple
two-dimensional arrays but arrays of dictionaries.
Precisely, BackTo is an array of size n, BackTo[i]
is a dictionary, where keys are the (attempted)
start times of the activity, and values are activities,
i.e., BackTo[i][newVal] is the lowest-indexed activity
whose instantiation has changed since activity A
i
was
last tried to be allocated at time newVal.
As to the structure Mark, there is one difference.
Notice that when the algorithm cannot find an avail-
able resource for activity A
i
at time newVal, not only
one, but a number of activities may be added to the
conflict set of A
i
. Consequently Mark[i][newVal] is
a set of activities, of which at least one must be
reallocated in order to make activity A
i
allocatable
at time newVal. Therefore, when values BackTo
and Mark are to be compared, it is firstly checked,
whether there is newVal among the keys of Mark[i],
and in the positive case, Max(Mark[i][newVal]) and
BackTo[i][newVal] are compared (see line 10).
If Max(Mark[i][newVal]) < BackTo[i][newVal], it
means that none of the conflicting activities has been
re-instantiated and thus it makes no sense to look for
an available resource. However, before proceeding to
the next value of newVal, it is necessary to merge the
conflicting activities to the current conflict set (line
11) as if the search for an available resource was con-
ducted – this is the reason why Mark[i][newVal] must
store the set of activities (and not just the most recent
activity).
Oppositely, if newVal is not presented among
the keys of Mark[i] or Max(Mark[i][newVal]) ≥
BackTo[i][newVal], the algorithm does look for an
available resource. If activity A
i
is successfully allo-
cated, the key newVal is removed from Mark[i] (line
24), otherwise Mark[i][newVal] stores the conflicting
activities (line 27).
Termination
Notice that the algorithm does not check for the re-
coverability of the disrupted ongoing schedule, which
means that if there is no feasible solution, the proce-
dure
AllocateComponent(Component C)
never ter-
minates. This can be solved by giving it a limited
time (cut-off limit), or by detecting that the method
got stuck in a loop, which may be proven for exam-
ple when it tries to allocate an activity in time greater
than the maximal estimate of makespan (which may
be the sum of the durations of all activities and of all
minimal distances in the model).
6 EXPERIMENTAL RESULTS
The STN-Recovery algorithm is designed to move a
lot of activities by a small amount of time, which
means that it should not be used when minimizing
the number of shifted activities (objective f
2
). On the
other hand, the algorithm should perform well in min-
imizing the biggest shift of an activity (objective f
3
).
On the contrary, the Right Shift Affected algorithm
intents to affect only the necessary subset of activities,
making it better when minimizing the objective f
2
.
Oppositely, if the alternative resources for the broken-
down resource make a bottleneck, the affected activi-
ties (and subsequently all connected components with
them) are moved to the end of the schedule horizon.
This is expected to yield a poor performance in the
objective f
3
, which is unacceptable when the origi-
nal schedule objective is related to lateness or tardi-
ness. The distance functions f
2
and f
3
are expected to
grow linearly with increasing number of activities in
the model for both algorithms.
To support the above hypotheses we performed
experiments with randomly generated problems com-
posed of 20 resources in one group. Each connected
component consists of 8 activities and up to 28 tem-
poral constraints (some may be redundant). Having
more resources in a group than the number of activi-
ties in a component ensures recoverability from a re-
source failure. We also included a total reschedul-
ing algorithm (rescheduling from scratch) in the com-
parison to justify the claims from the introduction.
The algorithms were running on Intel(R) Core(TM)
i7-2600K CPU @ 3.40GHz, 3701 Mhz, kernels: 4,
logical processors: 8; RAM: 8,00 GB.
Briefly speaking, the experimental results con-
firmed the hypotheses. As depicted in figure 2, the
Right Shift Affected algorithm is far better when
optimizing the distance function f
2
, but the STN-
Recovery algorithm is significantly better when op-
timizing the distance function f
3
, as shown in figure
3. As far as function f
1
is concerned (which is the
total sum of shifts), the STN-Recovery algorithm out-
performs the Right Shift Affected, but the difference
is negligible.
The Right Shift Affected algorithm is somewhat
faster than STN-Recovery (see figure 4), however,
STN-Recovery has the following advantage. The al-
gorithm always allocates the leftmost connected com-
ponent that has not been allocated yet, therefore,
when the algorithm is allocating the connected com-
ponentwith the leftmostactivity that has the MinStart
value t, the schedule is not going to be modified be-
fore time point t. This allows the system to keep ex-
ecuting an ongoing schedule even if it has not been
ICAART2015-InternationalConferenceonAgentsandArtificialIntelligence
128