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.

Path Search in a Pyramid Triangle - dCode

Tag(s) : Graph Theory, Mathematics

dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day!

You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? *Contact-me*!

This page is using the new English version of dCode, *please make comments* !

Sponsored ads

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.

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

Example: 2nd line: 5+4=9 or 5+8=13, choose the lowest, the path 5->4.

Example: 3rd line: 4+9=13 or 4+5=9, choose the lowest, the path 4->5.

Example: 4th line: 5+2=7 or 5+7=12, choose the lowest, the path 5->2.

Example: 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)

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

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

dCode retains ownership of the source code of the script Path Search in a Pyramid Triangle. Except explicit open source licence (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, etc.) which dCode owns rights can be transferred after sales quote. So if you need to download the Path Search in a Pyramid Triangle script for offline use, for you, your company or association, see you on contact page !

path,search,pyramid,triangle,shortest,longest,vertex,edge,number

Source : http://www.dcode.fr/path-search-pyramid-triangle

© 2017 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaches. dCode