Demonstrate Dijkstra's algorithm using Java