dp with bitmasking ideas needed.

Revision en2, by ASHWANTH_K, 2024-05-11 06:08:51

Is it possible to calculate the following recurrences in $$$O(N*2^N)$$$.

1) $$$dp[mask] = min(dp[mask] , dp[m_1] + dp[m_2]);$$$
where $$$m_1|m_2 = mask$$$

2) $$$dp[mask] = min(dp[mask] , dp[m_1] + dp[m_2]);$$$
where $$$m_1 \oplus m_2 = mask$$$ and $$$m_1$$$ ,$$$m_2$$$ are subsets of mask.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ASHWANTH_K 2024-05-11 06:08:51 39 Tiny change: '2 = mask$ \n\n\n ' -> '2 = mask$ and $m_1$ ,$m_2$ are subsets of mask.\n\n\n '
en1 English ASHWANTH_K 2024-05-11 06:07:58 319 Initial revision (published)