How can I get Suboptimal Routes?

Hi! I want to develop a script that gives me several routes (optimal and suboptimal routes).

Has anyone the code to solve my doubt or the knowledge to get it?

Thanks everyone!

Do you have an example of what you mean with “suboptimal”? Maybe, do you mean alternative routes?

Yes, I wanted to say alternative routes.