<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_from_tree(root:str, graph:dict) -> frozenset: """Return a recursive structure describing given tree"""

    Node = namedtuple('Node', 'id succs')
    succs = graph[root]
    if succs:
        return (len(succs), sorted(tuple(set_from_tree(succ, graph) for succ in succs)))
    else:
        return 0, ()