The concept of location depth was introduced in statistics as a way to extend the univariate notion of ranking to a bivariate configuration of data points. It has been used successfully for robust estimation, hypothesis testing, and graphical display. These require the computation of depth regions, which form a collection of nested polygons. The center of the deepest region is called the Tukey median. The only available implemented algorithms for the depth contours and the Tukey median are slow, which limits their usefulness. In this paper we describe an optimal algorithm which computes all depth contours in <i>&Ogr;</i>(<i>n</i><sup>2</sup>) time and space, using topological sweep of the dual arrangement of lines. Once the contours are known, the location depth of any point is computed in <i>&Ogr;</i>(log<sup>2</sup> <i>n</i>) time. We provide fast implementations of these algorithms to allow their use in everyday statistical practice.