/************************************************************************ * Jason Leveille * CS520 Assignment 3 * DFS Implementation Notes */ Data Structures: //Class level static array to keep track of nodes var nodeList = new Array(); //Class instance member to track neighbors this.neighborList = new Array(); //application level array used to hold instantiated node objects nodesList = new Array(); //arrays used in search to track visited nodes, as well as open nodes (not visited) //each of these arrays acted as a stack var closedList = new Array(); var openList = new Array(); //Class level static array to keep track of edges var edgeList = new Array(); What worked and what didn't I was absolutely surprised at what I was able to accomplish using Arrays in JavaScript. An array in JavaScript can act as a stack or a queue, depending on what methods you call. As far as what worked, pretty much everything I tried. Much thanks goes to (http://www.kirupa.com/developer/actionscript/depth_breadth_search.htm) for giving me the initial inspiration to even try this in JS. Kirupa had used actionScript in his work. **************************************************************************** /* * Iterative Deepening Implementation Notes */ Data Structures: Pretty much exactly what you see above. The difference here is that I added a few additional variables to track node level, and whether or not a node was found. I'm sure I could have done this more efficiently, but it's midnight. Efficiency went out the window 3 hours ago. What worked and what didn't I was absolutely surprised at what I was able to accomplish using Arrays in JavaScript. An array in JavaScript can act as a stack or a queue, depending on what methods you call. As far as what worked, pretty much everything I tried. Much thanks goes to (http://www.kirupa.com/developer/actionscript/depth_breadth_search.htm)