Search for a tool
Path Search in a Pyramid Triangle

Tool to search path in a number pyramid. Path search in a pyramid triangle allows to find the shortest path or the longest path by traversing the graph (tree) from the root to its leaves or from the bottom to the top.

Results

Path Search in a Pyramid Triangle -

Tag(s) : Graph Theory

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Path Search in a Pyramid Triangle' tool for free! Thank you!

Path Search in a Pyramid Triangle

Path search in a Pyramid of Numbers



Shortest path

Longest path

Counting

Answers to Questions (FAQ)

How to find the shortest path?

Go through the pyramid (or the triangle) from top to bottom, adding values that gave a the smallest total respecting a single rule : only go to one of the two numbers immediately below.

Example: ...5...
..4.8..
.9.5.2.
1.2.7.6

2nd line: 5+4=9 or 5+8=13, choose the lowest, the path 5->4.
3rd line: 4+9=13 or 4+5=9, choose the lowest, the path 4->5.
4th line: 5+2=7 or 5+7=12, choose the lowest, the path 5->2.
Finally, the shortest path route is (from top to bottom) 5->4->5->2 (which is 16 long) or 2->5->4->5 (from bottom to top)

How to find the longest path?

Go through the pyramid from top to bottom, as for the shortest path, but by adding values that gave the highest total.

How to count possible paths?

Total number of path $ N $ in a pyramid of height $ H $ is given by the formula : $$ N = 2^{H-1} $$

Source code

dCode retains ownership of the "Path Search in a Pyramid Triangle" source code. Any algorithm for the "Path Search in a Pyramid Triangle" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Path Search in a Pyramid Triangle" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Path Search in a Pyramid Triangle" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Path Search in a Pyramid Triangle" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/path-search-pyramid-triangle
In a scientific article or book, the recommended bibliographic citation is: Path Search in a Pyramid Triangle on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/path-search-pyramid-triangle

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Path Search in a Pyramid Triangle' tool for free! Thank you!


https://www.dcode.fr/path-search-pyramid-triangle
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback