Artificial intelligent assistant

Showing Breadth-First Search does not change distance in a connected graph I am trying to show that in a connected graph when we choose an arbitrary vertex such as v, the distance from v(parent) to u in a connected graph is equal to the distance in the tree that is created via breadth-first search. Would it be just enough to show that choosing a longer path in breadth-first search gives rise to non-tree edge?

If I understand correctly, you want to prove that BFS always finds the shortest path between any two nodes. So you can try to assume that BFS does not find the shortest path and then show that this gives a contradiction. (I think that's what you mean by "give rise to non-tree edge"). So in my opinion, the answer to your question is yes.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 195d9c30333b30847553f241b30de47c