0
  1. write an algorithm to find a spanning tree that has the maximum number of leaves.
  2. Write an algorithm to find a spanning tree with minimum number of nodes.

I am yet not able to come up with a solution for the following questions.

For the first part what I thought is to find the vertex with the highest degree and place it in the second last level such that the last level gets the maximum number of leaves.

1 Answers1

1
  1. Finding a spanning tree of a graph with maximum number of leaves is an NP-Complete problem. There is a reduction from the Dominating Set Problem which is NP-Complete.

  2. Finding a spanning tree of a graph with minimum number of leaves is also an NP-Complete problem. Suppose if the graph has a Hamiltonian path then the graph has a spanning tree with just two leaves. Thus finding a spanning tree of a graph with minimum number of leaves is equivalent to finding whether a graph has a Hamiltonian path or not.

So for both the problems you need to develop approximation algorithms.

Deepu
  • 7,592
  • 4
  • 25
  • 47