class_docstr: Class for representing PDAGs (also known as CPDAG). PDAGs are the equivalence classes of
  DAGs and contain both directed and undirected edges.
  
  Note: In this class, undirected edges are represented using two edges in both direction i.e.
  an undirected edge between X - Y is represented using X -> Y and X <- Y.
class_docstr_tok: ["Class","for","representing","PDAGs","(","also","known","as","CPDAG",")",".","PDAGs","are","the","equivalence","classes","of","DAGs","and","contain","both","directed","and","undirected","edges",".","Note",":","In","this","class",",","undirected","edges","are","represented","using","two","edges","in","both","direction","i.e",".","an","undirected","edge","between","X","-","Y","is","represented","using","X","-",">","Y","and","X","<","-","Y","."]
docstr: Retuns a pygraphviz object for the DAG. pygraphviz is useful for
  visualizing the network structure.
  
  Examples
  --------
  >>> from pgmpy.utils import get_example_model
  >>> model = get_example_model('alarm')
  >>> model.to_graphviz()
  <AGraph <Swig Object of type 'Agraph_t *' at 0x7fdea4cde040>>
docstr_tok: ["Retuns","a","pygraphviz","object","for","the","DAG",".","pygraphviz","is","useful","for","visualizing","the","network","structure",".","Examples","--","--","--","--",">",">",">","from","pgmpy.utils","import","get_example_model",">",">",">","model","=","get_example_model","(","'alarm","'",")",">",">",">","model.to_graphviz","(",")","<","AGraph","<","Swig","Object","of","type","'Agraph_t","*","'","at","0x7fdea4cde040",">",">"]
code: def to_graphviz(self):
      """
      Retuns a pygraphviz object for the DAG. pygraphviz is useful for
      visualizing the network structure.
  
      Examples
      --------
      >>> from pgmpy.utils import get_example_model
      >>> model = get_example_model('alarm')
      >>> model.to_graphviz()
      <AGraph <Swig Object of type 'Agraph_t *' at 0x7fdea4cde040>>
      """
      return nx.nx_agraph.to_agraph(self)
  
imports: import itertools
  import networkx
  import numpy
  from pgmpy.base import UndirectedGraph
  from pgmpy.global_vars import logger
  from pgmpy.independencies import Independencies
label_desc: Use image node_id 4 for calling the PDAG obj's underlying member method code with example usage: obj.to_graphviz() and returns: nx