0

I'm having trouble understanding whether or not an MST would be a tree or not.

Let's say that given a graph G = (V, E), do any subset of edges T ⊆ E that connects all vertices in V and have minimal total weight must be a tree, or can it be some other subgraph when - Some edges may have negative weights. - All of the edges have positive weight.

I'm thinking that for some edges that may have negative weights, it must be a tree and for the edges with all edges having positive weights, it can be some other subgraph.

Please help me if I'm correct or wrong.

If it must be a tree, could you explain the contradictions to connectedness and minimality. But if you think that it could be some other subgraph, then could you show me an example where a connected graph that may not be a tree has lower weight in it.

user2978067
  • 11
  • 1
  • 3

3 Answers3

0

If you have negative weights you can't guarantee that a Minimum Spanning subgraph is a tree. Consider a complete graph of 3 vertices with all edges weighing -1.

EDIT Misunderstood your question a bit:

If you have negative weights: It may not be a tree

All weights are non-negative (>=0): There is a minimum spanning tree, but there could be another that it's not a tree and has the same sum of weights.

All weights are positive (>0): It's a tree.

Guido
  • 2,571
  • 25
  • 37
0

There is a difference between minimum spanning tree/forest (MST/F) and minimum spanning graph (MSG).

Minimum spanning graph (MSG): Connects all nodes in all connected components of a graph G, such that the overall costs are minimal.

For non-negative costs the MSF equals to the MSG.

e.g. Graph G as a triangle with costs of 1 for each edge. MSG will connect the 3 vertices over 2 edges. And that's the same MSF you will get by compute G with Kruskal, Prim or Boruvka Algorithm.

For negative costs the MSF could be unequal to the corresponding MSG, and furthermore the MSG isn't always a MSF.

e.g. Graph G as a triangle with costs of -1 for each edge. MSG will use every edge, because it will reduce the overall costs. Therefore you will get a cycle. And by definition a tree or forest doesn't contain cycles. With positiv costs you will never get a cycle in a MSG, because adding an edge, which produces a cycle will always increase the overall costs of MSG. Computing the G with Kruskal, Prim or Boruvka will return a MSF.

bashbug
  • 556
  • 4
  • 16
-1

Some facts that should be sufficient to answer your question:

  1. If T is a subset of edges that connects all vertices, then T is not necessarily a tree.
  2. If T is a subset of edges that connects all vertices, and T minimizes the sum of weights, then we know:
    • T is not necessarily unique.
    • T always contains a subset of edges that forms a tree. ("connectedness")
    • If all weights are strictly positive, then T is a tree. ("minimality")
  3. Finding some T with minimal sum of weights is as easy as finding an MST:
    • Find some MST (e.g. using Kruskal's or Prim's algorithm).
    • Add all edges with negative weight.

A trivial example of a subset T that minimizes the weight is for a graph G=(V,E) where the weight of all edges is -1, then T is E.

Mikael Call
  • 75
  • 1
  • 8