problem description: now there is a directed acyclic graph with positive weights on each node. Now we want to find an optimal path so that the sum of the weights of the nodes is maximum.
input: n nodes, m paths, start
for example:
3 nodes
A 1
B 2
C 2
3 paths
A-> B
B-> C
A-> C
start: a
output: 5 (the best path is A-> B-> C, weight: 1 / 2 / 2 / 5)
question : what kind of data structure is used to represent the graph to start computing?