Understanding traversal on a grid


A graph is a set of nodes connected by edges, while a grid is a two-dimensional matrix of values that is often encountered in many software development and mathematical problems. Many grid-based problems can be solved effectively by modelling the grid as a graph.

Loading Image

A graph and a grid.

Consider we have a two-dimensional matrix (grid) where every cell has some value and one can move from any cell to all its adjacent cells (typically in the four cardinal directions: up, down, left, and right).

Liking the course? Check our discounted plans to continue learning.