MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

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]


  • Prev by Date: Tooltip doesn't work with Raster, ArrayPlot, MatrixPlot? (cont.)
  • Next by Date: Re: Problems with Dynamic inside Panel in V7
  • Previous by thread: Tooltip doesn't work with Raster, ArrayPlot, MatrixPlot? (cont.)
  • Next by thread: Re: Speeding-up FindInstance