graph tree problem