<prompt> Andika programu ya Java ili kutekeleza algoriti ya njia fupi zaidi ya Dijkstra kwenye grafu yenye uzani inayowakilishwa kama matrix ya karibu.  <response>: Hapa kuna programu ya Java inayotekelezea algorithm fupi ya njia ya Dijkstra kwenye grafu yenye uzani inayowakilishwa kama matrix ya ukaribu: javaagiza java.util.Arrays;darasa la umma DijkstrasAlgorithm faragha tuli final int NO_PARENT -1; utupu tuli wa umma String args int adjacencyMatrix 0, 4, 0, 0, 0, 0, 0, 8, 0, 4, 0, 8, 0, 0, 0, 0, 11, 0, 0, 8, 0, 7, 0, 4, 0, 0, 2, 0, 0, 7, 0, 9, 14, 0, 0, 0, 0, 0, 0, 9, 0, 10, 0, 0, 0, 0, 0, 4, 14, 10, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 6, 8, 11, 0, 0, 0, 0, 1, 0, 7, 0, 0, 2, 0, 0, 0, 6, 7, 0 ; dijkstraadjacencyMatrix, 0; binafsi tuli utupu dijkstraint adjacencyMatrix, int startVertex int nVertices adjacencyMatrix0.length; int shortestDistances new intnVertices; boolean added new booleannVertices; Arrays.fillUmbali mfupi zaidi, Integer.MAX_VALUE; Arrays.jazaimeongezwa, uongo; shortestDistancesstartVertex 0; int wazazi int mpyanVertices; wazazistartVertex NO_PARENT; kwa int i 1; i nVertices; i int karibuVertex -1; int shortestDistance Integer.MAX_VALUE; kwa int vertexIndex 0; vertexIndex nVertices; vertexIndex ikiwa !addedvertexIndex shortestDistancesvertexIndex shortestDistance karibuVertex vertexIndex; shortestDistance shortestDistancesvertexIndex; addednearestVertex kweli; kwa int vertexIndex 0; vertexIndex nVertices; vertexIndex int edgeDistance adjacencyMatrixnearestVertexvertexIndex; ikiwa edgeDistance 0 shortestDistance edgeDistance shortestDistancesvertexIndex wazazivertexIndex karibuVertex; shortestDistancesvertexIndex shortestDistance edgeDistance; printSolutionstartVertex, ShortestDistances, wazazi; faragha tuli utupu printSolutionint startVertex, int umbali, int wazazi int nVertices distances.length; System.out.printVertext UmbalitPath; kwa int vertexIndex 0; vertexIndex nVertices; vertexIndex ikiwa vertexIndex ! startVertex System.out.printn startVertex - ; System.out.printvertexIndex tt ; System.out.printumbalivertexIndex tt; printPathvertexIndex, wazazi; faragha tuli utupu printPathint currentVertex, int wazazi ikiwa currentVertex NO_PARENT kurudi; printPathwazazicurrentVertex, wazazi; System.out.printcurrentVertex ; Mpango huu unafafanua grafu yenye uzani kama matriki ya kukaribiana na hupata njia fupi zaidi kutoka kwa kipeo cha mwanzo hadi vipeo vingine vyote kwa kutumia algoriti ya Dijkstra. Chaguo za kukokotoa za dijkstra huchukua matrix ya kukaribiana na kipeo cha kuanzia kama ingizo na kukokotoa umbali mfupi zaidi na njia zinazolingana. Hatimaye, inachapisha suluhisho kwa njia iliyoumbizwa. 