As a result, no negative cycle with value larger than βπ in the original graph will be detected, since such small differences will not be captured during the distance updates. This parameter can be tuned for different applications to eliminate the possibility of numerical issues while maintaining a good precision and reliability. In our experiments, we setπto10β9 and found it to be sufficient to completely eliminate the numerical issues.
0 2 4 6 8 10 12 14 16 18
0 50 100 150 200 250 300 350 400
Cumulated BCDR Runtime (s)
Number of conflicts discoverd
Runtime v.s. Conflicts Discovered
(a)
0 10 20 30 40 50 60 70 80 90
0 50 100 150 200 250 300 350 400
Computation Time (ms)
Number of conflicts to resolve
Relaxations Time v.s. Conflict Size
(b)
Figure 5-10: Profile of Continuous Relaxations in BCDR Runtime
exact optimal relaxation, since it does not require calling the optimizer. The alterna-tive approach has significantly improved BCDRβs runtime performance on large-scale and highly constrained problems. For the same over-subscribed plan, this greedy re-laxation approach reduces the runtime to 7.2 seconds, within which only 0.89 second were spent on conflict resolution. The same relaxation time and plot are shown in Figure 5-11. Each point in Figure 5-11b represents the discovery of one conflict. The closer it is to the x-axis, the less time was spent on computing continuous relaxations after discovering the conflict. As can be seen in the graph, less than ten exact relax-ations were computed to refine the greedy relaxrelax-ations on this problem, which greatly reduces BCDRβs run time: greedy relaxations were used in most situations to discover
new conflicts. The downside is that we discovered more conflicts than before (566 vs 381), which may not be necessary for generating the optimal relaxation.
0 1 2 3 4 5 6 7 8
0 100 200 300 400 500 600
Cumulated BCDR Runtime (s)
Number of conflicts discoverd
Runtime v.s. Conflicts Discovered
(a)
0 20 40 60 80 100 120 140 160 180
0 100 200 300 400 500 600
Computation Time (ms)
Number of conflicts to resolve
Relaxations Time v.s. Conflict Size
(b)
Figure 5-11: Profile of Combined Greedy/Exact Relaxations in BCDR Runtime
The greedy approach requires very minimum modification to BCDR: instead of formulating and solving the optimization problem in ExpandOnConflict, we com-pute the greedy relaxations here. Inside ExpandOnConflict, Line 16 to Line 22 (Algorithm 6) are replaced with a new procedure that only looks at the new con-flictππππ€ππΆπΉ π (Algorithm 12), instead of all conflicts that were previously resolved continuously. The greedy relaxation procedure iterates through all constraints in the conflict and checks if any constraints involved are relaxable (Line 16-17). If such a constraint is identified, it will relax its bounds, either lower or upper, to the
maxi-mum extent or to the extent that the conflict is eliminated, whichever is smaller (Line 18). The initial value of the conflictβs linear expression is captured by the variable ππππ ππ‘, and the conflict is resolved once the variable is made zero or negative. If one constraint cannot provide enough deviation, the procedure will move on to the next one, until ππππ ππ‘ is made zero or less. If the loop completes but the offset is still positive, it means that no continuous relaxation is available for resolving the new conflict, and the continuous relaxation candidate will not be generated.
... ...
ππππ ππ‘β 0 - EvalExp(ππππ€ππΆπΉ π); amount of relaxation that need to be applied for resolving the conflict continuously;
... ...
16 for πβππππ€ππΆπΉ π do
17 if isRelaxable(π) then
18 π=Min(ππππ ππ‘,RelaxationLimit(π));
19 π πππ€ βπ πππ€βͺ {β¨π,LB(π)βπ,0β©} or{β¨π,0,UB(π) +πβ©};
20 ππππ ππ‘=ππππ ππ‘βπ;
21 end
22 if ππππ ππ‘β€0 then
23 πΆππππππ€ β β¨π΄, π, π πππ€, πΈβ², πΆπ, πΆππππ‘β©;
24 πππ€πΆππππ βπππ€πΆππππ βͺπΆππππππ€;
25 break;
26 end
27 end
28 return πππ€πΆππππ ;
Algorithm 12: Modifications to Function ExpandOnConflict (Algorithm 6) for handling candidates with greedy relaxation
The optimal relaxation procedure is moved outside of ExpandOnConflict, and to the main loop of BCDR. Once BCDR has verified the feasibility of a candidate solution, instead of retuning it, an additional procedure will be executed to check if the candidate contains any greedy relaxations (Line 17, Algorithm 13). If true, it will refine the relaxations using the optimization procedure and generate a new candidate.
The new candidate will be put back to the queue for further verification, since it may not be the best or consistent candidate after the updates to its continuous relaxation.
This approach works very well on non-conditional plans, whose search tree has one single branch. However, it may not save time on conditional ones. To enumerate
... ...
15 πππ€πΆπΉ π βTemporallyFeasible?(ππππ);
16 if πππ€πΆπΉ π ==ππ’ππ then
17 if HasGreedyRelaxation(ππππ) then
18 πππππππ‘ππππ βRefineRelaxation(ππππ);
19 ππ’ππ’πβππ’ππ’πβͺ {πππππππ‘ππππ};
20 else
21 return πΆπππ;
22 end
23 end ... ...
Algorithm 13: Modifications to the BCDR algorithm (Algorithm 5) for greedy continuous relaxation
candidate solutions in best-first order, BCDR needs an accurate estimation for the cost of relaxation in order to prioritize candidates. In order to keep the heuristic function admissible, the cost for all greedy relaxation are set to zero. This is because the greedy relaxations will all have larger than optimal cost, and we have no idea how much the βminimal costβ will be. Hence, setting the cost to be zero retains the admissible property and still allows BCDR to do a best-first enumeration. However, if we stick to the greedy relaxations, the utility estimation for candidates may be off by a large margin, causing BCDR to waste a lot of time examining candidate solutions that are far from the optimal.
Therefore, we propose a mixed greedy-optimal relaxation approach to achieve a good balance between efficiency and accuracy. The new approach uses greedy relax-ation when more conflicts are likely to be discovered, and only runs the continuous relaxation procedure if we are confident that no more conflicts will be discovered, or we have been applying greedy relaxation for more than π times consecutively. If a candidate is found to be consistent, or has more thanπ greedy relaxations, the exact relaxation procedure will be used. The parameterπ is a non-negative integer, and if π is too large then the utility estimation may be off by too much. Therefore, in our experiments we have been using π = 5 to achieve a good balance between the time saving and the risk of creating a huge difference in heuristic and actual costs.