Skip to content
/ MS2 Public

shortest path finder project - mile stone 2 in Advanced Programming course

Notifications You must be signed in to change notification settings

jsofri/MS2

Repository files navigation

Shortest Path Finder

By Rony Utevsky and Yehonatan Sofri.
A C++ project made for Advanced Programming 1 Project Mile stone 2, BIU, Fall 2019.
Link to GitHub

System requirements

  • Linux OS
    Incompatible with Windows OS

Installation

If compilation is required, go to project directory (where main.cpp is) and compile using

g++ -std=c++14 */*/*.cpp */*.cpp  *.cpp -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -o a.out -pthread

Usage

Program runs a server. The Server accepts client on the given port (default is 5600). After client made a connection, program expects to get a matrix, a startin point and an end point followed by new lines. to end write end\n.

  • matrix - Matrix of numbers. should be of size NxN, each line represents a row. Numbers will be seperated by commas.
  • Start point- coordinates of starting point - row and column.
  • End point - coordinates of end point - row and column
example input #1
1,2,3
4,5,6
7,8,9
0,0
2,2
end

will calculate the shortest path from 1 to 9. notice each line is ending with '\n'.

solution

after entering valid data, an A* algorithm will calculate shortest path from start to end and will write to client the steps and relative weight of steps. for example to the matrix in example input, solution will be:

Right (3), Right (6), Down (12), Down (21)
example input #2
1
0,0
0,0
end
solution
You're already there, honey!

Code Architecture:


class diagram

main thread will run a parallel server, allowing to handle multiple clients at the same time. each connection will create a new thread.

Data structures

File Cache Manager

Contains a map of strings and booleans, each string is a file name that is stored in the cached_solutions folder. boolean marks if the file is in the folder or not.


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.


License

Open source, free license (unless you're a BIU student...)

About

shortest path finder project - mile stone 2 in Advanced Programming course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published