I was just wondering what the correlation is between a breadth-first search tree of a graph and that graph being bipartite?
Breadth first search and bipartiteness
1
$\begingroup$
graph-theory
1 Answers
5
A bipartite graph is a graph that you can $2$-color. If you fix the color of one vertex (the source), then the rest of the coloring (provided that it exists) is totally defined by the distance to the source vertex. Hence, your graph is bipartite if and only if there is no "horizontal" edge in your BFS tree.
-
0@Mark. Is this answer what you were looking for ? – 2012-11-15
-
0Yes, that's what I was looking for but under what circumstances would we get a "horizontal" edge in our BFS tree? – 2012-11-16
-
1Those correspond exactly to odd cycles in the graph. – 2012-11-16