def _traverse(graph, node, visited=[]):
    """Returns list of all direct/indirect adjacent nodes for a given node"""
    nodes = []
    if node in visited:
        return nodes
    visited.append(node)
    nodes.append(node)
    for adjacent in graph[node]:
        nodes.extend(_traverse(graph, adjacent))
    return nodes