How to find two disjoint spanning trees of an undirected graph

前端 未结 4 996
抹茶落季
抹茶落季 2021-02-06 10:04

Is there any applicable approach to find two disjoint spanning trees of an undirected graph or to check if a certain graph has two disjoint spanning trees

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 10:35

    Assuming that the desire is to find spanning trees with disjoint edge sets, what about:

    1. Given a graph G determining the minimum spanning tree A of G.
    2. Defining B = G - A by deleting all edges from G that also lie in A.
    3. Checking if B is connected.

    The nature of a minimum spanning tree somehow makes me intuitively believe that choosing it as one of the two spanning trees gives you maximum freedom in constructing the other (that hopefully turns out to be edge disjunctive).

    What do You guys think?

    edit

    The above algorithm makes no sense as a spanning tree is a tree and therefore needs to be acyclic. But there is no guarantee that B = G - A is acyclic.

    However, this observations (thx@Tormer) led me to another idea:

    1. Given a graph G determine the minimum spanning tree A of G.
    2. Define B = (V[G], E[G] \ E[A]) where V[G] describes the vertices of G and E[G] describes the edges of G (A respectively).
    3. Determine, if B has a spanning tree.

    It could very well be that the above algorithm fails although G indeed has two edge disjunctive spanning trees - just no one of them is G's minimum spanning tree. I can't judge this (now), so I'm asking for Your opinion if it's wise to always chose the minimum spanning tree as one of the two.

提交回复
热议问题