variable elimination for all root-nodes