# Path finding algorithm?

**URL:** <https://discourse.processing.org/t/path-finding-algorithm/26522>\
**Category:** Coding Questions\
**Created:** [December 26, 2020, 3:47pm UTC](https://discourse.processing.org/t/path-finding-algorithm/26522 "2020-12-26T15:47:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olaf000olaf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olaf000olaf/32/11295_2.png) [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Post date:** [December 26, 2020, 3:47pm UTC](https://discourse.processing.org/t/path-finding-algorithm/26522/1 "2020-12-26T15:47:32Z")

</div>

I made a simple background maker for my phone, I’m thinking about making one the fills the whole screen. should I use a pathfinding algorithm, and if so which one? [https://www.openprocessing.org/sketch/1049907](https://www.openprocessing.org/sketch/1049907)  
I put some examples on [https://www.instagram.com/mars\_p5.js/](https://www.instagram.com/mars_p5.js/) if you’re interested.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [December 26, 2020, 4:21pm UTC](https://discourse.processing.org/t/path-finding-algorithm/26522/2 "2020-12-26T16:21:18Z")

</div>

A\* is usually the go to. Otherwise djikstra but djikstra is no a\*.

---

<div class="post-metadata">

**Author:** ![olaf000olaf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olaf000olaf/32/11295_2.png) [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Post date:** [December 26, 2020, 4:36pm UTC](https://discourse.processing.org/t/path-finding-algorithm/26522/3 "2020-12-26T16:36:43Z")

</div>

> [@paulgoux](#):
>
> is usually the

thx, I found a p5js example for A\* and read an article and I’ll just reverse it \<3

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [December 26, 2020, 7:40pm UTC](https://discourse.processing.org/t/path-finding-algorithm/26522/4 "2020-12-26T19:40:33Z")

</div>

> **[Hexagon maze generator and dijsktra search - paul goux - OpenProcessing](https://openprocessing.org/sketch/731320)**
>
> Generate a map, and pathfind between 2 random points

This is my attempt at pathfinding, its designed on a hexagonal grid.

Ive implemented djikstra, djikstra with multi path and an alternative to a\* which provides step count from each node to every other node. Although this isnt yet complete.

Also not it is slow as i do not make use of PGraphics.

Paths have parent nodes and can also be used to pathfind.

For an understanding of the a\* algorithm you could always check Dan Shiffman

[![](https://img.youtube.com/vi/aKYlikFAV4k/maxresdefault.jpg "A\* Pathfinding Algorithm (Coding Challenge 51 - Part 1)") ](https://www.youtube.com/watch?v=aKYlikFAV4k&t=63s)

A comparison of the different algorithms.

Depth first, breadth first, djikstra, a\*

[![](https://img.youtube.com/vi/GC-nBgi9r0U/maxresdefault.jpg "A Comparison of Pathfinding Algorithms") ](https://www.youtube.com/watch?v=GC-nBgi9r0U)
