The topology optimization of isotropic mechanical systems made of homogeneous materials is of constant interest to scientists worldwide. However, owing to the complexity of this issue, the optimization of nonhomogeneous (composite) systems is slightly less popular. The aim of this study is a comparative analysis of two such representative methods and their implementation in MATLAB. In addition, these methods have been modified to accelerate the convergence of calculations and achieve convergence. Some modifications were also made to reduce the number of input parameters. Finally, both implementations are compared on the basis of several practical application examples, and conclusions are drawn from the analysis. The analysis showed that first method, although simple, is not useful in many practical problems because the rejection of mixed finite elements (i.e. elements with principal stresses of opposite signs) often prevents obtaining convergence. Method two, on the other hand, proved to be robust and easily adjustable for obtaining optimal topologies.