Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:07:26+00:00 2026-06-14T22:07:26+00:00

I need an algorithm to find max independent set in a tree. I’m thinking

  • 0

I need an algorithm to find max independent set in a tree. I’m thinking start from all leaf nodes, and then delete the direct parent nodes to these leaf nodes, then choose the parent nodes of the parent nodes we deleted, repeat this procedure recursively until we get to root. and is this done in O(n) time? any reply is appreciated. thanks.

And could anyone please point me an algorithm to find the max dominating set in a tree.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:07:28+00:00Added an answer on June 14, 2026 at 10:07 pm

    MAXIMUM INDEPENDENT SET

    You can compute the maximum independent set by a depth first search through the tree.

    The search will compute two values for each subtree in the graph:

    1. A(i) = The size of the maximum independent set in the subtree rooted at i with the constraint that node i must be included in the set.
    2. B(i) = The size of the maximum independent set in the subtree rooted at i with the restriction that node i must NOT be included in the set.

    These can be computed recursively by considering two cases:

    1. The root of the subtree is not included.

      B(i) = sum(max(A(j),B(j)) for j in children(i))

    2. The root of the subtree is included.

      A(i) = 1 + sum(B(j) for j in children(i))

    The size of the maximum independent set in the whole tree is max(A(root),B(root)).

    MAXIMAL DOMINATING SET

    According to the definition of dominating set in wikipedia the maximum dominating set is always trivially equal to including every node in the graph – but this is probably not what you mean?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an algorithm to find all of the subsets of a set where
In Java, I need an algorithm to find the max. number of occurrences in
I need an algorithm to find out all the possible positions of a group
Given a set {1,2,3,4,5...n} of n elements, we need to find all subsets of
I need an algorithm to find the largest unique (no duplicate characters) substring from
I need advice or directions on how to write an algorithm which will find
I am aware that Dijkstra's algorithm can find the minimum distance between two nodes
For some game where one would need to find anagrams from a bunch of
I need an algorithm for this problem: Given a set of n natural numbers
The problem is to extend the binary search algorithm to find all occurrences of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.