func New(b *board.Board) *Solver { s := &Solver{ BoardStates: make(map[string]*Node), OpenList: new(PriorityQueue), } heap.Init(s.OpenList) currentNode := &Node{ parent: nil, key: b.StateString(), h: b.GetH(), g: 0, b: b, open: true, } currentNode.f = currentNode.g + currentNode.h s.BoardStates[currentNode.key] = currentNode heap.Push(s.OpenList, currentNode) s.Goal = b.GoalString() return s }