class_docstr: A simple graph class
  
      
docstr: A graph class with nodes and edges :-)
  
  This class allows us to:
  
  1. find the shortest path
  2. find all paths
  3. add/delete nodes and edges
  4. get parent & children nodes
  
  Examples
  --------
  >>> from dipy.core.graph import Graph
  >>> g=Graph()
  >>> g.add_node('a',5)
  >>> g.add_node('b',6)
  >>> g.add_node('c',10)
  >>> g.add_node('d',11)
  >>> g.add_edge('a','b')
  >>> g.add_edge('b','c')
  >>> g.add_edge('c','d')
  >>> g.add_edge('b','d')
  >>> g.up_short('d')
  ['d', 'b', 'a']
docstr_tok: ["A","graph","class","with","nodes","and","edges",":","-",")","This","class","allows","us","to",":","1.","find","the","shortest","path","2.","find","all","paths","3.","add\/delete","nodes","and","edges","4.","get","parent","&","children","nodes","Examples","--","--","--","--",">",">",">","from","dipy.core.graph","import","Graph",">",">",">","g=Graph","(",")",">",">",">","g.add_node","(","'","a',5",")",">",">",">","g.add_node","(","'","b',6",")",">",">",">","g.add_node","(","'","c',10",")",">",">",">","g.add_node","(","'d',11",")",">",">",">","g.add_edge","(","'","a","'",",","'","b","'",")",">",">",">","g.add_edge","(","'","b","'",",","'","c","'",")",">",">",">","g.add_edge","(","'","c","'",",","'d","'",")",">",">",">","g.add_edge","(","'","b","'",",","'d","'",")",">",">",">","g.up_short","(","'d","'",")","[","'d","'",",","'","b","'",",","'","a","'","]"]
code: def __init__(self):
      """A graph class with nodes and edges :-)
  
      This class allows us to:
  
      1. find the shortest path
      2. find all paths
      3. add/delete nodes and edges
      4. get parent & children nodes
  
      Examples
      --------
      >>> from dipy.core.graph import Graph
      >>> g=Graph()
      >>> g.add_node('a',5)
      >>> g.add_node('b',6)
      >>> g.add_node('c',10)
      >>> g.add_node('d',11)
      >>> g.add_edge('a','b')
      >>> g.add_edge('b','c')
      >>> g.add_edge('c','d')
      >>> g.add_edge('b','d')
      >>> g.up_short('d')
      ['d', 'b', 'a']
  
      """
  
      self.node = {}
      self.pred = {}
      self.succ = {}
  
file_path: dipy/dipy/core/graph.py
label_desc: Use image node_id 1 to create a new Graph object  with example: obj = Graph()