You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/dijkstrajs-59d11638.js

2 lines
1.2 KiB

var y={},x={get exports(){return y},set exports(f){y=f}};(function(f){var u={single_source_shortest_paths:function(o,e,t){var r={},n={};n[e]=0;var i=u.PriorityQueue.make();i.push(e,0);for(var p,c,s,h,_,v,a,d,l;!i.empty();){p=i.pop(),c=p.value,h=p.cost,_=o[c]||{};for(s in _)_.hasOwnProperty(s)&&(v=_[s],a=h+v,d=n[s],l=typeof n[s]>"u",(l||d>a)&&(n[s]=a,i.push(s,a),r[s]=c))}if(typeof t<"u"&&typeof n[t]>"u"){var m=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(m)}return r},extract_shortest_path_from_predecessor_list:function(o,e){for(var t=[],r=e;r;)t.push(r),o[r],r=o[r];return t.reverse(),t},find_path:function(o,e,t){var r=u.single_source_shortest_paths(o,e,t);return u.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(o){var e=u.PriorityQueue,t={},r;o=o||{};for(r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t.queue=[],t.sorter=o.sorter||e.default_sorter,t},default_sorter:function(o,e){return o.cost-e.cost},push:function(o,e){var t={value:o,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};f.exports=u})(x);export{y as d};