We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
The namespace tnoc.subset-diophantine implements the reduction from Subset Sum to Quadratic Diophantine Equation detailed on pages 150 and following.
tnoc.subset-diophantine
For example the weights [1 2] and the target value 2 are a satisfiable instance of Subset Sum. These produce the Quadratic Diophantine Equation
[1 2]
2
(subset-diophantine [1 2] 2) => (fn [x y] (= (+' (*' 2075941759359391 x x) (*' 182250000 y)) 605819780586669854621599N))
which is indeed satisfied by
(find-X-Y [1 2] 2) => [-14167 1037970897919001N]