Graph Search Pattern - Python

Graph Search pattern in python