def greedy(tree, objective=identity, **kwargs):
 optimize = partial(minimize, objective=objective)
 return treeapply(tree, {list: optimize, tuple: chain}, **kwargs)

def greedy ( tree , objective = identity , ** kwargs ) : optimize = partial ( minimize , objective = objective ) return treeapply ( tree , { list : optimize , tuple : chain } , ** kwargs )
execute a strategic tree .