Dijkstra in C and pririty queue in python