Search for a tool
Lattice Path

Tool to calculate all paths on a lattice graphe (square grid graph). A path is a series of directions (north, south, east, west) to connect two points on a grid.

Results

Lattice Path -

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 'Lattice Path' tool for free! Thank you!

Lattice Path

Path Count Calculator (North-East - NE)

The information on this page is for a square grid and is not valid on triangular grids (or other non square lattice graphs).

Whole Lattice Graph



Between 2 points





Answers to Questions (FAQ)

How to count paths on a lattice graph?

The calculation of the number of paths (of length $ a + b $) on a grid of size (a x b) (limited to a north-south direction and a west-east direction) uses combinatorics tools such as the binomial coefficient $ \binom{a+b}{a} $

The north direction N consists of moving up one unit along the ordinate (0,1).

The east direction E consists of moving one unit to the right along the abscissa (1,0).

Example: To go from the point $ (0, 0) $ to the point $ (2, 2) $ (which corresponds to a 2x2 grid) using only north and east. (N,N,E,E), (N,E,N,E), (N,E,E,N), (E,N,E,N), (E,N,N,E), (E,E,N,N) so 6 paths and is computed $ \binom{4}{2} = 6 $

What is a lattice graph?

A grid graph is the name given to a bounded grid (with borders).

How to enumerate pathways in a lattice graph?

To generate the list of all paths, use the permutation generator.

Example: N,N,N,E has 4 distinct permutations: (N,N,N,E) (N,N,E,N) (E,N,N,N) (N,E,N,N)

Source code

dCode retains ownership of the "Lattice Path" source code. Any algorithm for the "Lattice Path" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Lattice Path" 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 "Lattice Path" 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 "Lattice Path" 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/lattice-path
In a scientific article or book, the recommended bibliographic citation is: Lattice Path on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/lattice-path

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 'Lattice Path' tool for free! Thank you!


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