UnickSoft / graphonline

This is source code of graphonline service. Graphonline helps visualize graph and applies a lot of algorithms.
http://graphonline.ru/en/
MIT License
367 stars 67 forks source link

Error in calculating the shortest path by Dijkstra's algorithm #18

Closed kzkvv closed 3 years ago

kzkvv commented 3 years ago

See pic. Path should be as follows: 1->4->5->2 = 14+4+6 = 24 however, the calculator made a mistake and suggested the path 1->2 = 25

image

the adjacency matrix for the similar graph:

0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,

UnickSoft commented 3 years ago

Hello. Looks like you use "Текст над дугой" to set weight of edge. Please try to use "Вес дуги" to set weight. Снимок экрана 2020-12-02 в 23 10 59 Weight of edge is drawn inside edge. Снимок экрана 2020-12-02 в 23 13 10

For this reason output result is 3 in text box for your case.

kzkvv commented 3 years ago

Yes, I made a mistake with the field selection in the modal window