No, this is not NP-hard (technically, NP-complete is the wrong term for this, since it is not a solution problem).
Dynamic programming works and gives you the O (n) time algorithm. (n is the number of houses).
You support three arrays R [1..n], B [1..n], G [1..n]. Where R [i] is the minimum cost of painting houses 1,2,3 ..., i, so I am painted in red. Similary B [i] - the minimum cost of the figure is 1,2, ..., i, and I am colored in blue, and G [i] - with the fact that I am painted in green.
You can calculate R [i + 1] = (Cost of painting the house i + 1 Red) + minimum {G [i], B [i]}. Similarly, B [i + 1] and G [i + 1] can be calculated.
Ultimately, you take the minimum of R [n], B [n] and G [n].
This time is O (n) and O (n).
For example, consider the following cost matrix for homes:
House #: 1 2 3
R: 1 4 6
G: 2 100 2
B: 3 100 4
The algorithm builds the following matrix to get the answer:
Houses: 0 1 2 3
R: 0 1 6 107
G: 0 2 101 8
B: 0 3 101 10
In the last column, where all 3 houses are painted, we can find the minimum cost equal to 8, and corresponds to the combination [Green (2), Red (4), Green (2)].
Fast Python:
The output will be ([1, 6, 107], [2, 101, 8], [3, 101, 10]), which is the cost matrix leading to the solution.