mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-04-30 16:37:55 +00:00
1 line
16 KiB
Plaintext
1 line
16 KiB
Plaintext
{"dependencies":[],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n 'use strict';\n\n /******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin <self@wyattbaldwin.com>\n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\n var dijkstra = {\n single_source_shortest_paths: function (graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n var closest, u, v, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = typeof costs[v] === 'undefined';\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n return predecessors;\n },\n extract_shortest_path_from_predecessor_list: function (predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n find_path: function (graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(predecessors, d);\n },\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {\n value: value,\n cost: cost\n };\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n empty: function () {\n return this.queue.length === 0;\n }\n }\n };\n\n // node.js module exports\n if (typeof module !== 'undefined') {\n module.exports = dijkstra;\n }\n});","lineCount":151,"map":[[2,2,1,0],[2,14,1,12],[4,2,3,0],[5,0,4,0],[6,0,5,0],[7,0,6,0],[8,0,7,0],[9,0,8,0],[10,0,9,0],[11,0,10,0],[12,0,11,0],[13,0,12,0],[14,0,13,0],[15,0,14,0],[16,0,15,0],[17,0,16,0],[18,0,17,0],[19,0,18,0],[20,0,19,0],[21,0,20,0],[22,0,21,0],[23,0,22,0],[24,0,23,0],[25,2,24,0],[25,6,24,4,"dijkstra"],[25,14,24,12],[25,17,24,15],[26,4,25,2,"single_source_shortest_paths"],[26,32,25,30],[26,34,25,32],[26,43,25,32,"single_source_shortest_paths"],[26,44,25,41,"graph"],[26,49,25,46],[26,51,25,48,"s"],[26,52,25,49],[26,54,25,51,"d"],[26,55,25,52],[26,57,25,54],[27,6,26,4],[28,6,27,4],[29,6,28,4],[29,10,28,8,"predecessors"],[29,22,28,20],[29,25,28,23],[29,26,28,24],[29,27,28,25],[31,6,30,4],[32,6,31,4],[33,6,32,4],[33,10,32,8,"costs"],[33,15,32,13],[33,18,32,16],[33,19,32,17],[33,20,32,18],[34,6,33,4,"costs"],[34,11,33,9],[34,12,33,10,"s"],[34,13,33,11],[34,14,33,12],[34,17,33,15],[34,18,33,16],[36,6,35,4],[37,6,36,4],[38,6,37,4],[39,6,38,4],[40,6,39,4],[40,10,39,8,"open"],[40,14,39,12],[40,17,39,15,"dijkstra"],[40,25,39,23],[40,26,39,24,"PriorityQueue"],[40,39,39,37],[40,40,39,38,"make"],[40,44,39,42],[40,45,39,43],[40,46,39,44],[41,6,40,4,"open"],[41,10,40,8],[41,11,40,9,"push"],[41,15,40,13],[41,16,40,14,"s"],[41,17,40,15],[41,19,40,17],[41,20,40,18],[41,21,40,19],[42,6,42,4],[42,10,42,8,"closest"],[42,17,42,15],[42,19,43,8,"u"],[42,20,43,9],[42,22,43,11,"v"],[42,23,43,12],[42,25,44,8,"cost_of_s_to_u"],[42,39,44,22],[42,41,45,8,"adjacent_nodes"],[42,55,45,22],[42,57,46,8,"cost_of_e"],[42,66,46,17],[42,68,47,8,"cost_of_s_to_u_plus_cost_of_e"],[42,97,47,37],[42,99,48,8,"cost_of_s_to_v"],[42,113,48,22],[42,115,49,8,"first_visit"],[42,126,49,19],[43,6,50,4],[43,13,50,11],[43,14,50,12,"open"],[43,18,50,16],[43,19,50,17,"empty"],[43,24,50,22],[43,25,50,23],[43,26,50,24],[43,28,50,26],[44,8,51,6],[45,8,52,6],[46,8,53,6,"closest"],[46,15,53,13],[46,18,53,16,"open"],[46,22,53,20],[46,23,53,21,"pop"],[46,26,53,24],[46,27,53,25],[46,28,53,26],[47,8,54,6,"u"],[47,9,54,7],[47,12,54,10,"closest"],[47,19,54,17],[47,20,54,18,"value"],[47,25,54,23],[48,8,55,6,"cost_of_s_to_u"],[48,22,55,20],[48,25,55,23,"closest"],[48,32,55,30],[48,33,55,31,"cost"],[48,37,55,35],[50,8,57,6],[51,8,58,6,"adjacent_nodes"],[51,22,58,20],[51,25,58,23,"graph"],[51,30,58,28],[51,31,58,29,"u"],[51,32,58,30],[51,33,58,31],[51,37,58,35],[51,38,58,36],[51,39,58,37],[53,8,60,6],[54,8,61,6],[55,8,62,6],[56,8,63,6],[56,13,63,11,"v"],[56,14,63,12],[56,18,63,16,"adjacent_nodes"],[56,32,63,30],[56,34,63,32],[57,10,64,8],[57,14,64,12,"adjacent_nodes"],[57,28,64,26],[57,29,64,27,"hasOwnProperty"],[57,43,64,41],[57,44,64,42,"v"],[57,45,64,43],[57,46,64,44],[57,48,64,46],[58,12,65,10],[59,12,66,10,"cost_of_e"],[59,21,66,19],[59,24,66,22,"adjacent_nodes"],[59,38,66,36],[59,39,66,37,"v"],[59,40,66,38],[59,41,66,39],[61,12,68,10],[62,12,69,10],[63,12,70,10],[64,12,71,10,"cost_of_s_to_u_plus_cost_of_e"],[64,41,71,39],[64,44,71,42,"cost_of_s_to_u"],[64,58,71,56],[64,61,71,59,"cost_of_e"],[64,70,71,68],[66,12,73,10],[67,12,74,10],[68,12,75,10],[69,12,76,10],[70,12,77,10,"cost_of_s_to_v"],[70,26,77,24],[70,29,77,27,"costs"],[70,34,77,32],[70,35,77,33,"v"],[70,36,77,34],[70,37,77,35],[71,12,78,10,"first_visit"],[71,23,78,21],[71,26,78,25],[71,33,78,32,"costs"],[71,38,78,37],[71,39,78,38,"v"],[71,40,78,39],[71,41,78,40],[71,46,78,45],[71,57,78,57],[72,12,79,10],[72,16,79,14,"first_visit"],[72,27,79,25],[72,31,79,29,"cost_of_s_to_v"],[72,45,79,43],[72,48,79,46,"cost_of_s_to_u_plus_cost_of_e"],[72,77,79,75],[72,79,79,77],[73,14,80,12,"costs"],[73,19,80,17],[73,20,80,18,"v"],[73,21,80,19],[73,22,80,20],[73,25,80,23,"cost_of_s_to_u_plus_cost_of_e"],[73,54,80,52],[74,14,81,12,"open"],[74,18,81,16],[74,19,81,17,"push"],[74,23,81,21],[74,24,81,22,"v"],[74,25,81,23],[74,27,81,25,"cost_of_s_to_u_plus_cost_of_e"],[74,56,81,54],[74,57,81,55],[75,14,82,12,"predecessors"],[75,26,82,24],[75,27,82,25,"v"],[75,28,82,26],[75,29,82,27],[75,32,82,30,"u"],[75,33,82,31],[76,12,83,10],[77,10,84,8],[78,8,85,6],[79,6,86,4],[80,6,88,4],[80,10,88,8],[80,17,88,15,"d"],[80,18,88,16],[80,23,88,21],[80,34,88,32],[80,38,88,36],[80,45,88,43,"costs"],[80,50,88,48],[80,51,88,49,"d"],[80,52,88,50],[80,53,88,51],[80,58,88,56],[80,69,88,67],[80,71,88,69],[81,8,89,6],[81,12,89,10,"msg"],[81,15,89,13],[81,18,89,16],[81,19,89,17],[81,48,89,46],[81,50,89,48,"s"],[81,51,89,49],[81,53,89,51],[81,59,89,57],[81,61,89,59,"d"],[81,62,89,60],[81,64,89,62],[81,67,89,65],[81,68,89,66],[81,69,89,67,"join"],[81,73,89,71],[81,74,89,72],[81,76,89,74],[81,77,89,75],[82,8,90,6],[82,14,90,12],[82,18,90,16,"Error"],[82,23,90,21],[82,24,90,22,"msg"],[82,27,90,25],[82,28,90,26],[83,6,91,4],[84,6,93,4],[84,13,93,11,"predecessors"],[84,25,93,23],[85,4,94,2],[85,5,94,3],[86,4,96,2,"extract_shortest_path_from_predecessor_list"],[86,47,96,45],[86,49,96,47],[86,58,96,47,"extract_shortest_path_from_predecessor_list"],[86,59,96,56,"predecessors"],[86,71,96,68],[86,73,96,70,"d"],[86,74,96,71],[86,76,96,73],[87,6,97,4],[87,10,97,8,"nodes"],[87,15,97,13],[87,18,97,16],[87,20,97,18],[88,6,98,4],[88,10,98,8,"u"],[88,11,98,9],[88,14,98,12,"d"],[88,15,98,13],[89,6,99,4],[89,10,99,8,"predecessor"],[89,21,99,19],[90,6,100,4],[90,13,100,11,"u"],[90,14,100,12],[90,16,100,14],[91,8,101,6,"nodes"],[91,13,101,11],[91,14,101,12,"push"],[91,18,101,16],[91,19,101,17,"u"],[91,20,101,18],[91,21,101,19],[92,8,102,6,"predecessor"],[92,19,102,17],[92,22,102,20,"predecessors"],[92,34,102,32],[92,35,102,33,"u"],[92,36,102,34],[92,37,102,35],[93,8,103,6,"u"],[93,9,103,7],[93,12,103,10,"predecessors"],[93,24,103,22],[93,25,103,23,"u"],[93,26,103,24],[93,27,103,25],[94,6,104,4],[95,6,105,4,"nodes"],[95,11,105,9],[95,12,105,10,"reverse"],[95,19,105,17],[95,20,105,18],[95,21,105,19],[96,6,106,4],[96,13,106,11,"nodes"],[96,18,106,16],[97,4,107,2],[97,5,107,3],[98,4,109,2,"find_path"],[98,13,109,11],[98,15,109,13],[98,24,109,13,"find_path"],[98,25,109,22,"graph"],[98,30,109,27],[98,32,109,29,"s"],[98,33,109,30],[98,35,109,32,"d"],[98,36,109,33],[98,38,109,35],[99,6,110,4],[99,10,110,8,"predecessors"],[99,22,110,20],[99,25,110,23,"dijkstra"],[99,33,110,31],[99,34,110,32,"single_source_shortest_paths"],[99,62,110,60],[99,63,110,61,"graph"],[99,68,110,66],[99,70,110,68,"s"],[99,71,110,69],[99,73,110,71,"d"],[99,74,110,72],[99,75,110,73],[100,6,111,4],[100,13,111,11,"dijkstra"],[100,21,111,19],[100,22,111,20,"extract_shortest_path_from_predecessor_list"],[100,65,111,63],[100,66,112,6,"predecessors"],[100,78,112,18],[100,80,112,20,"d"],[100,81,112,21],[100,82,112,22],[101,4,113,2],[101,5,113,3],[102,4,115,2],[103,0,116,0],[104,0,117,0],[105,4,118,2,"PriorityQueue"],[105,17,118,15],[105,19,118,17],[106,6,119,4,"make"],[106,10,119,8],[106,12,119,10],[106,21,119,10,"make"],[106,22,119,20,"opts"],[106,26,119,24],[106,28,119,26],[107,8,120,6],[107,12,120,10,"T"],[107,13,120,11],[107,16,120,14,"dijkstra"],[107,24,120,22],[107,25,120,23,"PriorityQueue"],[107,38,120,36],[108,10,121,10,"t"],[108,11,121,11],[108,14,121,14],[108,15,121,15],[108,16,121,16],[109,10,122,10,"key"],[109,13,122,13],[110,8,123,6,"opts"],[110,12,123,10],[110,15,123,13,"opts"],[110,19,123,17],[110,23,123,21],[110,24,123,22],[110,25,123,23],[111,8,124,6],[111,13,124,11,"key"],[111,16,124,14],[111,20,124,18,"T"],[111,21,124,19],[111,23,124,21],[112,10,125,8],[112,14,125,12,"T"],[112,15,125,13],[112,16,125,14,"hasOwnProperty"],[112,30,125,28],[112,31,125,29,"key"],[112,34,125,32],[112,35,125,33],[112,37,125,35],[113,12,126,10,"t"],[113,13,126,11],[113,14,126,12,"key"],[113,17,126,15],[113,18,126,16],[113,21,126,19,"T"],[113,22,126,20],[113,23,126,21,"key"],[113,26,126,24],[113,27,126,25],[114,10,127,8],[115,8,128,6],[116,8,129,6,"t"],[116,9,129,7],[116,10,129,8,"queue"],[116,15,129,13],[116,18,129,16],[116,20,129,18],[117,8,130,6,"t"],[117,9,130,7],[117,10,130,8,"sorter"],[117,16,130,14],[117,19,130,17,"opts"],[117,23,130,21],[117,24,130,22,"sorter"],[117,30,130,28],[117,34,130,32,"T"],[117,35,130,33],[117,36,130,34,"default_sorter"],[117,50,130,48],[118,8,131,6],[118,15,131,13,"t"],[118,16,131,14],[119,6,132,4],[119,7,132,5],[120,6,134,4,"default_sorter"],[120,20,134,18],[120,22,134,20],[120,31,134,20,"default_sorter"],[120,32,134,30,"a"],[120,33,134,31],[120,35,134,33,"b"],[120,36,134,34],[120,38,134,36],[121,8,135,6],[121,15,135,13,"a"],[121,16,135,14],[121,17,135,15,"cost"],[121,21,135,19],[121,24,135,22,"b"],[121,25,135,23],[121,26,135,24,"cost"],[121,30,135,28],[122,6,136,4],[122,7,136,5],[123,6,138,4],[124,0,139,0],[125,0,140,0],[126,0,141,0],[127,6,142,4,"push"],[127,10,142,8],[127,12,142,10],[127,21,142,10,"push"],[127,22,142,20,"value"],[127,27,142,25],[127,29,142,27,"cost"],[127,33,142,31],[127,35,142,33],[128,8,143,6],[128,12,143,10,"item"],[128,16,143,14],[128,19,143,17],[129,10,143,18,"value"],[129,15,143,23],[129,17,143,25,"value"],[129,22,143,30],[130,10,143,32,"cost"],[130,14,143,36],[130,16,143,38,"cost"],[131,8,143,42],[131,9,143,43],[132,8,144,6],[132,12,144,10],[132,13,144,11,"queue"],[132,18,144,16],[132,19,144,17,"push"],[132,23,144,21],[132,24,144,22,"item"],[132,28,144,26],[132,29,144,27],[133,8,145,6],[133,12,145,10],[133,13,145,11,"queue"],[133,18,145,16],[133,19,145,17,"sort"],[133,23,145,21],[133,24,145,22],[133,28,145,26],[133,29,145,27,"sorter"],[133,35,145,33],[133,36,145,34],[134,6,146,4],[134,7,146,5],[135,6,148,4],[136,0,149,0],[137,0,150,0],[138,6,151,4,"pop"],[138,9,151,7],[138,11,151,9],[138,20,151,9,"pop"],[138,21,151,9],[138,23,151,21],[139,8,152,6],[139,15,152,13],[139,19,152,17],[139,20,152,18,"queue"],[139,25,152,23],[139,26,152,24,"shift"],[139,31,152,29],[139,32,152,30],[139,33,152,31],[140,6,153,4],[140,7,153,5],[141,6,155,4,"empty"],[141,11,155,9],[141,13,155,11],[141,22,155,11,"empty"],[141,23,155,11],[141,25,155,23],[142,8,156,6],[142,15,156,13],[142,19,156,17],[142,20,156,18,"queue"],[142,25,156,23],[142,26,156,24,"length"],[142,32,156,30],[142,37,156,35],[142,38,156,36],[143,6,157,4],[144,4,158,2],[145,2,159,0],[145,3,159,1],[147,2,162,0],[148,2,163,0],[148,6,163,4],[148,13,163,11,"module"],[148,19,163,17],[148,24,163,22],[148,35,163,33],[148,37,163,35],[149,4,164,2,"module"],[149,10,164,8],[149,11,164,9,"exports"],[149,18,164,16],[149,21,164,19,"dijkstra"],[149,29,164,27],[150,2,165,0],[151,0,165,1],[151,3]],"functionMap":{"names":["<global>","single_source_shortest_paths","extract_shortest_path_from_predecessor_list","find_path","PriorityQueue.make","PriorityQueue.default_sorter","PriorityQueue.push","PriorityQueue.pop","PriorityQueue.empty"],"mappings":"AAA;gCCwB;GDqE;+CEE;GFW;aGE;GHI;UIM;KJa;oBKE;KLE;UMM;KNI;SOK;KPE;WQE;KRE"},"hasCjsExports":true},"type":"js/module"}]} |