Updating a Minimum spanning tree when a new edge is inserted

前端 未结 3 924
小鲜肉
小鲜肉 2020-12-24 08:53

I\'ve been presented the following problem in University:

Let G = (V, E) be an (undirected) graph with costs ce >= 0 on the edges e<

3条回答
  •  清酒与你
    2020-12-24 09:15

    I think a BFS would suffice. And it's complexity is O(|V| + |E|) but in a tree |E| is less than |V| so it's O(2|V|) that is O(|V|)

提交回复
热议问题