## Shortest path

I found a really interesting workbook that calculates the shortest distance from a start cell to an end cell. It is all made with excel formulas, not a single vba line! It uses a grid of 12 by 12 cells and the workbook is 11 MB.

He implemented Dijkstra's Algorithm to calculate the shortest path. If you are interested in how it works download his workbook.

I wanted to see if it was possible to make a bigger grid so I made a grid of 30 by 30 cells. The workbook quickly grew to 60 MB and there are 8 sheets. The maze is built by entering 1 for a wall cell. Conditional formatting then makes the cell black.

The animation below shows me deleting walls and the workbook instantly finds a new shorter path.

I also tried making an even larger grid, 65 x 65 but the workbook became too big. You can see my labyrinth here.

I guess this is a task for vba but that will be another post. [UPDATE] The follow up post is here: Finding the shortest path – A * pathfinding

### Category: Pathfinding

Optimize pick path in a warehouse

As you probably already are aware of I have shown you earlier a vba macro I made that finds the […]Comments(6) Filed in category: Excel, Pathfinding, Solver

Finding the shortest path – A * pathfinding

Two months ago I posted some interesting stuff I found: Shortest path. Let me explain, someone created a workbook that calculated […]Comments(5) Filed in category: Pathfinding

A quicker A * pathfinding algorithm

3 weeks ago I showed you a A* pathfinding algorithm. It was extremely slow and sluggish and I have now made it […]Comments(0) Filed in category: Excel, Pathfinding

### 3 Responses to “Shortest path”

### Leave a Reply

**How to add a formula to your comment:**

<code>your formula</code>

**How to add VBA code to your comment:**

[vb 1="vbnet" language=","]

VBA code

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org

Add picture link to comment.

**Contact Oscar**

You can contact me through this webpage

Just curious how the cells change color without conditional formatting being supported in iWork Numbers. The spreadsheet works in Numbers, but I want to know which formula makes the cells change color.

[…] months ago I posted some interesting stuff I found: Shortest path. Let me explain, someone created a workbook that calculated the shortest path between a start cell […]

[…] Shortest path […]