I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes the sum of all the attributes on said path, and return the top N minimized paths .
Example: the nodes are tasks in a to-do list. Some items on the list need to be completed before others can be started. In this example, an attribute could be the 'spare time' or 'wiggle room' an item has before its delay would have a knock-on effect and delay the next item. So I want to find the path that minimizes the total 'spare time'. i.e. the most optimal way of working through the task from A to B.
I considered using Dijkstra's algorithm where I replace the distance parameter with the node attribute I wish to minimize. However, I am not sure how this would work as I only have node attributes, not edge attributes. I could set the edge attribute to be that of the source, or target nodes for that edge, but I don't think this is valid. E.g. if using the source node attribute for the edge attribute, then the final node in the chain's attribute would never be used and vice versa. Additionally, the actual path length doesn't matter, just the sum of the attributes along the path.
Finally, another issue is that the attributes along the path that I am trying to minimize can be negative, so the minimized path sum can be negative or positive. This seems to rule out a BFS or DFS method with early stopping (threshold) as it could stop before a future negative attribute has been reached, which would decrease the total sum along the path.
Any help or suggestions would be great, thanks.
