├── .gitmodules
├── .bazelversion
├── .gitignore
├── screenshot.png
├── main.qrc
├── readme.md
├── RandomSolver.h
├── Solver.h
├── DijkstraSolver.h
├── WORKSPACE
├── RandomSolver.cpp
├── AStarSolver.h
├── main.cpp
├── StateSpace.cpp
├── StateSpace.h
├── BUILD
├── GraphWidget.h
├── DijkstraSolver.cpp
├── main.qml
├── AStarSolver.cpp
└── GraphWidget.cpp
/.gitmodules:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.bazelversion:
--------------------------------------------------------------------------------
1 | 5.0.0
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bazel-*
2 |
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justbuchanan/graph-algorithms-qt/HEAD/screenshot.png
--------------------------------------------------------------------------------
/main.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | main.qml
4 |
5 |
6 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Graph Algorithms
2 |
3 | Dijkstra & A\* animation
4 |
5 | GUI allows for moving start/end points as well as adding obstacles.
6 |
7 | 
8 |
9 | ## Bazel config
10 |
11 | Bazel configuration is based on github.com/bbreslauer/qt-bazel-example
12 |
--------------------------------------------------------------------------------
/RandomSolver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "Solver.h"
4 |
5 | class RandomSolver : public Solver {
6 | public:
7 | RandomSolver(const StateSpace *ss, State start, State goal);
8 |
9 | void step() override;
10 | std::vector reconstructPath() override {
11 | // unimplemented
12 | return {};
13 | }
14 | bool hasExplored(State s) const override;
15 |
16 | private:
17 | std::vector _explored;
18 | };
19 |
--------------------------------------------------------------------------------
/Solver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "StateSpace.h"
4 |
5 | class Solver {
6 | public:
7 | Solver(const StateSpace *ss, State start, State goal)
8 | : stateSpace(ss), start(start), goal(goal) {}
9 |
10 | virtual void step() = 0;
11 | virtual std::vector reconstructPath() = 0;
12 | virtual bool hasExplored(State s) const = 0;
13 |
14 | bool done() const { return hasExplored(goal); }
15 |
16 | const StateSpace *stateSpace;
17 | const State start, goal;
18 | };
19 |
--------------------------------------------------------------------------------
/DijkstraSolver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "Solver.h"
4 | #include