Following this approach, the solution of dynamics equations with unilateral constraints is transformed into the solution of N/LCPs. In particular, for frictionless unilateral constraints or unilateral constraints with planar friction, the problem is transformed into LCPs, while for frictional unilateral constraints, the problem is transformed into NCPs. To solve LCPs, the pivoting algorithm, originating from the algorithm of Lemek and Dantzig, is the most popular method. Unfortunately, however, numerical experiments show that the pivoting algorithm may fail when handling systems with a large number of unilateral contacts, even using the best optimizations. For NCPs, using a polyhedral approximation can transform the NCPs into a set of LCPs, which can then be solved by the LCP solver. Other approaches beyond these methods, such NCP-functions or cone complementarity problems (CCP) based methods are also employed to solve NCPs.