As I asked before, what tool are you referring to? From the sound of this question it feels like you're referring to the optimizer of the database (the one that makes the decision for the access path).
If that's the case, you cannot replace it with your own algorithm. However, what you can do for example is to use hints. These hints guide the optimizer to use specific strategy on a table, for the query or for joining tables. For more information, see:
Query Hints[
^]