coin-or / pulp

A python Linear Programming API

Home Page:http://coin-or.github.io/pulp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PuLP CBC reports "infeasible" for a feasible problem

tle4336 opened this issue · comments

Details for the issue

What did you do?

I am currently encountering a very weird issue with the PULP_CBC_CMD solver via pulp package in Python (CBC MILP Solver - version 2.10.3). Despite playing around with the parameter options gapAbs and fracGap, I had no way to make the CBC MILP solver to avoid running into infeasible status. However, the optimization model is actually feasible (the model is an LP problem, with all variables being continuous between 0 and 1), as it was solved quickly and easily via lpsolve package in R (with optimal value =112268.4). I then compared the two models and could confirm that they are identical (so, the part of building the model in 2 languages is fine). I am wondering if anyone could help me figure out how to fix this incorrect issue?

Attached is the model in .lp and .mps format, exported from both Python and R (you can see the filename to determine which one is exported from Python).
Downloads.zip

I also include the .txt log file given by the CBC run. I also compute the values of the constraints as well as their corresponding slacks below:

constraint _C1 has value: -7.85e+02 and slack: 7.85e+02
constraint _C2 has value: -2.30e+01 and slack: 2.30e+01
constraint _C3 has value: 3.20e+01 and slack: -3.20e+01
constraint _C4 has value: -1.20e+01 and slack: 1.20e+01
constraint _C5 has value: 2.80e+01 and slack: -2.80e+01
constraint _C6 has value: 1.00e-08 and slack: -0.00e+00
constraint _C7 has value: 4.30e+01 and slack: -4.30e+01
constraint _C8 has value: -5.00e+00 and slack: 5.00e+00
constraint _C9 has value: 2.70e+01 and slack: -2.70e+01
constraint _C10 has value: -8.00e+00 and slack: 8.00e+00
constraint _C11 has value: 1.00e+01 and slack: -1.00e+01
constraint _C12 has value: -2.60e+01 and slack: 2.60e+01
constraint _C13 has value: 1.60e+01 and slack: -1.60e+01
constraint _C14 has value: -9.00e+00 and slack: 9.00e+00
constraint _C15 has value: 2.50e+01 and slack: -2.50e+01
constraint _C16 has value: -1.60e+01 and slack: 1.60e+01
constraint _C17 has value: 1.70e+01 and slack: -1.70e+01
constraint _C18 has value: -2.30e+01 and slack: 2.30e+01
constraint _C19 has value: 2.60e+01 and slack: -2.60e+01
constraint _C20 has value: -1.50e+01 and slack: 1.50e+01
constraint _C21 has value: 4.10e+01 and slack: -4.10e+01
constraint _C22 has value: -6.70e+01 and slack: 6.70e+01
constraint _C23 has value: 7.00e+00 and slack: -7.00e+00
constraint _C24 has value: -1.80e+01 and slack: 1.80e+01
constraint _C25 has value: 4.00e+00 and slack: -4.00e+00
constraint _C26 has value: -2.00e+00 and slack: 2.00e+00
constraint _C27 has value: 3.00e+01 and slack: -3.00e+01
constraint _C28 has value: -5.60e+01 and slack: 5.60e+01
constraint _C29 has value: 5.00e+00 and slack: -5.00e+00
constraint _C30 has value: -5.80e+01 and slack: 5.80e+01
constraint _C31 has value: 2.00e+00 and slack: -2.00e+00
constraint _C32 has value: -4.10e+01 and slack: 4.10e+01
constraint _C33 has value: 7.00e+00 and slack: -7.00e+00
constraint _C34 has value: -1.30e+01 and slack: 1.30e+01
constraint _C35 has value: 5.40e+01 and slack: -5.40e+01
constraint _C36 has value: -1.40e+01 and slack: 1.40e+01
constraint _C37 has value: 5.20e+01 and slack: -5.20e+01
constraint _C38 has value: 0.00e+00 and slack: -0.00e+00
constraint _C39 has value: 2.00e+00 and slack: -2.00e+00
constraint _C40 has value: -1.60e+01 and slack: 1.60e+01
constraint _C41 has value: 1.70e+01 and slack: -1.70e+01
constraint _C42 has value: -2.40e+01 and slack: 2.40e+01
constraint _C43 has value: 2.50e+01 and slack: -2.50e+01
constraint _C44 has value: -7.30e+01 and slack: 7.30e+01
constraint _C45 has value: 9.00e+00 and slack: -9.00e+00
constraint _C46 has value: 0.00e+00 and slack: -0.00e+00
constraint _C47 has value: 3.80e+01 and slack: -3.80e+01
constraint _C48 has value: -1.10e+01 and slack: 1.10e+01
constraint _C49 has value: 6.00e+01 and slack: -6.00e+01
constraint _C50 has value: -7.30e+01 and slack: 7.30e+01
constraint _C51 has value: 7.00e+00 and slack: -7.00e+00
constraint _C52 has value: -2.10e+01 and slack: 2.10e+01
constraint _C53 has value: 1.00e+00 and slack: -1.00e+00
constraint _C54 has value: -3.40e+01 and slack: 3.40e+01
constraint _C55 has value: 4.00e+00 and slack: -4.00e+00
constraint _C56 has value: -6.40e+01 and slack: 6.40e+01
constraint _C57 has value: 1.00e+00 and slack: -1.00e+00
constraint _C58 has value: -6.40e+01 and slack: 6.40e+01
constraint _C59 has value: 2.00e+00 and slack: -2.00e+00
constraint _C60 has value: -4.30e+01 and slack: 4.30e+01
constraint _C61 has value: 0.00e+00 and slack: -0.00e+00
constraint _C62 has value: -3.60e+01 and slack: 3.60e+01
constraint _C63 has value: 2.70e+01 and slack: -2.70e+01
constraint _C64 has value: 0.00e+00 and slack: -0.00e+00
constraint _C65 has value: -1.00e+00 and slack: 1.00e+00
constraint _C66 has value: 1.00e+00 and slack: -1.00e+00
constraint _C67 has value: 0.00e+00 and slack: -0.00e+00
constraint _C68 has value: 1.60e+01 and slack: -1.60e+01
constraint _C69 has value: 2.00e+00 and slack: -2.00e+00
constraint _C70 has value: 1.00e+00 and slack: -1.00e+00
constraint _C71 has value: 0.00e+00 and slack: -0.00e+00
constraint _C72 has value: 2.90e+01 and slack: -2.90e+01
constraint _C73 has value: 0.00e+00 and slack: -0.00e+00
constraint _C74 has value: 1.80e+01 and slack: -1.80e+01
constraint _C75 has value: 1.00e-08 and slack: -0.00e+00
constraint _C76 has value: 3.00e+00 and slack: -3.00e+00
constraint _C77 has value: 0.00e+00 and slack: -0.00e+00
constraint _C78 has value: 2.80e+01 and slack: -2.80e+01
constraint _C79 has value: 0.00e+00 and slack: -0.00e+00
constraint _C80 has value: 0.00e+00 and slack: -0.00e+00
constraint _C81 has value: 0.00e+00 and slack: -0.00e+00
constraint _C82 has value: 0.00e+00 and slack: -0.00e+00
constraint _C83 has value: 0.00e+00 and slack: -0.00e+00
constraint _C84 has value: 1.20e+01 and slack: -1.20e+01
constraint _C85 has value: -2.00e+00 and slack: 2.00e+00
constraint _C86 has value: 1.70e+01 and slack: -1.70e+01
constraint _C87 has value: -6.00e-08 and slack: -0.00e+00
constraint _C88 has value: 0.00e+00 and slack: -0.00e+00
constraint _C89 has value: 0.00e+00 and slack: -0.00e+00
constraint _C90 has value: 3.50e+01 and slack: -3.50e+01
constraint _C91 has value: 0.00e+00 and slack: -0.00e+00
constraint _C92 has value: 1.00e+00 and slack: -1.00e+00
constraint _C93 has value: 0.00e+00 and slack: -0.00e+00
constraint _C94 has value: 0.00e+00 and slack: -0.00e+00
constraint _C95 has value: 0.00e+00 and slack: -0.00e+00
constraint _C96 has value: 2.30e+01 and slack: -2.30e+01
constraint _C97 has value: 3.00e+00 and slack: -3.00e+00
constraint _C98 has value: 1.20e+01 and slack: -1.20e+01
constraint _C99 has value: 0.00e+00 and slack: -0.00e+00
constraint _C100 has value: 2.40e+01 and slack: -2.40e+01
constraint _C101 has value: -1.30e+01 and slack: 1.30e+01
constraint _C102 has value: 8.00e+00 and slack: -8.00e+00
constraint _C103 has value: 1.00e+00 and slack: -1.00e+00
constraint _C104 has value: 1.00e+00 and slack: -1.00e+00
constraint _C105 has value: 0.00e+00 and slack: -0.00e+00
constraint _C106 has value: 1.30e+01 and slack: -1.30e+01
constraint _C107 has value: 6.00e-08 and slack: -0.00e+00
constraint _C108 has value: 2.00e+00 and slack: -2.00e+00
constraint _C109 has value: 1.00e+00 and slack: -1.00e+00
constraint _C110 has value: 0.00e+00 and slack: -0.00e+00
constraint _C111 has value: -1.00e+00 and slack: 1.00e+00
constraint _C112 has value: 1.60e+01 and slack: -1.60e+01
constraint _C113 has value: 2.00e+00 and slack: -2.00e+00
constraint _C114 has value: 1.00e+00 and slack: -1.00e+00
constraint _C115 has value: 1.00e+00 and slack: -1.00e+00
constraint _C116 has value: 1.10e+01 and slack: -1.10e+01
constraint _C117 has value: -1.00e-07 and slack: -0.00e+00
constraint _C118 has value: 4.00e+00 and slack: -4.00e+00
constraint _C119 has value: 1.00e+00 and slack: -1.00e+00
constraint _C120 has value: 1.00e+00 and slack: -1.00e+00
constraint _C121 has value: -1.00e+00 and slack: 1.00e+00
constraint _C122 has value: 0.00e+00 and slack: -0.00e+00
constraint _C123 has value: 0.00e+00 and slack: -0.00e+00
constraint _C124 has value: 0.00e+00 and slack: -0.00e+00
constraint _C125 has value: -3.00e+00 and slack: 3.00e+00
constraint _C126 has value: 0.00e+00 and slack: -0.00e+00
constraint _C127 has value: 0.00e+00 and slack: -0.00e+00
constraint _C128 has value: 0.00e+00 and slack: -0.00e+00
constraint _C129 has value: 0.00e+00 and slack: -0.00e+00
constraint _C130 has value: 2.00e+01 and slack: -2.00e+01
constraint _C131 has value: -1.00e-07 and slack: -0.00e+00
constraint _C132 has value: 2.00e+00 and slack: -2.00e+00
constraint _C133 has value: 1.00e+00 and slack: -1.00e+00
constraint _C134 has value: 1.00e+00 and slack: -1.00e+00
constraint _C135 has value: -1.00e+00 and slack: 1.00e+00
constraint _C136 has value: 0.00e+00 and slack: -0.00e+00
constraint _C137 has value: 0.00e+00 and slack: -0.00e+00
constraint _C138 has value: 0.00e+00 and slack: -0.00e+00
constraint _C139 has value: 0.00e+00 and slack: -0.00e+00
constraint _C140 has value: 1.40e+01 and slack: -1.40e+01
constraint _C141 has value: 1.20e-07 and slack: -0.00e+00
constraint _C142 has value: 3.00e+00 and slack: -3.00e+00
constraint _C143 has value: 2.00e+00 and slack: -2.00e+00
constraint _C144 has value: 2.00e+00 and slack: -2.00e+00
constraint _C145 has value: 1.00e+00 and slack: -1.00e+00
constraint _C146 has value: 0.00e+00 and slack: -0.00e+00
constraint _C147 has value: 0.00e+00 and slack: -0.00e+00
constraint _C148 has value: 0.00e+00 and slack: -0.00e+00
constraint _C149 has value: 0.00e+00 and slack: -0.00e+00
constraint _C150 has value: 2.30e+01 and slack: -2.30e+01
constraint _C151 has value: 6.00e-08 and slack: -0.00e+00
constraint _C152 has value: 5.00e+00 and slack: -5.00e+00
constraint _C153 has value: 2.00e+00 and slack: -2.00e+00
constraint _C154 has value: 0.00e+00 and slack: -0.00e+00
constraint _C155 has value: 0.00e+00 and slack: -0.00e+00
constraint _C156 has value: 7.00e+00 and slack: -7.00e+00
constraint _C157 has value: 0.00e+00 and slack: -0.00e+00
constraint _C158 has value: 1.40e+01 and slack: -1.40e+01
constraint _C159 has value: 3.00e+00 and slack: -3.00e+00
constraint _C160 has value: 2.00e+00 and slack: -2.00e+00
constraint _C161 has value: 1.00e+00 and slack: -1.00e+00
constraint _C162 has value: 1.00e+00 and slack: -1.00e+00
constraint _C163 has value: 0.00e+00 and slack: -0.00e+00
constraint _C164 has value: 2.80e+01 and slack: -2.80e+01
constraint _C165 has value: -8.00e-08 and slack: -0.00e+00
constraint _C166 has value: 3.00e+00 and slack: -3.00e+00
constraint _C167 has value: 0.00e+00 and slack: -0.00e+00
constraint _C168 has value: 0.00e+00 and slack: -0.00e+00
constraint _C169 has value: 0.00e+00 and slack: -0.00e+00
constraint _C170 has value: 5.00e+00 and slack: -5.00e+00
constraint _C171 has value: 0.00e+00 and slack: -0.00e+00
constraint _C172 has value: 1.00e+00 and slack: -1.00e+00
constraint _C173 has value: 0.00e+00 and slack: -0.00e+00
constraint _C174 has value: 0.00e+00 and slack: -0.00e+00
constraint _C175 has value: 0.00e+00 and slack: -0.00e+00
constraint _C176 has value: 0.00e+00 and slack: -0.00e+00
constraint _C177 has value: 0.00e+00 and slack: -0.00e+00
constraint _C178 has value: 4.00e+00 and slack: -4.00e+00
constraint _C179 has value: 1.00e+00 and slack: -1.00e+00
constraint _C180 has value: 0.00e+00 and slack: -0.00e+00
constraint _C181 has value: 0.00e+00 and slack: -0.00e+00
constraint _C182 has value: 0.00e+00 and slack: -0.00e+00
constraint _C183 has value: 0.00e+00 and slack: -0.00e+00
constraint _C184 has value: 5.00e+00 and slack: -5.00e+00
constraint _C185 has value: 1.00e+00 and slack: -1.00e+00
constraint _C186 has value: 2.00e+00 and slack: -2.00e+00
constraint _C187 has value: 1.00e+00 and slack: -1.00e+00
constraint _C188 has value: 1.00e+00 and slack: -1.00e+00
constraint _C189 has value: 0.00e+00 and slack: -0.00e+00
constraint _C190 has value: 0.00e+00 and slack: -0.00e+00
constraint _C191 has value: 0.00e+00 and slack: -0.00e+00
constraint _C192 has value: 4.00e+00 and slack: -4.00e+00
constraint _C193 has value: 2.00e+00 and slack: -2.00e+00
constraint _C194 has value: 0.00e+00 and slack: -0.00e+00
constraint _C195 has value: 0.00e+00 and slack: -0.00e+00
constraint _C196 has value: 1.90e+01 and slack: -1.90e+01
constraint _C197 has value: -1.00e-07 and slack: -0.00e+00
constraint _C198 has value: 3.00e+00 and slack: -3.00e+00
constraint _C199 has value: 0.00e+00 and slack: -0.00e+00
constraint _C200 has value: 2.00e+00 and slack: -2.00e+00
constraint _C201 has value: 0.00e+00 and slack: -0.00e+00
constraint _C202 has value: 0.00e+00 and slack: -0.00e+00
constraint _C203 has value: 0.00e+00 and slack: -0.00e+00
constraint _C204 has value: 4.00e+00 and slack: -4.00e+00
constraint _C205 has value: 0.00e+00 and slack: -0.00e+00
constraint _C206 has value: 0.00e+00 and slack: -0.00e+00
constraint _C207 has value: 0.00e+00 and slack: -0.00e+00
constraint _C208 has value: 0.00e+00 and slack: -0.00e+00
constraint _C209 has value: 0.00e+00 and slack: -0.00e+00
constraint _C210 has value: 2.00e+00 and slack: -2.00e+00
constraint _C211 has value: 1.00e+00 and slack: -1.00e+00
constraint _C212 has value: 0.00e+00 and slack: -0.00e+00
constraint _C213 has value: 0.00e+00 and slack: -0.00e+00
constraint _C214 has value: 4.00e+00 and slack: -4.00e+00
constraint _C215 has value: 0.00e+00 and slack: -0.00e+00
constraint _C216 has value: 0.00e+00 and slack: -0.00e+00
constraint _C217 has value: 0.00e+00 and slack: -0.00e+00
constraint _C218 has value: 0.00e+00 and slack: -0.00e+00
constraint _C219 has value: 0.00e+00 and slack: -0.00e+00
constraint _C220 has value: 0.00e+00 and slack: -0.00e+00
constraint _C221 has value: 0.00e+00 and slack: -0.00e+00
constraint _C222 has value: 1.00e+00 and slack: -1.00e+00
constraint _C223 has value: 1.00e+00 and slack: -1.00e+00
constraint _C224 has value: 0.00e+00 and slack: -0.00e+00
constraint _C225 has value: 0.00e+00 and slack: -0.00e+00
constraint _C226 has value: 4.00e+00 and slack: -4.00e+00
constraint _C227 has value: 0.00e+00 and slack: -0.00e+00
constraint _C228 has value: 0.00e+00 and slack: -0.00e+00
constraint _C229 has value: 0.00e+00 and slack: -0.00e+00
constraint _C230 has value: 0.00e+00 and slack: -0.00e+00
constraint _C231 has value: 0.00e+00 and slack: -0.00e+00
constraint _C232 has value: 3.00e+00 and slack: -3.00e+00
constraint _C233 has value: -2.00e+01 and slack: 2.00e+01
constraint _C234 has value: 0.00e+00 and slack: -0.00e+00
constraint _C235 has value: 0.00e+00 and slack: -0.00e+00
constraint _C236 has value: 0.00e+00 and slack: -0.00e+00
constraint _C237 has value: 0.00e+00 and slack: -0.00e+00
constraint _C238 has value: 0.00e+00 and slack: -0.00e+00
constraint _C239 has value: 0.00e+00 and slack: -0.00e+00
constraint _C240 has value: 1.10e+01 and slack: -1.10e+01
constraint _C241 has value: 3.00e+00 and slack: -3.00e+00
constraint _C242 has value: 4.40e+01 and slack: -4.40e+01
constraint _C243 has value: 5.00e-08 and slack: -0.00e+00
constraint _C244 has value: 0.00e+00 and slack: -0.00e+00
constraint _C245 has value: 0.00e+00 and slack: -0.00e+00
constraint _C246 has value: 0.00e+00 and slack: -0.00e+00
constraint _C247 has value: 0.00e+00 and slack: -0.00e+00
constraint _C248 has value: 5.00e+00 and slack: -5.00e+00
constraint _C249 has value: 2.00e+00 and slack: -2.00e+00
constraint _C250 has value: 0.00e+00 and slack: -0.00e+00
constraint _C251 has value: 0.00e+00 and slack: -0.00e+00
constraint _C252 has value: 4.70e+01 and slack: -4.70e+01
constraint _C253 has value: 0.00e+00 and slack: -0.00e+00
constraint _C254 has value: 0.00e+00 and slack: -0.00e+00
constraint _C255 has value: 0.00e+00 and slack: -0.00e+00
constraint _C256 has value: 2.00e+00 and slack: -2.00e+00
constraint _C257 has value: -1.00e+00 and slack: 1.00e+00
constraint _C258 has value: 1.00e+00 and slack: -1.00e+00
constraint _C259 has value: -1.00e+00 and slack: 1.00e+00
constraint _C260 has value: 0.00e+00 and slack: -0.00e+00
constraint _C261 has value: 0.00e+00 and slack: -0.00e+00
constraint _C262 has value: 2.00e+00 and slack: -2.00e+00
constraint _C263 has value: -1.20e+01 and slack: 1.20e+01
constraint _C264 has value: 1.00e+00 and slack: -1.00e+00
constraint _C265 has value: 0.00e+00 and slack: -0.00e+00
constraint _C266 has value: 1.00e+00 and slack: -1.00e+00
constraint _C267 has value: 0.00e+00 and slack: -0.00e+00
constraint _C268 has value: 2.00e+01 and slack: -2.00e+01
constraint _C269 has value: 2.00e+00 and slack: -2.00e+00
constraint _C270 has value: 4.00e+00 and slack: -4.00e+00
constraint _C271 has value: 0.00e+00 and slack: -0.00e+00
constraint _C272 has value: 2.70e+01 and slack: -2.70e+01
constraint _C273 has value: -9.00e-08 and slack: -0.00e+00
constraint _C274 has value: 0.00e+00 and slack: -0.00e+00
constraint _C275 has value: 0.00e+00 and slack: -0.00e+00
constraint _C276 has value: 3.00e+00 and slack: -3.00e+00
constraint _C277 has value: 1.00e+00 and slack: -1.00e+00
constraint _C278 has value: 1.00e+00 and slack: -1.00e+00
constraint _C279 has value: 1.00e+00 and slack: -1.00e+00
constraint _C280 has value: 1.60e+01 and slack: -1.60e+01
constraint _C281 has value: 2.00e+00 and slack: -2.00e+00
constraint _C282 has value: 6.00e+00 and slack: -6.00e+00
constraint _C283 has value: 1.00e+00 and slack: -1.00e+00
constraint _C284 has value: 1.30e+01 and slack: -1.30e+01
constraint _C285 has value: 4.00e-08 and slack: -0.00e+00
constraint _C286 has value: 1.00e+00 and slack: -1.00e+00
constraint _C287 has value: 0.00e+00 and slack: -0.00e+00
constraint _C288 has value: 2.00e+00 and slack: -2.00e+00
constraint _C289 has value: 1.00e+00 and slack: -1.00e+00
constraint _C290 has value: 0.00e+00 and slack: -0.00e+00
constraint _C291 has value: 0.00e+00 and slack: -0.00e+00
constraint _C292 has value: 0.00e+00 and slack: -0.00e+00
constraint _C293 has value: 0.00e+00 and slack: -0.00e+00
constraint _C294 has value: 6.00e+00 and slack: -6.00e+00
constraint _C295 has value: 1.00e+00 and slack: -1.00e+00
constraint _C296 has value: 2.00e+00 and slack: -2.00e+00
constraint _C297 has value: 1.00e+00 and slack: -1.00e+00
constraint _C298 has value: 1.00e+00 and slack: -1.00e+00
constraint _C299 has value: -1.00e+00 and slack: 1.00e+00
constraint _C300 has value: 0.00e+00 and slack: -0.00e+00
constraint _C301 has value: 0.00e+00 and slack: -0.00e+00
constraint _C302 has value: 0.00e+00 and slack: -0.00e+00
constraint _C303 has value: -3.00e+00 and slack: 3.00e+00
constraint _C304 has value: 0.00e+00 and slack: -0.00e+00
constraint _C305 has value: 0.00e+00 and slack: -0.00e+00
constraint _C306 has value: 4.00e+01 and slack: -4.00e+01
constraint _C307 has value: -1.70e+01 and slack: 1.70e+01
constraint _C308 has value: 0.00e+00 and slack: -0.00e+00
constraint _C309 has value: 0.00e+00 and slack: -0.00e+00
constraint _C310 has value: 0.00e+00 and slack: -0.00e+00
constraint _C311 has value: 0.00e+00 and slack: -0.00e+00
constraint _C312 has value: 6.00e+00 and slack: -6.00e+00
constraint _C313 has value: 0.00e+00 and slack: -0.00e+00
constraint _C314 has value: 6.00e+00 and slack: -6.00e+00
constraint _C315 has value: 2.00e+00 and slack: -2.00e+00
constraint _C316 has value: 2.00e+00 and slack: -2.00e+00
constraint _C317 has value: 1.00e+00 and slack: -1.00e+00
constraint _C318 has value: 5.40e+01 and slack: -5.40e+01
constraint _C319 has value: 0.00e+00 and slack: -0.00e+00
constraint _C320 has value: 0.00e+00 and slack: -0.00e+00
constraint _C321 has value: 0.00e+00 and slack: -0.00e+00
constraint _C322 has value: 2.00e+00 and slack: -2.00e+00
constraint _C323 has value: 0.00e+00 and slack: -0.00e+00
constraint _C324 has value: 5.00e+00 and slack: -5.00e+00
constraint _C325 has value: 0.00e+00 and slack: -0.00e+00
constraint _C326 has value: 0.00e+00 and slack: -0.00e+00
constraint _C327 has value: 0.00e+00 and slack: -0.00e+00
constraint _C328 has value: 0.00e+00 and slack: -0.00e+00
constraint _C329 has value: 0.00e+00 and slack: -0.00e+00
constraint _C330 has value: 1.00e+00 and slack: -1.00e+00
constraint _C331 has value: 0.00e+00 and slack: -0.00e+00
constraint _C332 has value: 1.00e+00 and slack: -1.00e+00
constraint _C333 has value: 1.00e+00 and slack: -1.00e+00
constraint _C334 has value: 0.00e+00 and slack: -0.00e+00
constraint _C335 has value: 0.00e+00 and slack: -0.00e+00
constraint _C336 has value: 3.00e+00 and slack: -3.00e+00
constraint _C337 has value: 1.00e+00 and slack: -1.00e+00
constraint _C338 has value: 1.00e+00 and slack: -1.00e+00
constraint _C339 has value: 0.00e+00 and slack: -0.00e+00
constraint _C340 has value: 0.00e+00 and slack: -0.00e+00
constraint _C341 has value: 0.00e+00 and slack: -0.00e+00
constraint _C342 has value: 0.00e+00 and slack: -0.00e+00
constraint _C343 has value: 0.00e+00 and slack: -0.00e+00
constraint _C344 has value: 2.00e+00 and slack: -2.00e+00
constraint _C345 has value: 1.00e+00 and slack: -1.00e+00
constraint _C346 has value: 0.00e+00 and slack: -0.00e+00
constraint _C347 has value: 0.00e+00 and slack: -0.00e+00
constraint _C348 has value: 1.00e+00 and slack: -1.00e+00
constraint _C349 has value: 0.00e+00 and slack: -0.00e+00
constraint _C350 has value: 1.80e+01 and slack: -1.80e+01
constraint _C351 has value: 0.00e+00 and slack: -0.00e+00
constraint _C352 has value: 0.00e+00 and slack: -0.00e+00
constraint _C353 has value: 0.00e+00 and slack: -0.00e+00
constraint _C354 has value: 0.00e+00 and slack: -0.00e+00
constraint _C355 has value: 0.00e+00 and slack: -0.00e+00
constraint _C356 has value: 0.00e+00 and slack: -0.00e+00
constraint _C357 has value: 0.00e+00 and slack: -0.00e+00
constraint _C358 has value: 2.00e+00 and slack: -2.00e+00
constraint _C359 has value: 1.00e-08 and slack: -0.00e+00
constraint _C360 has value: 1.00e+00 and slack: -1.00e+00
constraint _C361 has value: 1.00e+00 and slack: -1.00e+00
constraint _C362 has value: 0.00e+00 and slack: -0.00e+00
constraint _C363 has value: 0.00e+00 and slack: -0.00e+00
constraint _C364 has value: 8.00e+00 and slack: -8.00e+00
constraint _C365 has value: 1.00e+00 and slack: -1.00e+00
constraint _C366 has value: 0.00e+00 and slack: -0.00e+00
constraint _C367 has value: 0.00e+00 and slack: -0.00e+00
constraint _C368 has value: 1.00e+00 and slack: -1.00e+00
constraint _C369 has value: 0.00e+00 and slack: -0.00e+00
constraint _C370 has value: 2.20e+01 and slack: -2.20e+01
constraint _C371 has value: 1.00e+00 and slack: -1.00e+00
constraint _C372 has value: 3.00e+00 and slack: -3.00e+00
constraint _C373 has value: -5.60e+01 and slack: 5.60e+01

