<prompt> Tengeneza programu ya Scala inayokokotoa njia fupi zaidi kati ya nodi mbili kwenye grafu yenye uzani kwa kutumia algoriti ya Dijkstra.PLINFORMAT  <response>: kesi ya darasa Edgesrc: Int, dest: Int, uzito: Intimport scala.collection.mutablekitu Dijkstra Kazi ya kukokotoa njia fupi zaidi kwa kutumia algorithm ya Dijkstra def dijkstrakingo: OrodhaEdge, numVertices: Int, startNode: Int: ArrayInt umbali wa val Array.fillnumVerticesInt.MaxValue umbalistartNode 0 val unvisitedNodes mutable.PriorityQueueInt, IntstartNode, 0Ordering.by_._2.reverse wakati unvisitedNodes.nonEmpty val currentNode, currentDistance unvisitedNodes.dequeue ikiwa umbalicurrentNode currentDistance kwa makali - edges.filter_.src currentNode val newDistance currentDistance edge.weight ikiwa newDistance distancesedge.dest umbaliedge.dest newDistance unvisitedNodes.enqueueedge.dest, newDistance umbali kitu Kuu huongeza Programu Mfano wa grafu yenye wima 5 na kingo 6 kingo Orodha Ukingo 0, 1, 10, Ukingo 0, 2, 5, Ukingo 1, 3, 1, Ukingo 2, 1, 3, Ukingo 2, 3, 8, Ukingo 2, 4, 2 val nambaVertices 5 val startNode 0 Kuhesabu njia fupi zaidi kutoka nodi ya kuanza hadi nodi nyingine zote umbali wa val Dijkstra.dijkstrakingo, numVertices, startNode printlnsUmbali mfupi zaidi kutoka nodi startNode: distances.mkString, Tafuta njia fupi kati ya nodi mbili maalum mwisho wa mwisho 3 val shortestPathDistance masafaendNode printlnsUmbali mfupi zaidi kati ya nodi startNode na endNode: shortestPathDistance 