Tecnologia, programação e muito Visual FoxPro.

domingo, 9 de janeiro de 2011

[Access VBA Central] Excel VBA to Access / Pathfinding

 

Greetings all,

A while ago I developed an interest in Pathfinding Algorithms, and created some excel spreadsheets with VBA code that illustrated Breadth-First Searchs (BFS), Dijkstra's Algorithm and the A* Algorithm. In their simplest form Pathfinding Algorithms find a path, normally the shortest path, between two nodes given a dataset of nodes and connections between said nodes. (An easy to understand beginners overview of pathfinding can be found at http://www.policyalmanac.org/games/aStarTutorial.htm).

Up until now all my spreadsheets have used relatively small datasets. I now want to get more ambitious and have a dataset that is already in an Access database with over 5000 nodes and about 14000 paths that I want to use. While I have developed several Access databases and have used VBA extensively in Excel I have never used VBA in Access itself.

The spreadsheets all have a data table of node connections and a VBA Macro that does the following..
i) Load all the node connections data into an array
ii) Load the desired start and ending nodes
iii) Run the main algorithm that finds the path
iv) Write the path found to the spreadsheet

In excel i) ii) and iv) are simple loops and the complicated part is the Algorithm in part iii). I assume that algorithm will remain relatively unchanged in Access. Unfortunately I have no idea how one would do i), ii) and iv) in Access.

Specifically
A) How do I load the 14000 node connections from the table into my desired array and
B) How do I write the results array to a table?

Any suggestions, advice, or references I can read much appreciated.

Sean

__._,_.___
Recent Activity:
.

__,_._,___

Nenhum comentário:

Arquivo do blog