I have done some work on the data structure to see whether it was possible to gain some time just on that score, and it seems it's possible.
Here's an excerpt of the log generated while running the app. I just show the 2 first results as they are representative of the results I usually get.
Two Start and End cells have been tested. 4 algorithms are run for the same conditions.
1. DFS Which is the basic DFS algorithm to baseline the results.
2. DFSW but using an array walled up by blocked cells. The array can conceptually be seen as an inner array (Blocked(,) if you want) and an outer array, ie the wall.
3. My Algo, an implementation of DFS with a walled array (as in 2)
4. AlgoSDA, AN implementation of DFS with a single dimensional array
It can be seen that it's the same algorithm as the number of visited cells are identical in each case.
I was expecting some performance gain with the walled array, but there were not. However the implementation with a Single Dimensional Array seems to genuinely enhance the processing speed.
NOW, I need to move from the blind DFS implementation to a heuristic based search.
EDIT - I have posted the whole log as it is not that big.
Start: 1000 iterations
--------------------------------------------------------------------------------------
Start Cell: 8:2
End Cell: 11:17
------------------------------------------------
Avg. time for DFS= 0.116035847 ms
Path NOT Found in 445 Recursive Calls
Visited=183
-
---
Avg. time for DFSW= 0.115073693 ms
Path NOT Found in 445 Recursive Calls
Visited=183
-
---
Avg. time for My Algo=0.119594616 ms
Path NOT Found in 445 Recursive Calls
Visited=183
-
---
Avg. time for AlgoSDA=0.108019307 ms
Path NOT Found in 445 Recursive Calls
Visited=183
-
--------------------------------------------------------------------------------------
Start Cell: 11:2
End Cell: 4:16
------------------------------------------------
Avg. time for DFS= 0.082568077 ms
Path Found in : 346 Recursive Calls
Visited=127
-
---
Avg. time for DFSW= 0.08384907700000001 ms
Path Found in : 346 Recursive Calls
Visited=127
-
---
Avg. time for My Algo=0.069210615 ms
Path Found in : 264 Recursive Calls
Visited=127
-
---
Avg. time for AlgoSDA=0.060480384 ms
Path Found in : 264 Recursive Calls
Visited=127
-
--------------------------------------------------------------------------------------
Start Cell: 8:2
End Cell: 14:15
------------------------------------------------
Avg. time for DFS= 0.127867231 ms
Path Found in : 549 Recursive Calls
Visited=209
-
---
Avg. time for DFSW= 0.129814154 ms
Path Found in : 549 Recursive Calls
Visited=209
-
---
Avg. time for My Algo=0.119580538 ms
Path Found in : 470 Recursive Calls
Visited=209
-
---
Avg. time for AlgoSDA=0.10685338400000001 ms
Path Found in : 470 Recursive Calls
Visited=209
-
--------------------------------------------------------------------------------------
Start Cell: 8:2
End Cell: 14:14
------------------------------------------------
Avg. time for DFS= 0.029954616000000003 ms
Path Found in : 115 Recursive Calls
Visited=41
-
---
Avg. time for DFSW= 0.031240462 ms
Path Found in : 115 Recursive Calls
Visited=41
-
---
Avg. time for My Algo=0.020940308 ms
Path Found in : 57 Recursive Calls
Visited=41
-
---
Avg. time for AlgoSDA=0.016404846 ms
Path Found in : 57 Recursive Calls
Visited=41
-
--------------------------------------------------------------------------------------
Start Cell: 8:2
End Cell: 14:13
------------------------------------------------
Avg. time for DFS= 0.144274462 ms
Path NOT Found in 593 Recursive Calls
Visited=225
-
---
Avg. time for DFSW= 0.143915538 ms
Path NOT Found in 593 Recursive Calls
Visited=225
-
---
Avg. time for My Algo=0.147871538 ms
Path NOT Found in 593 Recursive Calls
Visited=225
-
---
Avg. time for AlgoSDA=0.132483846 ms
Path NOT Found in 593 Recursive Calls
Visited=225
-
--------------------------------------------------------------------------------------
Start Cell: 11:2
End Cell: 6:12
------------------------------------------------
Avg. time for DFS= 0.08467930800000001 ms
Path Found in : 360 Recursive Calls
Visited=134
-
---
Avg. time for DFSW= 0.08680338400000001 ms
Path Found in : 360 Recursive Calls
Visited=134
-
---
Avg. time for My Algo=0.069544307 ms
Path Found in : 263 Recursive Calls
Visited=134
-
---
Avg. time for AlgoSDA=0.060774 ms
Path Found in : 263 Recursive Calls
Visited=134
-
--------------------------------------------------------------------------------------
Start Cell: 8:2
End Cell: 14:11
------------------------------------------------
Avg. time for DFS= 0.052570692 ms
Path Found in : 223 Recursive Calls
Visited=78
-
---
Avg. time for DFSW= 0.053792846 ms
Path Found in : 223 Recursive Calls
Visited=78
-
---
Avg. time for My Algo=0.043947769 ms
Path Found in : 161 Recursive Calls
Visited=78
-
---
Avg. time for AlgoSDA=0.038236538 ms
Path Found in : 161 Recursive Calls
Visited=78
-
--------------------------------------------------------------------------------------
Start Cell: 4:2
End Cell: 8:10
------------------------------------------------
Avg. time for DFS= 0.071398615 ms
Path Found in : 314 Recursive Calls
Visited=110
-
---
Avg. time for DFSW= 0.07200815399999999 ms
Path Found in : 314 Recursive Calls
Visited=110
-
---
Avg. time for My Algo=0.052668614999999995 ms
Path Found in : 196 Recursive Calls
Visited=110
-
---
Avg. time for AlgoSDA=0.044520461000000004 ms
Path Found in : 196 Recursive Calls
Visited=110
-
--------------------------------------------------------------------------------------
Start Cell: 9:2
End Cell: 12:9
------------------------------------------------
Avg. time for DFS= 0.108300923 ms
Path Found in : 489 Recursive Calls
Visited=172
-
---
Avg. time for DFSW= 0.109949769 ms
Path Found in : 489 Recursive Calls
Visited=172
-
---
Avg. time for My Algo=0.08841884600000001 ms
Path Found in : 350 Recursive Calls
Visited=172
-
---
Avg. time for AlgoSDA=0.07753846099999999 ms
Path Found in : 350 Recursive Calls
Visited=172
-
--------------------------------------------------------------------------------------
Start Cell: 15:2
End Cell: 11:8
------------------------------------------------
Avg. time for DFS= 0.054842769 ms
Path NOT Found in 203 Recursive Calls
Visited=81
-
---
Avg. time for DFSW= 0.056564692 ms
Path NOT Found in 203 Recursive Calls
Visited=81
-
---
Avg. time for My Algo=0.057898307 ms
Path NOT Found in 203 Recursive Calls
Visited=81
-
---
Avg. time for AlgoSDA=0.050103154000000004 ms
Path NOT Found in 203 Recursive Calls
Visited=81
-
--------------------------------------------------------------------------------------
Start Cell: 7:2
End Cell: 13:7
------------------------------------------------
Avg. time for DFS= 0.057521231 ms
Path Found in : 246 Recursive Calls
Visited=87
-
---
Avg. time for DFSW= 0.059841693 ms
Path Found in : 246 Recursive Calls
Visited=87
-
---
Avg. time for My Algo=0.051194538 ms
Path Found in : 187 Recursive Calls
Visited=87
-
---
Avg. time for AlgoSDA=0.043531307 ms
Path Found in : 187 Recursive Calls
Visited=87
-
--------------------------------------------------------------------------------------
Start Cell: 5:2
End Cell: 6:6
------------------------------------------------
Avg. time for DFS= 0.018907539 ms
Path Found in : 53 Recursive Calls
Visited=23
-
---
Avg. time for DFSW= 0.020014923 ms
Path Found in : 53 Recursive Calls
Visited=23
-
---
Avg. time for My Algo=0.019745077 ms
Path Found in : 36 Recursive Calls
Visited=23
-
---
Avg. time for AlgoSDA=0.012935923 ms
Path Found in : 36 Recursive Calls
Visited=23
-
--------------------------------------------------------------------------------------
Start Cell: 4:2
End Cell: 8:5
------------------------------------------------
Avg. time for DFS= 0.14150515400000002 ms
Path Found in : 638 Recursive Calls
Visited=232
-
---
Avg. time for DFSW= 0.144274615 ms
Path Found in : 638 Recursive Calls
Visited=232
-
---
Avg. time for My Algo=0.118593615 ms
Path Found in : 482 Recursive Calls
Visited=232
-
---
Avg. time for AlgoSDA=0.10537476900000001 ms
Path Found in : 482 Recursive Calls
Visited=232
-
--------------------------------------------------------------------------------------
Start Cell: 5:2
End Cell: 12:4
------------------------------------------------
Avg. time for DFS= 0.11937584600000001 ms
Path Found in : 509 Recursive Calls
Visited=189
-
---
Avg. time for DFSW= 0.120386154 ms
Path Found in : 509 Recursive Calls
Visited=189
-
---
Avg. time for My Algo=0.111638308 ms
Path Found in : 438 Recursive Calls
Visited=189
-
---
Avg. time for AlgoSDA=0.09947330800000001 ms
Path Found in : 438 Recursive Calls
Visited=189
-
--------------------------------------------------------------------------------------
Start Cell: 5:2
End Cell: 6:3
------------------------------------------------
Avg. time for DFS= 0.12777192299999998 ms
Path Found in : 541 Recursive Calls
Visited=205
-
---
Avg. time for DFSW= 0.129224231 ms
Path Found in : 541 Recursive Calls
Visited=205
-
---
Avg. time for My Algo=0.12222546199999999 ms
Path Found in : 486 Recursive Calls
Visited=205
-
---
Avg. time for AlgoSDA=0.109155231 ms
Path Found in : 486 Recursive Calls
Visited=205
-
--------------------------------------------------------------------------------------
Start Cell: 13:2
End Cell: 7:2
------------------------------------------------
Avg. time for DFS= 0.024930692 ms
Path Found in : 88 Recursive Calls
Visited=33
-
---
Avg. time for DFSW= 0.026801615 ms
Path Found in : 88 Recursive Calls
Visited=33
-
---
Avg. time for My Algo=0.020829 ms
Path Found in : 58 Recursive Calls
Visited=33
-
---
Avg. time for AlgoSDA=0.016760615000000003 ms
Path Found in : 58 Recursive Calls
Visited=33
-
End