shortest-path

shortest distance through coordinates

无人久伴 提交于 2019-12-14 03:28:01
问题 I am given a set of point in the x-y plane ={(x1,y1),(x2,y2),.....(xn,yn)} and I am given two points a(xa,ya) and b(xb,yb) and asked to find the set of points that cover the shortest path. no connection between points are given. If I assume a connection to every other point.it will take a long time to compute these values for a weighted graph. Can someone tell me what reading I should do. what topic does this problem come under graph algorithms?!!(Is there any specific algorithm) I have been

Shortest path in a grid

杀马特。学长 韩版系。学妹 提交于 2019-12-13 15:21:57
问题 I have a two dimensional matrix like A......... ##....##.. .####...## .......... .......### B......... ####...### #...#.###. Where ' . ' represents path and ' # ' represents wall.I have to find the shortest path possible from point A to point B .I am familiar with BFS algorithm and it seems like a reasonable algorithm for the problem. But I find it confusing to apply on the grid.Can anyone suggest implementation of BFS algorithm in this problem with some pseudo-codes ? 回答1: The BFS algorithms

Shortest path through coordinates

青春壹個敷衍的年華 提交于 2019-12-13 09:46:18
问题 I am given a set of point in the x-y plane ={(x1,y1),(x2,y2),.....(xn,yn)} and I am given two points a(xa,ya) and b(xb,yb) and asked to find the set of points that cover the shortest path. no connection between points are given. If I assume a connection to every other point.it will take a long time to compute these values for a weighted graph. Can someone tell me what reading I should do. what topic does this problem come under graph algorithms?!!(Is there any specific algorithm) I have been

Regarding the query speed of dijkstra and A* algorithm

南楼画角 提交于 2019-12-13 07:04:39
问题 I am trying to profile the speed of A* and Dijkstra algorithm. I am using the code available at http://www.boost.org/doc/libs/1_38_0/libs/graph/example/astar-cities.cpp and http://www.boost.org/doc/libs/1_50_0/libs/graph/doc/dijkstra_shortest_paths.html. I tried a simple graph with 500 edges and 300 nodes. I was expecting A* to perform better than Dijkstra since in Dijkstra the shortest distance from the source vertex to every other vertex is found. On the other hand in A* the shortest

Decide Whether All Shortest Paths From s to t Contain The Edge e

喜夏-厌秋 提交于 2019-12-13 04:20:44
问题 Let G = (V;E) be a directed graph whose edges all have non-negative weights. Let s,t be 2 vertices in V, and let e be an edge in E. Describe an algorithm that decides whether all shortest paths from s to t contain the edge e. Well, this is how you can achieve Dijsktra's time complexity: Simply run Dijkstra from s and calculate delta(s,t) (the weight of the shortest path from s to t). Remove the edge e, and run Djikstra again from s in the new graph. If delta(s,t) in the new graph has

Changing value of a heap element in C

大兔子大兔子 提交于 2019-12-13 01:27:14
问题 I have implemented a min heap in C. My heap is an array of structure. I have arranged the elements in heap according to the value of member 'length' in the structure. In my program I have to modify the 'length' of some members dynamically. After modifying this value, my heap has be reconstructed. I am finding difficulty in reconstruction part of this. My code: typedef struct edge{ int source; int dest; int length; }edge_st; typedef struct heap{ edge_st* edge[100]; int size; }heap; The code to

One-to-Many Shortest Path query support in Neo4j

ⅰ亾dé卋堺 提交于 2019-12-12 21:36:34
问题 Does neo4j have support for one-to-many shortest path queries? An example of such query would be: Given a node i, and a list of several other nodes N, compute the shortest paths from i to all the nodes that belong to N. I am aware of this thread: Neo4j shortest path (BFS) distances query variants, but it is specifically for one-to-all queries. My question is for one-to-many queries. Thank you. 回答1: To get All paths from one node to multiple nodes MATCH p = shortestPath((s:skill)-[r]->(s1

Hadoop MapReduce implementation of shortest PATH in a graph, not just the distance

一世执手 提交于 2019-12-12 12:28:37
问题 I have been looking for "MapReduce implementation of Shortest path search algorithms". However, all the instances I could find "computed the shortest distance form node x to y", and none actually output the " actual shortest path like x-a-b-c-y ". As for what am I trying to achieve is that I have graphs with hundreds of 1000s of nodes and I need to perform frequent pattern analysis on shortest paths among the various nodes. This is for a research project I am working on. It would be a great

Calculating shortest path on maps (Google Maps, Openstreetmaps, etc)

喜欢而已 提交于 2019-12-12 09:19:57
问题 I want to calculate shortest paths on some kind of already existing map API routes and then draw them. That being said, I need to be able to extract/get as more more data as possible (i.e. routes' coordinates) in order to be able to manipulate with it. My first thought was using Google Maps but as far as I understand, Google Maps API provides very little necessary data for my problem thus I won't be able to make any kind of accurate calculations. Also, existing Google Maps API's algorithms

Find a monotonic shortest path in a graph in O(E logV)

半世苍凉 提交于 2019-12-12 08:53:55
问题 Problem 34 of creative problems from this page. Monotonic shortest path. Given an edge-weighted digraph, find a monotonic shortest path from s to every other vertex. A path is monotonic if the weight of every edge on the path is either strictly increasing or strictly decreasing. Partial solution : relax edges in ascending order and find a best path; then relax edges in descending order and find a best path. My question: Suppose we are relaxing edges in descending order and we have an option