Fix heuristic selection candidate sourcing
This commit is contained in:
parent
08e1f4e085
commit
e4d66890da
|
@ -569,8 +569,9 @@ impl Search {
|
|||
self.working.clear();
|
||||
// Get input candidates from `self.nearest` and store them in `self.working`.
|
||||
// `self.candidates` will represent `W` from the paper's algorithm 4 for now.
|
||||
while let Some(Reverse(candidate)) = self.candidates.pop() {
|
||||
for &candidate in &self.nearest {
|
||||
self.working.push(candidate);
|
||||
if params.extend_candidates {
|
||||
for hop in layer.nearest_iter(candidate.pid) {
|
||||
if !self.visited.insert(hop) {
|
||||
continue;
|
||||
|
@ -582,6 +583,7 @@ impl Search {
|
|||
self.working.push(new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.working.sort_unstable();
|
||||
self.nearest.clear();
|
||||
|
|
Loading…
Reference in New Issue