public void updateSPFS(int nid, TIntStack toRemove, Propagator<IntVar> propagator) {
double tempPval = Double.POSITIVE_INFINITY;
int tempP = Integer.MIN_VALUE;
DisposableIntIterator it = GNodes.inArcs[nid].getIterator();
while (it.hasNext()) {
int arcId = it.next();
int orig = GArcs.origs[arcId];
double spfs = GNodes.spfs.quickGet(orig) + GArcs.costs[arcId];
if (tempPval > spfs) {
tempPval = spfs;
tempP = arcId;
}
}
it.dispose();
double old = GNodes.spfs.quickSet(nid, tempPval);
GNodes.prevSP.quickSet(nid, tempP);
if (nid != tinkIndex && old != tempPval) {
it = GNodes.outArcs[nid].getIterator();
while (it.hasNext()) {
int arcId = it.next();
int dest = GArcs.dests[arcId];
if (GNodes.prevSP.quickGet(dest) == arcId) {
updateSPFS(dest, toRemove, propagator);
}
double spft = GNodes.spft.quickGet(dest);
double acost = GArcs.costs[arcId];
if (!isInStack(arcId) && tempPval + spft + acost > propagator.getVar(starts.length).getUB()) {
setInStack(arcId);
toRemove.push(arcId);
}
}
it.dispose();
}
}