Bearing-only localization can be formulated in terms of optimal graph embedding: for each node in the graph, find the coordinates that satisfy as close as possible all the bearing-only constraints on the edges. If the graph is parallel rigid, this can be done via spectral methods. When the graph is not rigid the solution is ambiguous, as different subsets of vertices can be scaled differently. It is then important to first partition the problem into maximal rigid components. In this paper we show that the cycle basis matrix of the graph can be used for this task, and that it can also be used to provide a more intuitive look at graph rigidity. We can explain, for instance, why triangulated graphs are rigid and why graphs with longer cycles may loose this property. Furthermore, we can obtain tools for enforcing rigidity by controlling the addition of new measurements.