fixed __eq__ bug in graph.py
tree structure learning  using dynamic programming