class_docstr: Base class for all the Undirected Graphical models.
  
  Each node in the graph can represent either a random variable, `Factor`,
  or a cluster of random variables. Edges in the graph are interactions
  between the nodes.
  
  Parameters
  ----------
  data: input graph
      Data to initialize graph. If data=None (default) an empty graph is
      created. The data can be an edge list or any Networkx graph object.
  
  Examples
  --------
  Create an empty UndirectedGraph with no nodes and no edges
  
  >>> from pgmpy.base import UndirectedGraph
  >>> G = UndirectedGraph()
  
  G can be grown in several ways
  
  **Nodes:**
  
  Add one node at a time:
  
  >>> G.add_node('a')
  
  Add the nodes from any container (a list, set or tuple or the nodes
  from another graph).
  
  >>> G.add_nodes_from(['a', 'b'])
  
  **Edges:**
  
  G can also be grown by adding edges.
  
  Add one edge,
  
  >>> G.add_edge('a', 'b')
  
  a list of edges,
  
  >>> G.add_edges_from([('a', 'b'), ('b', 'c')])
  
  If some edges connect nodes not yet in the model, the nodes
  are added automatically.  There are no errors when adding
  nodes or edges that already exist.
  
  **Shortcuts:**
  
  Many common graph features allow python syntax for speed reporting.
  
  >>> 'a' in G     # check if node in graph
  True
  >>> len(G)  # number of nodes in graph
  3
class_docstr_tok: ["Base","class","for","all","the","Undirected","Graphical","models",".","Each","node","in","the","graph","can","represent","either","a","random","variable",",","`","Factor","`",",","or","a","cluster","of","random","variables",".","Edges","in","the","graph","are","interactions","between","the","nodes",".","Parameters","--","--","--","--","--","data",":","input","graph","Data","to","initialize","graph",".","If","data=None","(","default",")","an","empty","graph","is","created",".","The","data","can","be","an","edge","list","or","any","Networkx","graph","object",".","Examples","--","--","--","--","Create","an","empty","UndirectedGraph","with","no","nodes","and","no","edges",">",">",">","from","pgmpy.base","import","UndirectedGraph",">",">",">","G","=","UndirectedGraph","(",")","G","can","be","grown","in","several","ways","*","*","Nodes",":","*","*","Add","one","node","at","a","time",":",">",">",">","G.add_node","(","'","a","'",")","Add","the","nodes","from","any","container","(","a","list",",","set","or","tuple","or","the","nodes","from","another","graph",")",".",">",">",">","G.add_nodes_from","(","[","'","a","'",",","'","b","'","]",")","*","*","Edges",":","*","*","G","can","also","be","grown","by","adding","edges",".","Add","one","edge",",",">",">",">","G.add_edge","(","'","a","'",",","'","b","'",")","a","list","of","edges",",",">",">",">","G.add_edges_from","(","[","(","'","a","'",",","'","b","'",")",",","(","'","b","'",",","'","c","'",")","]",")","If","some","edges","connect","nodes","not","yet","in","the","model",",","the","nodes","are","added","automatically",".","There","are","no","errors","when","adding","nodes","or","edges","that","already","exist",".","*","*","Shortcuts",":","*","*","Many","common","graph","features","allow","python","syntax","for","speed","reporting",".",">",">",">","'","a","'","in","G","#","check","if","node","in","graph","True",">",">",">","len","(","G",")","#","number","of","nodes","in","graph","3"]
code: def __init__(self, ebunch=None):
      super(UndirectedGraph, self).__init__(ebunch)
  
file_path: pgmpy/pgmpy/base/UndirectedGraph.py
imports: import itertools
  import networkx
label_desc: Use image node_id 1 to create a new UndirectedGraph object from inherited base classes: nx with example: obj = UndirectedGraph(ebunch)