title: Most simple tree data structure in Python, that can be easily traversed in both directions
body: <p>I would need the simplest possible implementation for a data structure, that can be traversed in both parent->children and children->parent direction; so ideally the child should hold a reference to the parent as well.</p>
  
  <p>Was thinking about a dictionary, where the children would simply hold a reference to their parent, similar to this:</p>
  
  <pre><code># define the root node
  a = {'name': 'trunk', 'value': 0, 'parent': None, 'children': []}
  # add child
  a['children'].append({'name': 'branch-1', 'value': 1,
                        'parent': a, 'children': []})
  # and so on...
  </code></pre>
  
  <p>Is this safe to do? (Circular reference might impact garbage collection?) Does it make sense to do this? What would be simpler?</p>