Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvement qpt.cpp #5

Open
Rupsbant opened this issue Feb 10, 2020 · 1 comment
Open

Performance improvement qpt.cpp #5

Rupsbant opened this issue Feb 10, 2020 · 1 comment

Comments

@Rupsbant
Copy link

Notation: au(b,pv) is the antagonistic update of a progress measure b with priority pv. pm(w) is the current progress measure of w and pr(v) is the priority of v.

If I understood the paper by Fearnley et al. then au(b, pv) is monotonic in b. It should follow that max{au(pm(w), pr(v)) | (v,w) in E} is equal to au(max{pm(w) | (v,w) in E}, pr(v)). The same for min. Applying this to the lift function in qpt.cpp should allow to reduce the number of expensive calls to au:

oink/src/qpt.cpp

Lines 272 to 300 in 2d12471

for (int to : out[v]) {
if (disabled[to]) continue;
au(tmp, pm_nodes + k*to, pr, k, max, maxo, pl);
if (pm_val(tmp, k, pl) > goal) tmp[0] = max; // goal reached, lift to Top
#ifndef NDEBUG
if (trace >= 2) {
logger << "to successor " << label_vertex(to) << ":";
pm_stream(logger, tmp, k);
logger << std::endl;
}
#endif
if (first) {
first = false;
for (int i=0; i<k; i++) res[i] = tmp[i];
strategy[v] = to;
} else if (owner[v] == pl) {
// we want the max
if (pm_less(res, tmp, k, pl)) {
for (int i=0; i<k; i++) res[i] = tmp[i];
strategy[v] = to;
}
} else {
// we want the min
if (pm_less(tmp, res, k, pl)) {
for (int i=0; i<k; i++) res[i] = tmp[i];
strategy[v] = to;
}
}
}

@trolando
Copy link
Owner

Unfortunately this is not an easy issue to address. I will look at it eventually but it has low priority because I need to study the paper again to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants