Relative Content

Tag Archive for dynamic-programming

Painting house algorithm to get minimum cost

You have N numbers arranged in a sequence. Now, you need to color them such that if you decide to color certain indices
Ai1,Ai2,…,Aik with a specific color c, the cost incurred is
max(Ai1,Ai2,…,Aik). The total cost to color the sequence is the sum of costs for all used colors.