Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

It seems FindInstance uses different methods to find 1 instance and to find more than one instance.

constraint = {a > 0, b >= 0, c >= a + b, a >= c/4};

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 1],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 2],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

LinearDiophantineInstance returns quickly, even on the 9-variable problem. The second call to ReduceInstance in the 2-instance case takes a long time, which is easy to believe given the complexity of the auxiliary system. In the 9-variable case, I only waited a few minutes while, I assume, it was building the argument for a second ReduceInstance call.

I do not know whether there is a reason to use ReduceInstance instead of nested calls to LinearDiophantineInstance, similar to Mr.Wizard'sMr.Wizard's approach. Given that it handles both of the examples, it seems unlikely.

It seems FindInstance uses different methods to find 1 instance and to find more than one instance.

constraint = {a > 0, b >= 0, c >= a + b, a >= c/4};

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 1],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 2],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

LinearDiophantineInstance returns quickly, even on the 9-variable problem. The second call to ReduceInstance in the 2-instance case takes a long time, which is easy to believe given the complexity of the auxiliary system. In the 9-variable case, I only waited a few minutes while, I assume, it was building the argument for a second ReduceInstance call.

I do not know whether there is a reason to use ReduceInstance instead of nested calls to LinearDiophantineInstance, similar to Mr.Wizard's approach. Given that it handles both of the examples, it seems unlikely.

It seems FindInstance uses different methods to find 1 instance and to find more than one instance.

constraint = {a > 0, b >= 0, c >= a + b, a >= c/4};

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 1],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 2],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

LinearDiophantineInstance returns quickly, even on the 9-variable problem. The second call to ReduceInstance in the 2-instance case takes a long time, which is easy to believe given the complexity of the auxiliary system. In the 9-variable case, I only waited a few minutes while, I assume, it was building the argument for a second ReduceInstance call.

I do not know whether there is a reason to use ReduceInstance instead of nested calls to LinearDiophantineInstance, similar to Mr.Wizard's approach. Given that it handles both of the examples, it seems unlikely.

Source Link
Michael E2
  • 245k
  • 18
  • 351
  • 775

It seems FindInstance uses different methods to find 1 instance and to find more than one instance.

constraint = {a > 0, b >= 0, c >= a + b, a >= c/4};

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 1],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

Trace[
 FindInstance[constraint, {a, b, c}, Integers, 2],
 _Reduce`LinearDiophantineInstance | _Reduce`ReduceInstance,
 TraceInternal -> True
 ]

Mathematica graphics

LinearDiophantineInstance returns quickly, even on the 9-variable problem. The second call to ReduceInstance in the 2-instance case takes a long time, which is easy to believe given the complexity of the auxiliary system. In the 9-variable case, I only waited a few minutes while, I assume, it was building the argument for a second ReduceInstance call.

I do not know whether there is a reason to use ReduceInstance instead of nested calls to LinearDiophantineInstance, similar to Mr.Wizard's approach. Given that it handles both of the examples, it seems unlikely.