Liferay.Loader.define("portal-workflow-kaleo-designer-web$graphlib@2.1.8/lib/alg/dijkstra",["module","exports","require","../lodash","../data/priority-queue"],(function(e,r,a){window;var t=a("../lodash"),i=a("../data/priority-queue");e.exports=function dijkstra(e,r,a,t){return function runDijkstra(e,r,a,t){var n,o,d={},s=new i,updateNeighbors=function(e){var r=e.v!==n?e.v:e.w,t=d[r],i=a(e),u=o.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<t.distance&&(t.distance=u,t.predecessor=n,s.decrease(r,u))};for(e.nodes().forEach((function(e){var a=e===r?0:Number.POSITIVE_INFINITY;d[e]={distance:a},s.add(e,a)}));s.size()>0&&(n=s.removeMin(),(o=d[n]).distance!==Number.POSITIVE_INFINITY);)t(n).forEach(updateNeighbors);return d}(e,String(r),a||n,t||function(r){return e.outEdges(r)})};var n=t.constant(1)}));
//# sourceMappingURL=dijkstra.js.map