$E(\bf{v}) = \sum_{i=1} a_i v_i + \sum_{i<j} b_{i,j} v_i v_j + c \qquad\qquad v_i \in\{A, B, C, ...\}$
where $$\{A, B, C, ...\}$$ are some set of discrete values such {red, green, blue, yellow} or {3.2, 67}.
The dimod.DiscreteQuadraticModel class can contain this model and its methods provide convenient utilities for working with representations of a problem.