What is a Matrix Traversal Visualizer?
A matrix traversal visualizer shows how an algorithm visits cells in a 2D grid. It helps connect row and column indexes with the visible order of traversal.
This tool includes spiral order traversal and grid BFS from a selected starting cell. It is useful for learning matrix problems, grid search, queues, and coordinate-based algorithms.
For the full cluster of related tools, browse the Data Structure Visualizers hub.
How to use this matrix traversal visualizer
- Paste a grid with one row per line.
- Choose spiral order or BFS mode.
- Set a starting row and column for BFS mode.
- Step through visited cells, frontier cells, and traversal order.
- Compare the highlighted grid with the coordinate log.
Matrix traversal and graph traversal
A grid can be treated as a graph where each cell is a node and adjacent cells are edges. BFS on a matrix uses the same queue pattern as BFS on an explicit graph, but the neighbors come from row and column offsets.
Compare this with the Graph BFS DFS Visualizer, Stack and Queue Visualizer, and Sliding Window Visualizer.