94 ALEXANDER BARVINOK AND JAMES E. POMMERSHEIM
points by how much time it allows us to save compared with this straightforward
procedure of enumeration. In particular, we will be interested in a special class
of formulae whose complexity is bounded by a polynomial in the input size of
the polytope P. A polytope Pmay be given by its description as a set of linear
inequalities (as a rational polyhedron: see Definition 1.1). The input size of this
facet description of Pis the total size in binary encoding of the coefficients of the
inequalities needed to describe P. For example, the input size of the description
I={x:0≤x≤a}of an interval, where ais a positive integer, is O(log a).
A polytope P⊂Rdmay be given as the convex hull of its vertices; the input
size of such a vertex description is defined in a similar way: the total size of the
coordinates of the vertices of Pin binary encoding. It is well understood that if
the dimension dis fixed and not a part of the input, then the facet description
and the vertex description are polynomially equivalent; that is, the length of one
is bounded by a polynomial in the length of the other. See any of [Gr¨otschel
et al. 1993; Lov´asz 1986; Schrijver 1986], for example. Sometimes we talk about
formulae that can be applied to polytopes from some particular class. In this
case, we are looking at the computational complexity of the formula relative to
the input size of the description of Pwithin the class.
From this perspective, the formula of Example 1.2 is very nice: it is much more
efficient than the direct enumeration of integer points in a polygon. Indeed, it
is easy to compute the area of Pby triangulating the polygon. Furthermore,
the boundary ∂P is a union of finitely many straight line intervals, and counting
lattice points in intervals is easy. Formula of Example 1.3 is bad since it has
exponential complexity even in dimension 1. Indeed, the input size of the interval
[0,a]isO(log a), whereas the straightforward counting of Example 1.3 would give
us O(a) complexity, which is exponentially large in the input size. The formula
of Example 1.4 is nice, because it reduces counting to the computation of the
Dedekind sums, which can be done efficiently. Indeed, by recursively applying
the reciprocity relation
s(p, q)+s(q, p)=−1
4+1
12p
q+q
p+1
pq
and the obvious identity
s(p, q)=s(r, q),where r≡p(mod q)and0≤r<q,
one can compute s(p, q) in time polynomial in the input size of pand q,bya
procedure resembling the Euclidean algorithm. See [Rademacher and Grosswald
1972], for example. Finally, the formula of Example 1.5 is also nice since its
allows us to save time counting integer points in nP ,wherenis a large positive
integer. Indeed, we can apply the “brute force” counting of Example 1.3 to find
the number of integer points in polytopes P,2P,...,bd/2cPand their relative
interiors, and then interpolate the polynomial p.Oncepis found, it is easy to
find |nP ∩Zd|for any positive integer n.