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

Start Node is not marked as dirty, and thus never visited on subsequent path queries #36

Open
BonsaiDen opened this issue Jan 24, 2015 · 2 comments

Comments

@BonsaiDen
Copy link

Adding a graph.markDirty(start); right infront of the while loop in the search function seems to fix this.

@bgrins
Copy link
Owner

bgrins commented Jan 26, 2015

Hi, could you please share a test case where this is failing so we can add test coverage for this?

@ammarabdulsalam
Copy link

Hi, I can confirm this issue, I couldn't reproduce it using a small graph. adding @BonsaiDen fix resolves the issue, sample code:

var graph = new Graph([
    [1,1,1,1],
    [1,0,1,0],
    [0,0,1,1]
]);
var start = graph.grid[0][0];
var end = graph.grid[1][2];
var result = astar.search(graph, start, end);
console.log(result);
result = astar.search(graph, end, start);
console.log(result);

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

3 participants