For each node, compute two values: = max money if you rob , and = max money if you skip .
Transitions: , and .
Answer: .
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Two values per node
For each node, compute two values: = max money if you rob , and = max money if you skip .
Transitions: , and .
Answer: .