def DFS(G, coloring=None, roots=None):
    """Performs a depth-first search of the graph `G`"""
    
    if coloring is None:
        coloring = dict()
    if roots is None:
        roots = vertices(G)
        
    for v in roots:
        for w in DFS_visit(G, coloring, v):
            yield w
Performs a depth-first search of the graph `G`
recipes/Python/498260_Examples_algorithm_compositiobserver_pattern/recipe-498260.py