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

Dijkstra fails on sparse graph #13

Closed
pgcassidy2004 opened this issue Sep 10, 2015 · 2 comments
Closed

Dijkstra fails on sparse graph #13

pgcassidy2004 opened this issue Sep 10, 2015 · 2 comments
Assignees
Labels
bug Report an issue with the project

Comments

@pgcassidy2004
Copy link

With many vertices and not many edges, the Dijkstra algorithm fails on the following line:
//_edgeTo = new WeightedEdge[_edgesCount];
which now runs with the following line:
_edgeTo = new WeightedEdge[_verticesCount];

Similarly the test for optimality fails in DijkstraShortestPaths with directed edges, I think because code fails due to adding an edge weight to Infinity, when it should not do this for the directed edge when the edge is not in the right direction.

//Debug.Assert(_checkOptimalityConditions(Graph, Source));

(_distances[v] + edge.Value < _distances[w])
infinity + an edge weight will be less than distances[w](infinity + positive number) = small number.

@aalhour
Copy link
Owner

aalhour commented Sep 14, 2015

Hi there.

Thanks for reporting this. I will try to fix it as soon as my time allows. If you know how to solve this, and wish to contribute to this repository, then fix it and I'll be happy to review and merge your pull request.

Cheers!

@pgcassidy2004
Copy link
Author

Ahmad,
here is the patch for the modifications I made.
Not sure about pull requests.

On Mon, Sep 14, 2015 at 11:13 AM, Ahmad Alhour notifications@github.com
wrote:

Hi there.

Thanks for reporting this. I will try to fix it as soon as my time allows.
If you know how to solve this, and wish to contribute to this repository,
then fix it and I'll be happy to review and merge your pull request.

Cheers!


Reply to this email directly or view it on GitHub
#13 (comment)
.

Paul G Cassidy
CTO

@aalhour aalhour added the bug Report an issue with the project label May 18, 2016
@aalhour aalhour added this to In progress in Kanban Board Oct 30, 2019
@aalhour aalhour moved this from In progress to To do in Kanban Board Oct 30, 2019
@PatrykOlejniczak PatrykOlejniczak moved this from To do to Review in progress in Kanban Board Nov 2, 2019
@PatrykOlejniczak PatrykOlejniczak self-assigned this Nov 3, 2019
@aalhour aalhour closed this as completed Nov 3, 2019
Kanban Board automation moved this from Review in progress to Done Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report an issue with the project
Projects
Kanban Board
  
Done
Development

No branches or pull requests

3 participants