Maximum Profit from Valid Topological Order in DAG
Bitmask DP over the set of nodes already placed: each new node takes the next position and adds score times that position.
Bitmask DP over the set of nodes already placed: each new node takes the next position and adds score times that position.