We describe a method to impose constraints in a molecular dynamics simulation. A technique developed to solve the special case of a linear topology (MILC SHAKE) is hybridized with the SHAKE algorithm. The methodology, which we term MILC-hybridized SHAKE (or MILCH SHAKE), applies to more complex topologies. Here we consider the important case of all atom models of alkanes. Exploiting the mass difference between carbon and hydrogen we show that for higher alkanes MILCH SHAKE can be an order of magnitude faster than SHAKE. (C) 2009 Wiley Periodicals, Inc. J Comput Chem 30: 2485-2493, 2009