private void updateSubTree(final TreeNode node){
  int c=node.numChildren;
  final Stack<TreeNode> nodeStack=new Stack<TreeNode>();
  nodeStack.push(node);
  TreeNode parentTemp;
  TreeNode child;
  while (nodeStack.size() > 0) {
    parentTemp=nodeStack.pop();
    c=parentTemp.numChildren;
    for (int i=0; i < c; i++) {
      child=parentTemp.children[i];
      if (parentTemp.g + child.getCost() < child.g) {
        parentTemp.updateChild(child);
        nodeStack.push(child);
      }
    }
  }
}

private void updateSubTree ( final TreeNode node ) { int c = node . numChildren ; final Stack < TreeNode > nodeStack = new Stack < TreeNode > ( ) ; nodeStack . push ( node ) ; TreeNode parentTemp ; TreeNode child ; while ( nodeStack . size ( ) > 0 ) { parentTemp = nodeStack . pop ( ) ; c = parentTemp . numChildren ; for ( int i = 0 ; i < c ; i ++ ) { child = parentTemp . children [ i ] ; if ( parentTemp . g + child . getCost ( ) < child . g ) { parentTemp . updateChild ( child ) ; nodeStack . push ( child ) ; } } } }
update the parents for the new route .