What did you expect to see?

Expect to see the LpStatus[optimize.status] to return Optimal with optimal value close to 112268.4.

What did you see instead?

Problem is given as Infeasible!

See the log - log.txt

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • [ X] Windows: ( _version: 10 )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using python version:

  • 2.7
  • 3.4
  • 3.5
  • 3.6
  • [ X] Other: 3.10

I installed PuLP via:

Did you also

Dr. Forrest here seems to indicate, from his own run, that the problem is with pulp, not with cbc . However, looking at the disrepancy displayed from the part of cbc, I am thinking otherwise. Anyone could give some insights into this weird issue of getting feasible versus infeasible when running cbc on Windows 10 from Pycharm v.s. Linux? coin-or/Cbc#608

@dims @dpo @wookenny @chmduquesne How can we turn off the presolve option of CBC solver via pulp? I tried following this link but the presolve step still occurs, which led to infeasibility of my LP.
https://or.stackexchange.com/questions/8285/how-do-i-turn-off-preprocessing-in-pulp

@chmduquesne Thank you so much. I will try out setting the presolve to None (you are spot-on that I set it to False).

However, I am not sure what you meant with "check what the COIN_CMD object returns"? The only solver object I successfully initiated was PULP_CBC_CMD (e.g. solver = pulp.PULP_CBC_CMD(presolve=None). So you meant I should check solver.getOptions()?

@chmduquesne Just a quick update. I tried to set presolve=None within solver=pulp.PULP_CBC_CMD(presolve=None),and then call it via optimize.solve(solver). Still see the presolve step being conducted (and again, the result from presolve was wrong, as compared to the result of Dr. Forrest).

@tle4336 did you check what solver.getOptions() returns?

Just to add that setting the presolve parameter to None will at best not set the presolve option. If the command line tool has it on by default, that will not work. I would recommend trying to patch getOptions to look like this:

    def getOptions(self):
        params_eq = dict(
            gapRel="ratio {}",
            gapAbs="allow {}",
            threads="threads {}",
            presolve="presolve {}",
            strong="strong {}",
            cuts="gomory on knapsack on probing on",
            timeMode="timeMode {}",
        )

        options = self.optionsDict.copy()
        if "presolve" in options:
            if options["presolve"] in (True, "on"):
                options["presolve"] = "on"
            else:
                options["presolve"] = "off"

        return [
            v.format(options[k])
            for k, v in params_eq.items()
            if self.optionsDict.get(k) is not None
        ]

I have too little time to test and submit a proper PR, but feel free to experiment on your end and try to make your way to the contributors list 😃

@chmduquesne Thank you so much for your sharing. I tried it out with your great instructions, but the added code above unfortunately did not stop the presolve from being executed. Currently, this makes CBC solver judged multiple feasible problems as "infeasible" (attached are two .mps files of those problems).
2InfeasibleProbs.zip

@chmduquesne I also checked solver.getOptions() but it did not give out any additional info besides the main message coming out of CBC solver.

solver.getOptions() should return a formatted list of options to be passed to the solver, which should contain "presolve off"

I decided to see if I could reproduce your bug, and I can not. This is how I import the mps you provided:

import pulp


_, prob = pulp.LpProblem.fromMPS("/tmp/python_1.mps")
solver = pulp.COIN_CMD(presolve=None)
prob.solve(solver)
print("Status:", pulp.LpStatus[prob.status])

No infeasibility reported. This prints the following:

Welcome to the CBC MILP Solver 
Version: 2.10.7 
Build Date: Feb 14 2022 

command line - cbc /tmp/d5cc7b65cea54ec986db0321eca69eb3-pulp.mps timeMode elapsed branch printingOptions all solution /tmp/d5cc7b65cea54ec986db0321eca69eb3-pulp.sol (default strategy 1)
At line 2 NAME          MODEL
At line 3 ROWS
At line 378 COLUMNS
At line 2851 RHS
At line 3225 BOUNDS
At line 3638 ENDATA
Problem MODEL has 373 rows, 412 columns and 2060 elements
Coin0008I MODEL read with 0 errors
Option for timeMode changed from cpu to elapsed
Presolve 206 (-167) rows, 313 (-99) columns and 1077 (-983) elements
0  Obj 28881.81 Primal inf 166.23454 (117)
77  Obj 59379.1
Optimal - objective value 59379.1
After Postsolve, objective 59379.1, infeasibilities - dual 0 (0), primal 0 (0)
Optimal objective 59379.0999 - 77 iterations time 0.002, Presolve 0.00
Option for printingOptions changed from normal to all
Total time (CPU seconds):       0.01   (Wallclock seconds):       0.01

Status: Optimal

As far as I can tell:

  • It is true that you cannot explicitly deactivate presolving with the COIN_CBC solver. As you can see above, the command line cbc /tmp/d5cc7b65cea54ec986db0321eca69eb3-pulp.mps timeMode elapsed branch printingOptions all solution /tmp/d5cc7b65cea54ec986db0321eca69eb3-pulp.sol does not contain any mention of presolve, yet a presolve runs by default, as demonstrated by the line Presolve 206 (-167) rows, 313 (-99) columns and 1077 (-983) elements
  • If I modify the getOptions function with my patch, I can explicitly deactivate presolving (I have to pass presolve=False to the solver). Here is the result of the execution if I do so
Welcome to the CBC MILP Solver 
Version: 2.10.7 
Build Date: Feb 14 2022 

command line - cbc /tmp/540f706ca3374050bd44fbc8c5b57362-pulp.mps presolve off timeMode elapsed branch printingOptions all solution /tmp/540f706ca3374050bd44fbc8c5b57362-pulp.sol (default strategy 1)
At line 2 NAME          MODEL
At line 3 ROWS
At line 378 COLUMNS
At line 2851 RHS
At line 3225 BOUNDS
At line 3638 ENDATA
Problem MODEL has 373 rows, 412 columns and 2060 elements
Coin0008I MODEL read with 0 errors
Option for presolve changed from on to off
Option for timeMode changed from cpu to elapsed
0  Obj 0 Primal inf 255.52382 (186)
82  Obj 58822.83 Primal inf 11.471553 (39)
131  Obj 59379.1
Optimal - objective value 59379.1
Optimal objective 59379.0999 - 131 iterations time 0.002
Option for printingOptions changed from normal to all
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.00

Status: Optimal

(note the line Option for presolve changed from on to off)

  • You provided the wrong mps file. I also checked running cbc directly and get similar results.

@chmduquesne Thank you very much for rigorously testing the initial problem provided!! I highly appreciate it.

To your last point: the provided mps file was correct in my case. When running CBC solver on my machine (Windows 10 64-bit with pycharm's 2021 version) by either explicitly calling solver = pulp.PULP_CBC_CMD()' and optimize.solve(solver)in whichoptimizeis an object containing the LP, or just go withoptimize.solve(), the result given back from CBC solver was infeasible. But when running that same problem with lpsolvepackage in R, the result isfeasible.Ispulp.COIN_CMD()andpulp.PULP_CBC_CMD()` the same? Because if that is not, this could be the reason.

I saw that in your output, the version of CBC MILP solver is 2.10.7 (mine is 2.10.3). So it looks like 2.10.7 works better then. Can you help show me how we can upgrade this solver in Python?

Finally, Could you please help try these 3 .mps files in the .zip file below, to see if you also got a feasible optimal result? Mine was still infeasible in ALL 3 cases.
InfeasibleProblems.zip

@chmduquesne So it is not PULP_CBC_CMD(), but rather COIN_CMD() to invoke the code change in turning off the presolve?

The class PULP_CBC_CMD derives from COIN_CMD. The only difference is the binary they invoke: PULP_CBC_CMD invokes a precompiled version of cbc that ships with pulp, and COIN_CMD invokes a cbc independently installed on your machine. In my case, I have installed cbc separately via my linux package manager.

If I pass an instance of PULP_CBC_CMD as the solver (instead of COIN_CMD), I get the following results:

With presolve on [Edit: I had pasted the wrong output]

Welcome to the CBC MILP Solver 
Version: 2.10.3 
Build Date: Dec 15 2019 

command line - /home/chmd/code/pulp/venv/lib/python3.10/site-packages/pulp/solverdir/cbc/linux/64/cbc /tmp/7a347b95ee7440d1af79d4497ca79759-pulp.mps timeMode elapsed branch printingOptions all solution /tmp/7a347b95ee7440d1af79d4497ca79759-pulp.sol (default strategy 1)
At line 2 NAME          MODEL
At line 3 ROWS
At line 378 COLUMNS
At line 2851 RHS
At line 3225 BOUNDS
At line 3638 ENDATA
Problem MODEL has 373 rows, 412 columns and 2060 elements
Coin0008I MODEL read with 0 errors
Option for timeMode changed from cpu to elapsed
Presolve 206 (-167) rows, 313 (-99) columns and 1077 (-983) elements
0  Obj 28881.81 Primal inf 166.23454 (117)
77  Obj 59379.1
Optimal - objective value 59379.1
After Postsolve, objective 59379.1, infeasibilities - dual 0 (0), primal 0 (0)
Optimal objective 59379.0999 - 77 iterations time 0.002, Presolve 0.00
Option for printingOptions changed from normal to all
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.00

Status: Optimal

With presolve off (forced via my patch)

Welcome to the CBC MILP Solver 
Version: 2.10.3 
Build Date: Dec 15 2019 

command line - /home/chmd/code/pulp/venv/lib/python3.10/site-packages/pulp/solverdir/cbc/linux/64/cbc /tmp/d648f8256d6042f09b2c81b486ed75d6-pulp.mps presolve off timeMode elapsed branch printingOptions all solution /tmp/d648f8256d6042f09b2c81b486ed75d6-pulp.sol (default strategy 1)
At line 2 NAME          MODEL
At line 3 ROWS
At line 378 COLUMNS
At line 2851 RHS
At line 3225 BOUNDS
At line 3638 ENDATA
Problem MODEL has 373 rows, 412 columns and 2060 elements
Coin0008I MODEL read with 0 errors
Option for presolve changed from on to off
Option for timeMode changed from cpu to elapsed
0  Obj 0 Primal inf 255.52382 (186)
82  Obj 58822.83 Primal inf 11.471553 (39)
131  Obj 59379.1
Optimal - objective value 59379.1
Optimal objective 59379.0999 - 131 iterations time 0.002
Option for printingOptions changed from normal to all
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.00

Status: Optimal

As you can see, via PULP_CBC_CMD, I am using the same version as yours: 2.10.3.

If I were you, I would verify that the cbc binary that ships with your local copy of pulp really thinks that you mps file is infeasible. As you can see, the command line that pulps run is in the debug output, so you can edit it to run against the file you provided.