Finally: Dijkstra in JAVA implemented