tested graph solving