Representing a categorical variable with graphs