We establish the relation between the ISO(2, 1) homotopy invariants, and the polygon representation of (2+1)-dimensional gravity. The polygon closure conditions, together with the SO(2, 1) cycle conditions, are equivalent to the ISO(2, 1) cycle conditions for the representations ρ : π 1 (Σ g,N ) → ISO(2, 1). Also, the symplectic structure on the space of invariants is closely related to that of the polygon representation. We choose one of the polygon variables as internal time and compute the Hamiltonian, then perform the Hamilton-Jacobi transformation explicitly. We make contact with other authors' results for g = 1 and g = 2 (N = 0).