Dijktra's algorithm solver for directed graphs