https://github.com/astropilot/hexagones
Rewriting of a pedagogical program on graph path algorithms in C.
https://github.com/astropilot/hexagones
c graph graph-algorithms gtk3 pedagogy
Last synced: 2 months ago
JSON representation
Rewriting of a pedagogical program on graph path algorithms in C.
- Host: GitHub
- URL: https://github.com/astropilot/hexagones
- Owner: Astropilot
- License: mit
- Created: 2019-04-06T10:27:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-12T15:42:34.000Z (about 7 years ago)
- Last Synced: 2025-12-01T20:38:55.969Z (7 months ago)
- Topics: c, graph, graph-algorithms, gtk3, pedagogy
- Language: C
- Size: 287 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/Astropilot/Hexagones/blob/master/LICENSE)
[](https://github.com/Astropilot/Hexagones/releases/latest)

Rewriting in C of a pedagogical program allowing to understand the functioning of path-finding algorithms in graphs.

## How to use it
Hexagons allows you to test path-finding algorithms on a 2D hexagonal map.
Algorithms should try to find a path from the starting point (the magenta-colored hexagon) to the ending point (the red colored hexagon).
You can complicate their task by adding impassable or difficult to cross obstacles, you have walls (black), water (blue), grass (green) and sand (yellow).
The walls are totally impassable, but the others only slow down by having a higher cost to move from one neighbour to the other. The costs are as follows:
| Type of tile | Cost |
| :----------- | :--------: |
| Wall | impassable |
| Nothing | 1 |
| Water | 10 |
| Grass | 5 |
| Sand | 2 |
Here is the list of algorithms that have been implemented:
* [x] Depth-first search
* [x] Breadth-first search
* [x] Connected components (This algorithm is an exception, it only displays the connected components.)
* [x] Bellman-Ford
* [x] Dijkstra
* [x] A*
## Download & Install
### Prerequisites
To be able to compile the project, you must first have the GTK 3 graphics library.
On Debian/Unbuntu distributions you can install it via the command
```bash
$ sudo apt-get install libgtk-3-dev
```
### How to compile
First of all you have to recover the sources. To do this you can either download a release [from the release page](https://github.com/Astropilot/Hexagones/releases), or clone the repository via the command
```bash
$ git clone https://github.com/Astropilot/Hexagones.git
```
Once the sources are recovered, you can compile the project under UNIX with the make command:
```bash
$ cd Hexagones
$ make
```
Finally, all you have to do is launch Hexagons!
```bash
$ ./hexagones
```
## Credits
This project is a rewrite of an already existing project originally written in Python by [Mr. David Auger](https://www.david.uvsq.fr/?profile=auger-david), professor-researcher at the University Institute of Technology in Vélizy, France.