theoneandonlytron's blog

By theoneandonlytron, history, 8 days ago, In English

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.

»
8 days ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

This is a good question. It leads to the concepts of tree decomposition and treewidth in graph theory and computer science. I remember that there has been a few competitive programming problems where these concepts are useful, you can probably search for them by yourself with these keywords.

  • »
    »
    7 days ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Thank you so much