Liferay.Loader.define("portal-workflow-kaleo-designer-web$graphlib@2.1.8/lib/alg/prim",["module","exports","require","../lodash","../graph","../data/priority-queue"],(function(e,r,o){window;var i=o("../lodash"),a=o("../graph"),n=o("../data/priority-queue");e.exports=function prim(e,r){var o,d=new a,t={},s=new n;function updateNeighbors(e){var i=e.v===o?e.w:e.v,a=s.priority(i);if(void 0!==a){var n=r(e);n<a&&(t[i]=o,s.decrease(i,n))}}if(0===e.nodeCount())return d;i.each(e.nodes(),(function(e){s.add(e,Number.POSITIVE_INFINITY),d.setNode(e)})),s.decrease(e.nodes()[0],0);for(var u=!1;s.size()>0;){if(o=s.removeMin(),i.has(t,o))d.setEdge(o,t[o]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(o).forEach(updateNeighbors)}return d}}));
//# sourceMappingURL=prim.js.map