bitwalker / libgraph

A graph data structure library for Elixir projects
MIT License
524 stars 75 forks source link

Fix shortest path algorithm #12

Closed jnd77 closed 6 years ago

jnd77 commented 6 years ago

Hi. First thanks a lot for starting this library. It's a great tool. However, I noticed the shortest path wasn't working properly for one of my graphs.

I have added a test with that graph, along with a fix. The fix actually keeps track of the sum of all edge weights from the start up to the current point, to include it in the new priority computation.

Cheers !

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.982% when pulling 30c7fb413e24785777807c1d25174fbbe930cfff on jnd77:master into ba3a94abcdbabe7fae7c9af64b1fb6f3226b2e10 on bitwalker:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.982% when pulling 30c7fb413e24785777807c1d25174fbbe930cfff on jnd77:master into ba3a94abcdbabe7fae7c9af64b1fb6f3226b2e10 on bitwalker:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.009%) to 94.973% when pulling e09f4a1025f090e1ed343c81b81598ca4f3ca554 on jnd77:master into ba3a94abcdbabe7fae7c9af64b1fb6f3226b2e10 on bitwalker:master.

jnd77 commented 6 years ago

Also found a small bug in the dfs

bitwalker commented 6 years ago

This is great! Thanks for the PR! I'm really sorry it took this long to get to, but I'll get it released ASAP

jnd77 commented 6 years ago

Thanks ! That's great.