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

max_path ignores path validity when choosing next node #37

Open
evolp opened this issue Aug 5, 2024 · 0 comments
Open

max_path ignores path validity when choosing next node #37

evolp opened this issue Aug 5, 2024 · 0 comments

Comments

@evolp
Copy link

evolp commented Aug 5, 2024

In the method graph::DebruijnGraph::max_path, the code only uses the passed solid_path function to check if there is only one valid option, but ignores which one it is when choosing the next node.

let mut solid_paths = 0;
for (id, dir, _) in edges {
    let cand = Some((id, dir));
    if osolid_path(cand) {
        solid_paths += 1;
    }

    if oscore(cand) > oscore(next) {
        next = cand;
    }
}

if solid_paths > 1 {
    break;
}

If none of the edges are solid paths, it will still choose neighbouring node with the highest score as the next one. If solid_path returns true for only one node, the next node is still chosen solely based on the result of score.
This could probably be fixed by moving the second if block inside the first - unless, of cause, I misunderstood the purpose of the solid_path function.

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

1 participant