I'm trying to find a path between two points. Each edge in my graph has two separate weights. I already know the shortest path, if you only take the first weight into account, between the two points. What I need to do is to maximize the second weight whilst making sure the first does not exceed a constraint. The constraint is that the total of the first weight should not exceed its total on the shortest path by more than X%. How do I go about doing that? The final solution need not be an exact solution, as it is intended to be a heuristic.
The graph is directed with edges going from node 1 to 2 and from node 2 to 1 in some cases (but not all).
Please note that:
BFS would simply take too much time. My problem is that I need to go down a path that doesn't exceed the limit for the total of the first weight along it but the total for the second weight along it needs to be maximized. The graph is huge with hundreds of thousands of edges.