We propose an asymptotically optimal implementation of the equilibrium algorithm for housing markets with duplicate houses and strict preferences. It is based on Tarjan's depth-first search algorithm for strongly connected components of a digraph.