Question on Inclusion Exclusion On DP on tree Generalised?

Revision en1, by theoneandonlytron, 2026-11-12 04:52:36

Let's say I want to use DP to group nodes in a graph. I can't directly use tree DP because the graph contains cycles. But what if, by assuming that node $$$i$$$ is grouped with node $$$j$$$ in some way, I can break a cycle and then apply tree DP?

What if the graph has many cycles? Technically, I could try all possibilities in $$$2^n$$$, but is there a blog or generalization of this idea, or a problem that uses it?

One example is this USACO problem, but it only has one cycle per connected component because it is a functional graph.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English theoneandonlytron 2026-11-12 04:52:36 647 Initial revision (published)