[ https://issues.apache.org/jira/browse/MATH-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919206#comment-13919206 ]
Thomas Neidhart commented on MATH-1108: --------------------------------------- Hi Alexander, your problem looks more like a least-squares problem with bounds to me. The constraints defined for the simplex solver are quite tight, i.e. all constraint rows have a right hand side of = 0. I would rather relax this criteria like this: constraints.add(new LinearConstraint(vector, Relationship.LEQ, 1e-6)); constraints.add(new LinearConstraint(vector, Relationship.GEQ, -1e-6)); So you try to find a solution for | s * v | <= 1e-6 With this (and testing with the latest trunk version) I get a solution that is consistent with all constraints: 0.17108682266 but it takes some time, as the problem is quite large, and the implemented simplex algorithm is not using the faster revised method yet. I would suggest that you describe your problem in more detail and ask on the user mailinglist as there maybe a better way to solve your problem and there are several experts for different optimization methods reading there that can give advise. > SimplexSolver returns TooManyIterationsException > ------------------------------------------------ > > Key: MATH-1108 > URL: https://issues.apache.org/jira/browse/MATH-1108 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.2, 3.1.1 > Reporter: Buharov Alexander > Attachments: Problem.zip > > > We have vector v and matrix s (from file S.txt) > v - vector ( size: 1*649 ) > s - matrix ( size: 554*649 ) > We want solve linear problem: > * max (v[31]) > * Bounds: > * s*v = 0 > * -1 <= v[i] <= 1 for i=0,..., 648 > We changed MaxIter parameter (from 100 to 1e+6). And we changed epsilon ( > set default value and 1e-3). But solver always throws > TooManyIterationsException (and work very slow). -- This message was sent by Atlassian JIRA (v6.2#6252)