class_docstr: Implements methods for finding optimal (efficient) backdoor sets.
class_docstr_tok: ["Implements","methods","for","finding","optimal","(","efficient",")","backdoor","sets","."]
docstr: Returns the D flow network associated with treatment, outcome,
  conditional and observable variables. If a node does not have a 'cost'
  attribute, this function will assume the cost is infinity.
  
  See Smucler and Rotnitzky (2022), Journal of Causa Inference, for the
  full definition of this flow network.
  
  :returns D: nx.DiGraph
      The D flow network.
docstr_tok: ["Returns","the","D","flow","network","associated","with","treatment",",","outcome",",","conditional","and","observable","variables",".","If","a","node","does","not","have","a","'cost'","attribute",",","this","function","will","assume","the","cost","is","infinity",".","See","Smucler","and","Rotnitzky","(","2022",")",",","Journal","of","Causa","Inference",",","for","the","full","definition","of","this","flow","network",".",":","returns","D",":","nx.DiGraph","The","D","flow","network","."]
code: def build_D(self):
      """Returns the D flow network associated with treatment, outcome,
      conditional and observable variables. If a node does not have a 'cost'
      attribute, this function will assume the cost is infinity.
  
      See Smucler and Rotnitzky (2022), Journal of Causa Inference, for the
      full definition of this flow network.
  
      :returns D: nx.DiGraph
          The D flow network.
      """
      H1 = self.build_H1()
      D = nx.DiGraph()
      for node in H1.nodes.keys():
          if "cost" in H1.nodes[node]:
              capacity = H1.nodes[node]["cost"]
          else:
              capacity = np.inf
          D.add_edge(node + "'", node + "''", capacity=capacity)
  
      for edge in H1.edges.keys():
          D.add_edge(edge[0] + "''", edge[1] + "'", capacity=np.inf)
          D.add_edge(edge[1] + "''", edge[0] + "'", capacity=np.inf)
      return D
  
file_path: dowhy/dowhy/causal_identifier/efficient_backdoor.py
imports: from typing import List
  import networkx
  import numpy
label_desc: Use image node_id 10 for calling the EfficientBackdoor obj's underlying member method code with example usage: obj.build_D() and returns: D