Changed graph traversal routines in scan_utils.py to not visit any subgraph more than once