Git Product home page Git Product logo

spbachelor's Introduction

The Shortest Path Problem In A Maze C++ Code

This project is the result of a bachelor thesis written on finding the shortest path on a grid. The project is written in C++ and includes the following algorithms:

  • Breadth First Search
  • Dijkstra's Algorithm
  • A* Shortest Path
  • HPA* Shortest Path
  • Jump point Search

Getting Started

These instructions will tell you how to compile the project and prepare it, such that you may run it.

Prerequisites

Before continuing, you will need the following:

  • CMake - Version 3.15.3 or above
  • GCC - Version 9.2.0 or above. Use HomeBrew for Mac or use Visual Studio for Windows
  • ImageMagick - Version 7.0.8-66 or above
  • CImg - Version 2.7.2 or above (Included as a submodule in the vendor folder)

Furthermore, for Windows users, you will need:

And for Mac users you will need:

  • XCode - Version 11.0 or above
  • XQuartz - Version 2.7.11 or above

Installing

Either clone or download the repository into an empty folder.

git clone https://github.com/tikki100/SPBachelor.git

Next, we need to initliaze the submodule. Navigate to the folder with the project with a git terminal, and enter the following commands:

git submodule init
git submodule update

Lastly, in the terminal, generate the project to the IDE you wish to use. Fx

cmake -G "XCode" -B build/src

Usage

The project starts in the file main.cpp and is set up to run tests by default. An image is loaded into a CImg object, and the engines Maze is initiated. Please note, that a png picture only may have 3 spectrums saved to it.

CImg<unsigned char> * img  = new CImg<unsigned char>("path/to/picture.png");
Eng::Maze Maze(img, "picture");

From here, you can run the different algorithms by typing them out as such:

Maze.RunBreadth();
Maze.RunDijkstra();
Maze.RunAStar();
Maze.RunHPAStar(clusterSize);
Maze.RunJPS();

Please note, that once a test has been run, it colours the path. Therefore, you will have to reinstansiate the picture before running a new algorithm. This can be done by doing:

* img = CImg<unsigned char>("path/to/picture.png");

Authors

spbachelor's People

Contributors

tikki100 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.