public AStarSearch(IGenericFst fst)
{
this.fst = fst;
this.accepted_from = -1;
this.heap = new Heap(fst.nStates() + 1);
this.n = fst.nStates();
this.came_from = new Intarray(n);
this.came_from.Fill(-1);
this.g = new Floatarray(n);
// insert the start node
int s = fst.GetStart();
g[s] = 0;
came_from[s] = s;
heap.Push(s, Convert.ToSingle(Heuristic(s)));
}