Implemented graph type validation.