def root_nodes(graph, nodes):
    """Return the set of all nodes that are not dependencies of other nodes."""
    from functools import reduce
    nodes = set(nodes.keys())
    return reduce(set.difference, graph.values(), nodes)
