I have a directed acyclic weighted graph which I want to traverse.
The constraints for a valid solution route are:
- The sum of the weights of all edges traversed in the route must be the highest possible in the graph, taking in mind the second constraint.
- Exactly N vertices must have been visited in the chosen route (including the start and end vertex).
Typically the graph will have a high amount of vertices and edges, so trying all possibilities is not an option, and requires quite an efficient algorithm.
Looking for some pointers or a suitable algorithm for this problem. I know the first condition is easily fulfilled using Dijkstra's algorithm, but I am not sure how to incorporate the second condition, or even where to begin to look.
Please let me know if any additional information is needed.