Requirement: Compute the shortest path starting from top left corner point (0, 0) to all other points by using the greedy algorithm. The cost of a path is the sum of all edge costs along the path in horizontal and vertical directions.
Input Map: a 2D array in row based order saved in ([url removed, login to view]). It has Width * Height = 250 * 200 dots(points).
Value at a position in the map: 1byte character (8bits) for height value, i.e., the height value ranges from 0 to 255.
You can use additional matrix as the working space to register intermediate results such as KNOWN, REACHED, and UNKNOWN (char type is enough) for location status, the accumulated distance from start point (float or double recommended), and the direction from previous vertex on the path (char type). You can also output txt file or do screen print of the shortest path cost to the point.
(Shortest path from a point to all [url removed, login to view])
(1) A grey level image of the same scale and format as the input map should be submitted to show the final direction to reach every point in the map. In detail, the value at each point shows the direction from its previous position on the shortest path. For example, at a point, you can use a number from 50, 100, 150, 200 to represent a direction among N(↑), E(→), S(↓), W(←).
(2) Mark a path in another image file in [url removed, login to view] in raw format.
11 freelancers are bidding on average $70 for this job
Hi, I can design for you a program in C ++ search the shortest path. This called Dijkstra’s algorithm. I'm an experienced programmer in C , C ++, C#. I'm from Russia my experience in programming 25 years.