docstr: Returns the induced graph formed by running Variable Elimination on the network.
  
  Parameters
  ----------
  elimination_order: list, array like
      List of variables in the order in which they are to be eliminated.
  
  Examples
  --------
  >>> import numpy as np
  >>> import pandas as pd
  >>> from pgmpy.models import BayesianNetwork
  >>> from pgmpy.inference import VariableElimination
  >>> values = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 5)),
  ...                       columns=['A', 'B', 'C', 'D', 'E'])
  >>> model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D'), ('B', 'E')])
  >>> model.fit(values)
  >>> inference = VariableElimination(model)
  >>> inference.induced_graph(['C', 'D', 'A', 'B', 'E'])
docstr_tok: ["Returns","the","induced","graph","formed","by","running","Variable","Elimination","on","the","network",".","Parameters","--","--","--","--","--","elimination_order",":","list",",","array","like","List","of","variables","in","the","order","in","which","they","are","to","be","eliminated",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","import","pandas","as","pd",">",">",">","from","pgmpy.models","import","BayesianNetwork",">",">",">","from","pgmpy.inference","import","VariableElimination",">",">",">","values","=","pd.DataFrame","(","np.random.randint","(","low=0",",","high=2",",","size=","(","1000",",","5",")",")",",","...","columns=","[","'","A","'",",","'","B","'",",","'","C","'",",","'D","'",",","'","E","'","]",")",">",">",">","model","=","BayesianNetwork","(","[","(","'","A","'",",","'","B","'",")",",","(","'","C","'",",","'","B","'",")",",","(","'","C","'",",","'D","'",")",",","(","'","B","'",",","'","E","'",")","]",")",">",">",">","model.fit","(","values",")",">",">",">","inference","=","VariableElimination","(","model",")",">",">",">","inference.induced_graph","(","[","'","C","'",",","'D","'",",","'","A","'",",","'","B","'",",","'","E","'","]",")"]
code: def induced_graph(self, elimination_order):
      """
      Returns the induced graph formed by running Variable Elimination on the network.
  
      Parameters
      ----------
      elimination_order: list, array like
          List of variables in the order in which they are to be eliminated.
  
      Examples
      --------
      >>> import numpy as np
      >>> import pandas as pd
      >>> from pgmpy.models import BayesianNetwork
      >>> from pgmpy.inference import VariableElimination
      >>> values = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 5)),
      ...                       columns=['A', 'B', 'C', 'D', 'E'])
      >>> model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D'), ('B', 'E')])
      >>> model.fit(values)
      >>> inference = VariableElimination(model)
      >>> inference.induced_graph(['C', 'D', 'A', 'B', 'E'])
      """
      self._initialize_structures()
  
      # If the elimination order does not contain the same variables as the model
      if set(elimination_order) != set(self.variables):
          raise ValueError(
              "Set of variables in elimination order"
              " different from variables in model"
          )
  
      eliminated_variables = set()
      working_factors = {
          node: [factor.scope() for factor in self.factors[node]]
          for node in self.factors
      }
  
      # The set of cliques that should be in the induced graph
      cliques = set()
      for factors in working_factors.values():
          for factor in factors:
              cliques.add(tuple(factor))
  
      # Removing all the factors containing the variables which are
      # eliminated (as all the factors should be considered only once)
      for var in elimination_order:
          factors = [
              factor
              for factor in working_factors[var]
              if not set(factor).intersection(eliminated_variables)
          ]
          phi = set(itertools.chain(*factors)).difference({var})
          cliques.add(tuple(phi))
          del working_factors[var]
          for variable in phi:
              working_factors[variable].append(list(phi))
          eliminated_variables.add(var)
  
      edges_comb = [
          itertools.combinations(c, 2)
          for c in filter(lambda x: len(x) > 1, cliques)
      ]
      return nx.Graph(itertools.chain(*edges_comb))
  
imports: import copy
  import itertools
  import networkx
  import numpy
  from opt_einsum import contract
  from tqdm.auto import tqdm
  from pgmpy import config
  from pgmpy.factors import factor_product
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.inference import Inference
  from pgmpy.inference.EliminationOrder import MinFill, MinNeighbors, MinWeight, WeightedMinFill
  from pgmpy.models import BayesianNetwork, DynamicBayesianNetwork, JunctionTree, MarkovNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 7 for calling the VariableElimination obj's underlying member method code with example usage: obj.induced_graph(elimination_order) and returns: nx