Speeding-up FindInstance
- To: mathgroup at smc.vnet.net
- Subject: [mg94919] Speeding-up FindInstance
- From: "Colletti, Bruce W." <bcolletti at nvcc.edu>
- Date: Tue, 30 Dec 2008 05:55:22 -0500 (EST)
Re Mathematica 7.0.
Let X be an n-by-p array of indexed x-variables, e.g., x[1,1], x[1,2], etc.
I seek x-values in {-1, 0, 1} so that all column sums are zero and no column is the zero vector.
The code below for a 5x3 problem runs forever. What is a faster way to get a solution? Thankx.
Bruce
{n,p} = {5,3};
X=Array[x,{n,p}];
Z = Flatten[X];
FindInstance[And@@Join[Map[#==0&,Total@X],
Map[#>0&,Map[Abs,Total@X,{2}]],
Map[Abs@#<=1&,Z]],Z,Integers]
- Follow-Ups:
- Re: Speeding-up FindInstance
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Speeding-up FindInstance
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Speeding-up FindInstance
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Speeding-up FindInstance