On tropical knapsack-type problems
Pith reviewed 2026-05-23 00:56 UTC · model grok-4.3
The pith
Knapsack and subset sum are NP-complete for matrix semigroups in max-plus and max-times algebras.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The knapsack problem and the subset sum problem are NP-complete for the semigroup of square matrices of size k by k with non-negative entries over the max-plus algebra and for the semigroup of square matrices of size k by k with positive entries over the max-times algebra. Pseudo-polynomial algorithms exist for both structures, and polynomial generic algorithms exist for the max-times semigroup.
What carries the argument
Polynomial-time reductions from the classical knapsack and subset sum decision problems to their versions inside the matrix semigroups over max-plus and max-times algebras.
If this is right
- Both problems are NP-complete, so they admit no polynomial-time algorithms unless P equals NP.
- Pseudo-polynomial algorithms solve the problems in time polynomial in the input size and the numeric values involved.
- For the max-times semigroup, generic instances admit polynomial-time solutions.
Where Pith is reading between the lines
- The hardness results indicate that tropical matrix problems can inherit NP-completeness directly from their classical number-based counterparts.
- The distinction between max-plus and max-times may allow similar generic polynomial algorithms to be found for other tropical semirings.
- The existence of pseudo-polynomial but not strongly polynomial algorithms suggests the problems are weakly NP-complete in these settings.
Load-bearing premise
The standard knapsack and subset sum problems can be embedded into the matrix semigroups so that the yes/no answer is preserved by a polynomial-time reduction.
What would settle it
A polynomial-time algorithm deciding the subset-sum problem for k by k matrices over either algebra would falsify the NP-completeness claim.
read the original abstract
In this paper, we investigate the computational complexity of the knapsack problem and subset sum problem for the following tropical algebraic structures. We consider the semigroup of square matrices of size $k \times k$ with non-negative entries over the max-plus algebra and the semigroup square matrices of size $k \times k$ with positive entries over the max-times algebra. We prove that the knapsack problem and subset sum problem for these structures are $\textsf{NP}$-complete. We demonstrate that there are pseudo-polynomial algorithms to solve these problems. Also, we show that for the latter semigroup, there are polynomial generic algorithms to solve the knapsack problem and the subset sum problem.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper investigates the knapsack and subset sum problems over the semigroup of k×k matrices with non-negative entries under max-plus algebra and the semigroup of k×k matrices with positive entries under max-times algebra. It claims to prove that both problems are NP-complete via polynomial-time reductions from the classical versions, shows membership in NP using short certificates verifiable with polynomially many tropical matrix multiplications, provides pseudo-polynomial dynamic programming algorithms, and establishes polynomial-time generic algorithms for the max-times case on a Zariski-open set of instances.
Significance. If the explicit constructions and reductions hold, the work extends classical NP-completeness results to tropical matrix semigroups in a concrete way, supplying both hardness proofs and algorithmic upper bounds (including the generic polynomial-time procedures). The explicit embeddings and the separation between worst-case pseudo-polynomial time and generic polynomial time are useful contributions to the computational complexity of tropical algebra.
minor comments (2)
- [Abstract] Abstract: the sentence 'the semigroup square matrices of size k × k with positive entries over the max-times algebra' is missing the word 'of' after 'semigroup'.
- The manuscript refers to 'Zariski-open set of instances' for the generic algorithms but does not appear to define the open set explicitly or indicate how it is constructed from the input parameters.
Simulated Author's Rebuttal
We thank the referee for their positive report and recommendation to accept the manuscript.
Circularity Check
No significant circularity
full rationale
The manuscript proves NP-completeness of knapsack and subset-sum decision problems over max-plus and max-times matrix semigroups by exhibiting explicit polynomial-time reductions from the classical versions of these problems. Membership in NP is shown via short certificates verified by polynomially many matrix multiplications. Separate pseudo-polynomial dynamic programs and Zariski-generic polynomial algorithms are derived directly from the algebraic definitions without reference to the hardness results. No equation or claim reduces to a fitted parameter, self-definition, or load-bearing self-citation; all steps are externally grounded in standard complexity reductions and direct algorithmic constructions.
Axiom & Free-Parameter Ledger
axioms (1)
- standard math Standard definitions of NP-completeness via polynomial reductions apply to the lifted problems.
Reference graph
Works this paper leans on
-
[1]
S. Alhussaini, C. Collett, and S. Sergeev. “On the tropical two-sided discrete logarithm and a key exchange protocol based on the tropical algebra of pairs”. In: Communications in Algebra 52.10 (2024), pp. 4115–4134. doi: 10.1080/00927872.2024.2341814
-
[2]
A Characterization of Wreath Products Where Knapsack Is Decidable
P. Bergstr¨ aßer, M. Ganardi, and G. Zetzsche. “A Characterization of Wreath Products Where Knapsack Is Decidable”. In: 38th International Symposium on Theoretical Aspects of Com- puter Science (STACS 2021). Vol. 187. 2021, 11:1–11:17.doi: 10.4230/LIPIcs.STACS.2021. 11
-
[3]
An attack on a key exchange protocol based on max-times and min-times algebras
I. Buchinskiy, M. Kotov, and A. Treier. “An attack on a key exchange protocol based on max-times and min-times algebras”. In: Indian Journal of Pure and Applied Mathematics 56 (2025), pp. 180–190. doi: 10.1007/s13226-023-00469-0
-
[4]
Analysis of four protocols based on tropical circu- lant matrices
I. Buchinskiy, M. Kotov, and A. Treier. “Analysis of four protocols based on tropical circu- lant matrices”. In: Indian Journal of Pure and Applied Mathematics (2024). doi: 10.1007/ s13226-024-00737-7
work page 2024
-
[5]
On the Complexity of the Problem of Solving Systems of Tropical Polynomial Equations of Degree Two
I. Buchinskiy, M. Kotov, and A. Treier. “On the Complexity of the Problem of Solving Systems of Tropical Polynomial Equations of Degree Two”. In: Mathematical Optimization Theory and Operations Research: Recent Trends . Ed. by A. Eremeev et al. Communications in Computer and Information Science. Cham: Springer Nature Switzerland, 2024, pp. 73–84. doi: 10....
-
[6]
P. Butkoviˇ c. Max-linear systems: theory and algorithms . London: Springer, 2010. doi: 10. 1007/978-1-84996-299-5
work page 2010
-
[7]
Knapsack problems—An overview of recent advances. Part I: Single knapsack problems
V. Cacchiani et al. “Knapsack problems—An overview of recent advances. Part I: Single knapsack problems”. In: Computers & Operations Research 143 (2022), p. 105692. doi: 10. 1016/j.cor.2021.105692
-
[8]
V. Cacchiani et al. “Knapsack problems—An overview of recent advances. Part II: Multiple, multidimensional, and quadratic knapsack problems”. In: Computers & Operations Research 143 (2022), p. 105693. doi: 10.1016/j.cor.2021.105693
-
[9]
T. H. Cormen et al. Introduction to algorithms . Cambridge, MA: MIT press, 2022
work page 2022
-
[10]
Decidability of knapsack problem for Baumslag–Solitar group
F. Dudkin and A. Treier. “Decidability of knapsack problem for Baumslag–Solitar group”. In: Journal of Physics: Conference Series . Vol. 1050. 1. IOP Publishing. 2018, p. 012022. doi: 10.1088/1742-6596/1050/1/012022
-
[11]
Knapsack problem for Baumslag–Solitair groups
F. Dudkin and A. Treier. “Knapsack problem for Baumslag–Solitair groups”. In: Siberian Journal of Pure and Applied Mathematics 18.4 (2018). In Russian, pp. 43–55. doi: 10 . 33048/pam.2018.18.404
work page 2018
-
[12]
An application of different dioids in public key cryptography
M. I. Durcheva. “An application of different dioids in public key cryptography”. In: AIP Conference Proceedings. Vol. 1631. American Institute of Physics. 2014, pp. 336–343. doi: 10.1063/1.4902495. 15
-
[13]
E. Frenkel, A. Nikolaev, and A. Ushakov. “Knapsack problems in products of groups”. In: Journal of Symbolic Computation 74 (2016), pp. 96–108. issn: 0747-7171. doi: 10.1016/j. jsc.2015.05.006
work page doi:10.1016/j 2016
-
[14]
Knapsack and the power word problem in solv- able Baumslag–Solitar groups
M. Ganardi, M. Lohrey, and G. Zetzsche. “Knapsack and the power word problem in solv- able Baumslag–Solitar groups”. In: International Journal of Algebra and Computation 33.03 (2023), pp. 617–639. doi: 10.1142/S0218196723500285
-
[15]
Knapsack Problems for Wreath Products
M. Ganardi et al. “Knapsack Problems for Wreath Products”. In: 35th Symposium on The- oretical Aspects of Computer Science . Ed. by R. Niedermeier and B. Vall´ ee. Vol. 96. Leibniz International Proceedings in Informatics (LIPIcs). 2018, 32:1–32:13. isbn: 978-3-95977-062-0. doi: 10.4230/LIPIcs.STACS.2018.32
-
[16]
M. R. Garey and D. S. Johnson. Computers and intractability: A Guide to the Theory of NP-Completeness. San Francisco: W.H. Freeman, 1979
work page 1979
-
[17]
Cyclic projectors and separation theorems in idempotent convex geometry
S. Gaubert and S. Sergeev. “Cyclic projectors and separation theorems in idempotent convex geometry”. In: Journal of Mathematical Sciences 155 (2008), pp. 815–829. doi: 10.1007/ s10958-008-9243-8
work page 2008
-
[18]
D. Grigoriev and V. Shpilrain. “Tropical cryptography”. In: Comm. Algebra 42.6 (2014), pp. 2624–2632. doi: 10.1080/00927872.2013.766827
-
[19]
D. Grigoriev and V. Shpilrain. “Tropical cryptography II: extensions by homomorphisms”. In: Comm. Algebra 47.10 (2019), pp. 4224–4229. doi: 10.1080/00927872.2019.1581213
-
[20]
On the complexity of model checking counter automata
C. Haase. “On the complexity of model checking counter automata”. Ph.D. thesis. University of Oxford, 2012
work page 2012
-
[21]
A closer look at the tropical cryptography
S. Isaac and D. Kahrobaei. “A closer look at the tropical cryptography”. In: Int. J. Comput. Math.: Comput. Syst. Theory 6.2 (2021), pp. 137–142. doi: 10 . 1080 / 23799927 . 2020 . 1862303
work page 2021
-
[22]
Reducibility among combinatorial problems
R. Karp. “Reducibility among combinatorial problems”. In: Complexity of Computer Com- putation (1972), pp. 85–104. doi: 10.1007/978-1-4684-2001-2_9
-
[23]
Knapsack and subset sum problems in nilpotent, poly- cyclic, and co-context-free groups
D. K¨ onig, M. Lohrey, and G. Zetzsche. “Knapsack and subset sum problems in nilpotent, poly- cyclic, and co-context-free groups”. In: Algebra and Computer Science 677 (2016), pp. 138–
work page 2016
-
[24]
doi: 10.1090/conm/677/13625
-
[25]
Analysis of a key exchange protocol based on tropical matrix algebra
M. Kotov and A. Ushakov. “Analysis of a key exchange protocol based on tropical matrix algebra”. In: J. Math. Cryptol. 12.3 (2018), pp. 137–141. doi: 10.1515/jmc-2016-0064
-
[26]
M. Lohrey. “Knapsack in hyperbolic groups”. In: Journal of Algebra 545 (2020), pp. 390–415. doi: 10.1016/j.jalgebra.2019.04.008
-
[27]
Knapsack in Graph Groups, HNN-Extensions and Amalgamated Products
M. Lohrey and G. Zetzsche. “Knapsack in Graph Groups, HNN-Extensions and Amalgamated Products”. In: 33rd Symposium on Theoretical Aspects of Computer Science . Vol. 47. 2016, 50:1–50:14. doi: 10.4230/LIPIcs.STACS.2016.50
-
[28]
The Complexity of Knapsack in Graph Groups
M. Lohrey and G. Zetzsche. “The Complexity of Knapsack in Graph Groups”. In: 34th Sympo- sium on Theoretical Aspects of Computer Science . Vol. 66. Leibniz International Proceedings in Informatics. 2017, 52:1–52:14. doi: 10.4230/LIPIcs.STACS.2017.52
-
[29]
Knapsack problem for nilpotent groups
A. Mishchenko and A. Treier. “Knapsack problem for nilpotent groups”. In: Groups Com- plexity Cryptology 9.1 (2017), pp. 87–98. doi: 10.1515/gcc-2017-0006
-
[30]
On NP-completeness of subset sum problem for Lamplighter group
A. Mishchenko and A. Treier. “On NP-completeness of subset sum problem for Lamplighter group”. In: Journal of Physics: Conference Series . Vol. 1050. IOP Publishing. 2018, p. 012055. doi: 10.1088/1742-6596/1050/1/012055
-
[31]
A. Mishchenko and A. Treier. “Universal input of knapsack problem for groups”. In:Journal of Physics: Conference Series. Vol. 1050. IOP Publishing. 2018, p. 012054. doi: 10.1088/1742- 6596/1050/1/012054
-
[32]
B. M. Moret. The Theory of Computation . USA: Addison-Wesley, 1997. doi: 10 . 5555 / 550016. 16
work page 1997
-
[33]
Public key cryptography based on tropical algebra
A. Muanalifah. “Public key cryptography based on tropical algebra”. PhD thesis. University of Birmingham, 2023
work page 2023
-
[34]
On convergence of stringy motives of wild p^n -cyclic quotient singularities
A. Muanalifah and S. Sergeev. “On the tropical discrete logarithm problem and security of a protocol based on tropical semidirect product”. In: Communications in Algebra 50.2 (2022), pp. 861–879. doi: 10.1080/00927872.2021.1975125
-
[35]
A. Myasnikov, A. Nikolaev, and A. Ushakov. “Knapsack problems in groups”. In: Mathematics of Computation 84.292 (2015), pp. 987–1016. doi: 10.1090/S0025-5718-2014-02880-9
-
[36]
Generic polynomial algorithms for the knapsack problem in some matrix semigroups,
A. N. Rybalov. “Generic polynomial algorithms for the knapsack problem in some matrix semigroups,” in: Siberian Electronic Mathematical Reports 20.1 (2023). In Russian, pp. 100–
work page 2023
-
[37]
doi: 10.33048/semi.2023.20.009
-
[38]
A. N. Rybalov. “On generic complexity of the subset sum problem for monoids and groups of integer matrices of order 2”. In: Vestnik of Omsk University 25.4 (2020). In Russian, pp. 10–
work page 2020
-
[39]
doi: 10.24147/1812-3996.2020.25(4).10-15
-
[40]
On generic complexity of the subset sum problem for semigroups of integer matrices
A. N. Rybalov. “On generic complexity of the subset sum problem for semigroups of integer matrices”. In: Prikladnaya Diskretnaya Matematika 4 (2020). In Russian, pp. 118–126. doi: 10.17223/20710410/50/9
-
[41]
A note on square roots of nonnegative matrices
Y. Shitov. “A note on square roots of nonnegative matrices”. In: Linear Algebra and Its Applications 497 (2016), pp. 62–65. doi: 10.1016/j.laa.2016.02.022
-
[42]
On square roots of matrices over the max-time semiring R+
I. M. Sulandra and A. N. Isnia. “On square roots of matrices over the max-time semiring R+”. In: Journal of Physics: Conference Series . Vol. 1872. IOP Publishing. 2021, p. 012014. doi: 10.1088/1742-6596/1872/1/012014
-
[43]
Constrained inhomogeneous spherical equations: average-case hardness
A. Ushakov. “Constrained inhomogeneous spherical equations: average-case hardness”. In: journal of Groups, complexity, cryptology 16.1 (2024), 3:1–3:18. doi: 10.46298/jgcc.2024. 16.1.13555. I. M. Buchinskiy , Sobolev Institute of Mathematics of SB RAS, Omsk, Russia Email address : buchvan@mail.ru M. V. Kotov , Sobolev Institute of Mathematics of SB RAS, O...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.