  We define homology of ternary algebras satisfying axioms derived from
particle scattering or, equivalently, from the third Reidemeister move. We show
that ternary quasigroups satisfying these axioms appear naturally in invariants
of Reidemeister, Yoshikawa, and Roseman moves. Our homology has a degenerate
subcomplex. The normalized homology yields invariants of knots and knotted
surfaces.
