logoalt Hacker News

agroundstoday at 1:10 AM3 repliesview on HN

I studied a lot of abstract algebra in college and grad school and I’m surprised that rings and algebras would come up in a CS degree. What algorithms topics used those concepts? Something about polynomials?


Replies

versteegentoday at 2:53 AM

Algebra is useful because graphs are algebraic objects, and a lot of CS is about graphs, in particular search/planning. But no, I never saw rings mentioned except for generating functions, which are used for analysing recurrence relations.

For example in search algorithms where you want to search a space without visiting state nodes twice. Each state in the search space is produced by the sequence (a product of) of operators from the start state: elements of a monoid (or group if actions are invertible) which define the primitive steps. Trivial example being generating all permutations of a list. More interesting, enumerate all graphs with some property with pathwidth at most k, by adding one edge or vertex at a time. So now you want to know the structure of this group so you know which sequences of elements simplify and don't need to be tried, and you want to canonicalise each state to throw out duplicates.

And you can think in terms of orbits: if there are some symmetries then you might want to factor by the symmetry group and only visit one node in each orbit, grouping states into orbits with a single representative state. See eg. Pochter, Zohar and Rosenschein, Exploiting Problem Symmetries in State-Based Planners.

show 1 reply
aleph_minus_onetoday at 2:51 AM

Rings:

* Determinant calculation:

- The Samuelson–Berkowitz algorithm is best understood in terms of general rings

- The Faddeev–LeVerrier algorithm and determinant calculation using Gaussian elimination work on rings with specific properties (for the Faddeev–LeVerrier algorithm the restriction is on the characteristic of the ring, for Gaussian elimination the ring must be an integral domain (ideally a field)).

* Ring-learning with errors (for post-quantum cryptography and homomorphic cryptography). Here, a specific ring is the central object.

* Number-Theoretic Transform (NTT): Basically a generalization of the Fourier Transform to the ring Z_n. Important for arbitrary-precision integer arithmetic

* Chinese Remainder Theorem. Often only formulated for the ring Z, but it can be generalized to larger classes of rings. Used for example in Shamir’s scheme for secret sharing (cryptography)

* The theory of BCH and Reed-Solomon codes uses a specific ring

* The AKS Primality Test (a really deep result in computational number theory) uses the ring Z_n[X]/(x^r-1).

---

Algebras:

Very often, a ring is constructed from another ring. Examples:

* the polynomial ring R[X_1, ..., X_n]

* The ring of (square) matrices over a ring R

So, using algebras in algorithms often means: "we want to make use use of this additional structure that our (more sophisticated) ring has)". (Associative) R-algebras formalize this concept of "ring with additional structure".

To just give one algorithm for polynomials:

* Buchberger algorithm for computing a Gröbner basis

Other examples:

* Clifford algebras for a lot of geometric problems (special case: quaternions (a 4-dimensional \mathbb{R}-algebra) for rotations in \mathbb{R}^3).

* If you are willing to also consider semi-rings (in this case: tropical semi-rings): the Floyd-Warshall algorithm for finding shortest paths and the Viterbi algorithm for finding the most likely sequence of states in a Hidden-Markov Model (HMM) can very elegantly formulated using the matrix semiring over the tropical semiring.

show 1 reply
ndriscolltoday at 2:33 AM

(At least some) error-correcting codes are based on polynomials over finite fields. I couldn't say much more, but it's at least intuitively plausible since e.g. an nth degree polynomial is defined by any n+1 points, so if you know say n+1+p ("p" for "parity") points, you can lose up to p and still recover the polynomial.