ta4sol

ta4sol - (a Assume G is bipartite and let the vertex...

This preview shows pages 1–2. Sign up to view the full content.

(a) Assume G is bipartite and let the vertex partition be V 1 , V 2 . Let C be a cycle i 1 , · · · , i k , i k +1 = i 1 and let say that i 1 V 1 , then every odd-indexed vertex in C is also in V 1 , and every even-indexed vertex is in V 2 . Therefore, k + 1 must be odd, so k is even, but k is the length of cycle C . (b) Assume the graph is connected. If it is not connected, then we apply the following algorithm to each connected component. The idea of the algorithm is as follows: Initially, we color all vertices white and pick any vertex s as starting vertex, color it red, and perform a breadth-first search on the graph. When a vertex is first encountered (i.e. it is now in white), color it blue if the BFS has just come from a red node, and red otherwise. If at any point, the breadth-first search encounters an edge between two vertices with identical colors, then the graph is not bipartite; otherwise, it is. The pseudo-code of the algorithm is shown below.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern