v Bidirectional Search
Monday, May 30, 2011
My code search for a number in the range from 0, 1, 2, .N. so, the initial state is 0 and the goal state is the number specified by the user. Each step of number generation costs random number or 1. Class GetSucc.cs define GetSussessor() function which inculdes the possible set of actions that are required for positive number generation inorder. The input of GetSussessor () is the current state of the problem (i.e. initial State 0) and the output is the ArrayList of next states that are reached from current state(i.e. from 0 the next states 1,2 assuming that our tree is the binary tree).
Sunday, May 29, 2011
The first class in my code is Node.cs which represents the node as a data structure in the state space. Each node has some attributes such as depth, cost, state, and parent node. The state attribute is defined according to a physical configuration within the problem state space. My code is simply search for a number in the state space of positive numbers so the state here is defined simply as an integer number.
Lets explore the Node class by the following snippet: