first-pass graph