In classical computer science, the knapsack problem is a staple of discrete optimization: given a set of integers, can you pick a subset that sums to a specific target? When we move this problem from the familiar world of integers into the abstract world of group theory, it transforms from a simple arithmetic puzzle into a deep probe of algebraic structure.
In a group $G$, the knapsack problem asks: given group elements $g_1, g_2, \dots, g_k$ and a target element $h$, do there exist non-negative integers $x_1, x_2, \dots, x_k$ such that: $$g_1^{x_1} g_2^{x_2} \dots g_k^{x_k} = h$$
While this looks like a discrete logarithm problem, the non-commutative nature of many groups—where $ab \neq ba$—makes it significantly more complex. Researchers like Georg Zetzsche and Markus Lohrey have spent the last decade mapping out exactly which groups make this problem solvable and which make it impossible.
From Integers to Non-Abelian Structures
In the integers ($\mathbb{Z}$), the order of elements doesn't matter. If you have $2^x \cdot 3^y = 12$, you are just solving a linear equation. But in groups like the Baumslag-Solitar groups or graph groups, the sequence of multiplications is rigid.
Markus Lohrey and Georg Zetzsche demonstrated in The Complexity of Knapsack in Graph Groups that for right-angled Artin groups (graph groups), the knapsack problem is NP-complete. These groups are defined by a graph where nodes are generators and edges indicate which generators commute. The "hardness" of the knapsack problem in these groups effectively mirrors the structural complexity of the underlying graph.
The difficulty shifts again when we look at nilpotent and polycyclic groups. In Knapsack and subset sum problems in nilpotent, polycyclic, and co-context-free groups, Daniel König and his colleagues found a sharp gradient in complexity: the problem is relatively easy (NL-complete) in nilpotent groups but jumps to NP-complete in certain polycyclic groups. This suggests that the "depth" of a group's solvable structure is a primary driver of computational hardness.
The Rational Subset Membership Problem
The knapsack problem is actually a specific instance of a much broader challenge: the rational subset membership problem. A rational subset is essentially a "regular expression" for group elements. Instead of just asking if $g_1^{x_1} \dots g_k^{x_k} = h$, we ask if $h$ belongs to a set described by unions, products, and Kleene stars of group elements.
For many years, it was unknown if this was even decidable for the Baumslag-Solitar groups $BS(1, q)$, which are famous for their "exponential" scaling (defined by the relation $ba = a^q b$). In Rational Subsets of Baumslag-Solitar Groups, Michaël Cadilhac, Dmitry Chistikov, and Georg Zetzsche proved it is PSPACE-complete. They achieved this by treating group elements as "Pointed Expansions"—a way of representing group elements as strings that an automaton can process.
Building Complex Groups from Simple Ones
A central theme in this research is preservation: if we know the knapsack problem is solvable in Group A and Group B, is it solvable in their combination?
In Knapsack in graph groups, HNN-extensions and amalgamated products, Zetzsche and Lohrey showed that NP-solvability is preserved under fundamental algebraic operations like HNN-extensions and amalgamated products. This is non-trivial; many properties in group theory "break" when you combine groups this way.
To formalize this, Michael Figelius and his co-authors introduced the concept of knapsack-semilinear groups in Closure properties of knapsack semilinear groups. In these groups, the set of all solutions $(x_1, \dots, x_k)$ to a knapsack equation isn't just a random collection of points—it has a regular, "semilinear" structure (unions of linear grids). This regularity is what allows algorithms to navigate the infinite search space of the group efficiently.
Why This Matters: Cryptography and Beyond
Beyond pure mathematics, these problems form the bedrock of non-commutative cryptography. Traditional systems like RSA rely on the hardness of factoring or discrete logs in commutative groups. However, groups like the braid group offer new primitives.
Licheng Wang and others, in New Cryptosystems From CSP-Based Self-Distributive Systems, leverage the Conjugator Searching Problem (CSP)—a cousin of the knapsack problem—to build encryption schemes that are secure against sophisticated attacks. By understanding the boundaries of what is "easy" and "hard" to solve in these non-commutative structures, researchers can design digital locks that are resistant to both classical and quantum cryptanalysis.