# Wolfram|Cloud memory limit exceeded

I have some formulas from a paper (Provably Manipulation-Resistant Reputation Systems) that I would like to run 3 times (with different nummbers).

Therefore, I wrote a small programm that now finally works ... and bam:

This computation has exceeded the memory limit for your plan

I didn't know something like this could occur.

Is there anything I can do to improve my code so that it runs to completion?

Formulas:

This is my code (first time coding with Wolfram|Cloud):

unr =  4;
lnr =  3;
size = unr * lnr;
eps =  0.2;

e = SparseArray[{{2, 3} -> -1}, {size,size}];
n = Array[f , {size,size}];

bounds = (If[0 <= # <= 1, True, Throw[False], Throw[False]])&;
checkLessEquals = (Catch[Map[bounds, #, {2}]; Throw[True]])&;

prod = (Total[#1*#2, 2])&;

ArgMax[
{eps *  prod[e, n] + Log[Det[n+IdentityMatrix[size]]],
checkLessEquals[n] && PositiveDefiniteMatrixQ[n]},
Flatten[n]]

• "from a paper" - for reference, could you link to it, please? – J. M. will be back soon Jan 14 '17 at 5:42
• @J.M. Sure. Sorry, i forgot to reference it. – besnep Jan 14 '17 at 5:52
• Does it make sense to get that Det[]? Note that you should be able to work out for yourself what the Determinant is with relative ease! It's a lot of work, but this is what hangs your calculation. – Feyre Jan 14 '17 at 10:01
• @Feyre: I can't exclude Det[] from the calculation because i'm trying to find a matrix (n) that maximises the complete formula. I thought it's more likely that the computation is so bad because i have 144 variables that i'm ajusting to find a maximum for the calculation. I'm not sure if the constraints / bounds i specified is correct this way.. because that should minimalize the computation. – besnep Jan 14 '17 at 13:51
• You've got other problems though checkLessEquals[n] and PositiveDefiniteMatrixQ[n] both evaluate to False. – Feyre Jan 14 '17 at 14:08

ve = Array[v, {size}];

1., 0, 1., 1., 0, 0, 1., 1., 0, 1., 1., 0, 0, 1., 1., 0, 0, 0, 0, 0, 1., 1., 1., 1., 1., 0, 1., 0, 1., 1., 1., 1., 0, 0, 0, 1., 1.4288, 0.403799, -0.37193, 0.742415, -0.39883, -0.0280605}