Check if edge is included in SOME MST in linear time (non-distinct values)

后端 未结 4 523
醉梦人生
醉梦人生 2021-01-31 19:24

I am working on an algorithm to check if a given edge is included in one of all possible mst\'s.

For this question, we are considering non-distinct values and our edge e

4条回答
  •  一生所求
    2021-01-31 19:58

    Suppose A-B is your graph and e the only edge. Then e is part of the MST but there is a path A-B that suffices your condition.

    Even if you require that e is not part of such a path it is wrong. Just take a graph with two edges e1 and e2 between A and B that have the same weight.

    You should also consider a graph A-B-C with an additional edge from A-C where all edges have weight one. No matter which edge you remove you can get a minimal spanning tree. Thus any edge can be part of a MST.

提交回复
热议问题