independent-set

Max Independent Set in Prolog

孤街浪徒 提交于 2019-12-25 04:28:09
问题 I am trying to implement a Prolog predicate that gets a binary tree (represented as t(Left, Root, Right)) and returns a list that is the Maximal Independent Set (MIS) of this tree, and its size. I first understood that MIS(T) is the maximum between the MIS with root and the MIS without the root. Then, I used two theorems, stating that the MIS with root is the unification of the MIS's without the root for all the subtrees, and that MIS without root is the unification of the MIS's of all the

Max Independent Set in Prolog

北慕城南 提交于 2019-12-25 04:28:01
问题 I am trying to implement a Prolog predicate that gets a binary tree (represented as t(Left, Root, Right)) and returns a list that is the Maximal Independent Set (MIS) of this tree, and its size. I first understood that MIS(T) is the maximum between the MIS with root and the MIS without the root. Then, I used two theorems, stating that the MIS with root is the unification of the MIS's without the root for all the subtrees, and that MIS without root is the unification of the MIS's of all the

algorithm to find max independent set in a tree

你离开我真会死。 提交于 2019-11-30 03:01:42
问题 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: MAXIMUM INDEPENDENT SET You can compute the maximum