An Algorithm to Solve the Generalized Conjugacy Problem in Relatively Hyperbolic Groups