for (int i = 1; i < layers.length; i++) {
int[] layer = layers[i];
for (int q : layer) {
DisposableIntIterator it = GNodes.inArcs[q].getIterator();
while (it.hasNext()) {
int arc = it.next();
double acost = GArcs.costs[arc];
int orig = GArcs.origs[arc];
double otherS = GNodes.spfs.quickGet(orig) + acost;
if (otherS < GNodes.spfs.quickGet(q)) {
GNodes.spfs.quickSet(q, otherS);
GNodes.prevSP.quickSet(q, arc);
}
double otherL = GNodes.lpfs.quickGet(orig) + acost;
if (otherL > GNodes.lpfs.quickGet(q)) {
GNodes.lpfs.quickSet(q, otherL);
GNodes.prevLP.quickSet(q, arc);
}
}
it.dispose();
}
}
for (int i = layers.length - 2; i >= 0; i--) {
int[] layer = layers[i];
for (int q : layer) {
DisposableIntIterator it = GNodes.outArcs[q].getIterator();
while (it.hasNext()) {
int arc = it.next();
double acost = GArcs.costs[arc];
int dest = GArcs.dests[arc];
double otherS = GNodes.spft.quickGet(dest) + acost;
if (otherS < GNodes.spft.quickGet(q)) {
GNodes.spft.quickSet(q, otherS);
GNodes.nextSP.quickSet(q, arc);
}
double otherL = GNodes.lpft.quickGet(dest) + acost;
if (otherL > GNodes.lpft.quickGet(q)) {
GNodes.lpft.quickSet(q, otherL);
GNodes.nextLP.quickSet(q, arc);
}
}
it.dispose();
}
}
// System.out.println(GNodes.lpfs.get(end));
// System.out.println(GNodes.lpft.get(start));