Basic graph related problems