# GAMS Support Wiki

### Site Tools

gams:how_large_should_big_m_be

# Differences

This shows you the differences between two versions of the page.

 — gams:how_large_should_big_m_be [2007/08/10 11:06] (current) Line 1: Line 1: + ====== How large should BIG M be? ====== + + //How big should the constant M be in the equation, where Y(J) are binary variables: // + + ​YBIN(J).. SUM(I,​X(I,​J)) =L= M*Y(J); + + // I said in my model: // + + ​SCALAR M /​10000000000/ ​ + + // but that causes problems. // + + In general the answer should be as small as possible. Your model + with the M of 1.0E10 could not be solved by any of the MIP solvers + we tried out. It causes enormous scaling problems. However further + on in your model you have + + ​CAP(J).. SUM(I,​X(I,​J)) =L= MAXCAP; + + We can combine these two equations in one: + + ​YBIN(J).. SUM(I,​X(I,​J)) =L= MAXCAP*Y(J);​ + + Which both sets M to the smallest possible value and reduces the + number of constraints. ​ + + We have seen MIP models fail miserably when using a real big M.