I have a recursive function to validate tree graph and need a return condition I have a tree graph. Each node has attribute 'amount'. The rule governing the attribute value of root is this, The root 'amount' value is the sum of the 'amount' attribute of each of it's children. This continues to the last node with children. In other words this tree's attributes are unlike a sum tree, because the root node is not the sum of each node in the tree. Here is a toy example as graph G: nodedict = 'apples': 'amount': 5.0, 'bananas': 'amount': 10.0, 'tomato': 'amount': 50.0, 'total_fruits': 'amount': 15.0, 'total_vegetables': 'amount': 9.0, 'carrot': 'amount': 3.0, 'squash': 'amount': 6.0, 'total_fruits_and_vegetables': 'amount': 74.0 edgelist = [('total_fruits', 'apples'), ('total_fruits', 'bananas...