Adding levelwise travsersal method to graph