0

I have this question for homework:

prove/disprove:

A. Given an unintentional bound graph G (V, E) and a minimum spanning tree for this graph, and 2 vertices u, v, the shortest path between u and v in graph G can be found by performing BFS on the tree T.

B. Given a directed graph G (V, E) with weights and vertex s. The number of arcs in the shortest distance tree of this graph from the origin of s is the | V | -1.

I think that's true but can't prove it.

Can someone help me?

אנונימי
  • 304
  • 2
  • 7

1 Answers1

2

A. Not true, the minimum spanning tree does not contain all the shortest paths. example: enter image description here

The MST is the black edges (weight=1) the red edge (weight=2) is the shortest path between its nodes.

B. True, suppose you have a shortest paths graph with |V| edges, than there is a node v with at least two path from s (let v be the closest node to s with that property), in that case you can remove one of the incoming edges of v without changing the weights of the paths to all the nodes

Shuki Avraham
  • 1,033
  • 1
  • 7
  • 14