tested graph and related functions