Maximum independent set of tree, minimum point coverage, minimum domination set greedy and tree DP

Source: Internet
Author: User

Directory

    • Maximum independent set of tree, minimum point coverage, minimum dominating set
      • Three definitions
      • Greedy Solution
      • Tree-shaped DP Solution

(Have any questions welcome message or private chat && Welcome Exchange Discussion


Maximum independent set of tree, minimum point coverage, minimum dominating set three definitions

Maximum independent set:

? Select as many points as possible on a graph to form a set that satisfies no edges between these points. All independent sets, with the highest number of vertices, are referred to as the maximum independent set.

Minimum point coverage:

? To select as few points as possible in a graph to form a set that satisfies all sides of the graph with endpoints belonging to this set. All coverage sets, with the fewest number of top points, are called minimum point overrides.

Minimum dominating set:

? Select as few points as possible on a graph to form a set that satisfies the remaining points in the graph and is connected to the points in the set. This dominating set is a minimum dominating set if it is no longer a dominating set after going out of a set. All dominant concentrations, with the fewest number of top points, are called minimum dominating sets.

Maximum independent set of greedy solution tree:

? First, the DFS sequence is searched in reverse order. If this node is not marked, the endpoint is added to the stand-alone set and the node and its parent node are marked.

Minimum point coverage for a tree:

? First, the DFS sequence is searched in reverse order. If neither this node nor its parent node is marked, the parent node is added to the overwrite set and the node and its parent node are marked.

Minimum dominating set of trees:

? First, the DFS sequence is searched in reverse order. If this node is not marked, the parent node is added to the dominant set (provided that it is not in the dominant set), then the node, parent node, and its grandfather node are marked.

Maximum independent set of tree-type DP solution tree:

\ (dp[i][0]\) indicates that point I is in a separate set;\ (dp[i][1]\) indicates that point I is not in a separate set
\[dp[u][0] = 1 + \sum dp[v][1];\dp[u][1] = \sum max (dp[v][0], dp[v][1]);

Minimum point coverage for a tree:

\ (dp[i][0]\) indicates point I in point overlay set;\ (dp[i][1]\) indicates point I not in point overlay
\[dp[u][0] = 1 + \sum min (dp[v][0], dp[v][1]); \dp[u][1] = \sum dp[v][0];\]

Minimum dominating set of trees:

\ (dp[i][0]\) indicates that the point I belongs to the dominating set, and the number of the minimum points contained in the case where the subtree with point I is the root is covered.

\ (dp[i][1]\) indicates that the point I does not belong to the dominating set, and that the subtree with the root of I is overwritten, and I is covered by not less than one child node, the number of the minimum points contained in the set.

\ (dp[i][2]\) indicates that the point I does not belong to the dominating set, and the subtree with the root of I is covered, and I do not cover the number of nodes in the case of the minimum points contained in the dominant set. That I will be overwritten by the parent node
\[dp[u][0] = 1 + \sum min (dp[v][0],dp[v][1],dp[v][2]); \dp[u][2] = \sum dp[v][1];DP [U][2]=min (Dp[u][2],inf); \if (dp[v][0 ]<=DP[V][1] inc = 0; (if\;0\;always\;0) \else\;inc = Min (inc, dp[v][0]-dp[v][1]); \if (U\;no\;son) dp[u][1] = INF;\else \; DP[U][1] = \sum min (dp[v][0],dp[v][1]) +inc;\]

Reference post: Ash-ly

Maximum independent set of tree, minimum point coverage, minimum domination set greedy and tree DP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.