How can I generate Rubik's cube algorithms equivalent to a given algorithm?
Solutions

Finding solutions of a Rubik's cube is infeasible by enumeration (BFS - too much space required), DFS takes too much time and does not guarantee the optimal solution, I highly doubt that optimal solution would be required.

There are at least three algorithms worth noting: Kociemba's algorithm, Thistlewaite's algorithm and Iterative deepening $A^*$ (Korf's). Here is a methods comparison. Iterative deepening needs admissible heuristic, which for Rubik's cube is the sum of 3D Manhattan distances calculated separately for corners and cubies. Due to Korf, it also needs pattern database to achieve optimal solution in reasonable time.

Algorithm Optimization

For optimizing any given algorithm all above will work in reasonable time, including BFS for short algorithms. To make small number of turns in overall solution the structured system should yield low number of turns in average, Friedrich method is mainly used for manual solving with medium number of algorithms (more than 100 is huge number to learn at once, not that challenging to program), so instead of optimizing single steps it would be better to find system that scores better. For example ZBLL method with 493 algorithms (including mirrors) with average about 40 turns, Friedrich scores about 56.

Solving Between States

This step is inevitable: the modification of the stop condition in the search tree - at some point while processing partial algorithm the stop condition should be changed to check only target pieces and already solved ones. There is no good way to mitigate this effect, at initial phases enumerating all possible permutations of the cube is too memory and time consuming. Searching for shorter algorithm without changed condition (via ready to use solver or own algorithm) will yield very long solution, because all pieces will be preserved e.g. the last layer while solving the middle layer. To really improve the overall score instead of shortening given moves it is far more valuable to implement look ahead (e.g. better last layer orientation while solving the second one, or increasing number of algorithms possibly merging phases together).

There is also Hamilton circuit for Rubik's cube with included graph for cosets - this is not a full solution, but still worth reading.