I am creating a roguelike. This question applies to random map generation.
First, I generate areas using a BSP algorithm, where I randomly divide the map into areas. Then, I generate a graph of the areas so that I can use search algorithms to generate paths through the map. It is easy to find the shortest path between two areas, but I would like to find a path with a specific number of steps(or path cost).
So, my question is: What is an algorithm that I can use to find a path that has a specific cost or cost range?
An Example of why I think this is useful: Say that I randomly choose two areas(start and end for example). These area might be next to each other, they might be on the opposite sides of the map. I want to force the player to travel through a minimum number of areas before reaching the end, let's say 5. I should be able to be like:
path = startArea.findPathMinimumCost(endArea,5);
And it will return a path of cost 5, or the shortest path, whichever has the greater cost.
Thank you.