This project takes altitude data from dat files to form topographical maps and then uses a greedy algorithm to find the shortest path from one side to the other. It can also find the shortest path to each edge of the map from a given coordinate. The program colors the paths as follows:
#FC193F
- greedy paths from west to east edge#1FFD0D
- shortest path#13FEFD
- greedy paths to each edge from a given coordinateThese instructions will get you a copy of the project up and running on your local machine for testing purposes.
A working command line
Download the zip then link the files in the command line via the makefile and run the executable
Navigate to the correct directory and utilize the makefile
foo@bar:~$ cd /path/to/directory/here
foo@bar:~$ make all
This will have created a few .o files and an executable. To run it, do as follows...
foo@bar:~$ ./Main
Demo
Enter number of rows: 480
Enter number of columns: 480
Enter input filename: map-input-480-480.dat
min value: 1326
max value: 4334
greediest path: 11971
enter space separated coordinates i.e. (45 56): 200 200
Example output after converting ppm to a jpg
Copyright © 2017 Michael Roush. All rights reserved.