Take the 2-minute tour ×
MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

In graph G, every edge has a color. Rainbow spanning tree is a spanning tree where all edges have different colors. I want a polynomial algorithm to find such tree if exists any Anyone can help?

share|improve this question

1 Answer 1

Boersma and Li [1] give a characterization of when an edge-colored graph contains a rainbow spanning tree. A polynomial time algorithm for your problem exists as the problem is equivalent to finding a common independent set of maximum cardinality in two matroids.

The problem of finding a spanning tree with as few different colors as possible is NP-hard, as shown in the same paper I believe.


[1] Hajo Broersma and Xueliang Li. Spanning trees with many or few colors in edge-colored graphs. Discuss. Math. Graph Theory, 17(2):259–269, 1997.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.