Efficient boundary integral formulations based on stream functions for solving eddy current problems in thin conductors, which are modeled by the orientable combinatorial two-manifold with boundary, need generators of the first relative cohomology group to make the problem well defined. The state-of-the-art technique is to compute directly the relative cohomology generators with a combinatorial algorithm having linear worst-case complexity. In this paper, we propose to compute the relative cohomology generators from the homology generators, introducing a novel and general algorithm whose running time is again linear in the worst case. The advantage is that one may use an off-the-shelf software to compute the homology generators and implement only a simple and cheap procedure to obtain the required relative cohomology generators. Although the presented applications relate to ac power systems, the proposed technique is of general interest, and may be used for other applications in computational science and engineering