class_docstr: Used for building Physical Plan from Logical Plan.
class_docstr_tok: ["Used","for","building","Physical","Plan","from","Logical","Plan","."]
code: def build_optimal_physical_plan(
      self, root_grp_id: int, optimizer_context: OptimizerContext
  ):
      physical_plan = None
      root_grp = optimizer_context.memo.groups[root_grp_id]
      best_grp_expr = root_grp.get_best_expr(PropertyType.DEFAULT)
  
      physical_plan = best_grp_expr.opr
  
      for child_grp_id in best_grp_expr.children:
          child_plan = self.build_optimal_physical_plan(
              child_grp_id, optimizer_context
          )
          physical_plan.append_child(child_plan)
  
      return physical_plan
  
file_path: evadb/evadb/optimizer/plan_generator.py
imports: from evadb.database import EvaDBDatabase
  from evadb.optimizer.cost_model import CostModel
  from evadb.optimizer.operators import Operator
  from evadb.optimizer.optimizer_context import OptimizerContext
  from evadb.optimizer.optimizer_task_stack import OptimizerTaskStack
  from evadb.optimizer.optimizer_tasks import BottomUpRewrite, OptimizeGroup, TopDownRewrite
  from evadb.optimizer.property import PropertyType
  from evadb.optimizer.rules.rules_manager import RulesManager
label_desc: Use image node_id 3 for calling the PlanGenerator obj's underlying member method code with example usage: obj.build_optimal_physical_plan(root_grp_id, optimizer_context) and returns: physical_plan