{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw1soln

# hw1soln - CME 305 Discrete Mathematics and Algorithms...

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

CME 305: Discrete Mathematics and Algorithms Instructor: Professor Amin Saberi ([email protected]) HW#1 Solutions 1. Prove that at least one of G and G is connected. Here G is the complement of G i.e. a graph on the same vertex set such that two vertices in G are adjacent if and only if they are not adjacent in G . Solution: Let G be a disconnected graph in which case we can decompose it into k connected components C 1 , C 2 , . . . , C k . We want to show that G is connected i.e. there is a path between any u and v in G . In the case that u and v are in different components we know that there exist an edge (a path of length one) between them in G . In the case that u and v are in the same component, say C i , we can construct a path of two edges between them in G as follows. Pick any vertex w from some other component C j for j 6 = i and note that edges { u, w } and { w, v } are in G . Thus u, w, v is a path in G and hence G is connected. 2. Recall the definition of a bipartite graph. Let G ( V, E ) be a graph and ( A, B ) be a partition of V . We say that G is bipartite if all edges in E have one end-point in A and the other in B . More precisely, for all ( u, v ) E either u A, v B or u B, v A . (a) Prove that a graph is bipartite if and only if it doesn’t have an odd cycle. (b) A graph is called k -regular if all vertices have degree k . Prove that if a bipartite G is also k -regular with k 1 then | A | = | B | . Solution: (a) The following is for a connected bipartite graph. The extension is trivial after the statement holds for each connected component. ” Assume G is bipartite and pick a cycle v 1 , v 2 , . . . , v k , v 1 with v 1 A . Then v i A for i odd and v i B for i even. An odd cycle has and odd number of vertices, thus k is odd and so v k A . But we have { v k , v 1 } ∈ E which contradicts the fact that G is bipartite since both vertices are in A . Therefore a bipartite G has no odd cycles. ” Let G be a graph with no odd cycles. Define d ( u, v ) as the shortest distance between the two vertices. Pick an arbitrary vertex u V and define A = { u } ∪ { w | d ( u, w ) is even } . Let B = V - A to create a partition ( A, B ). We can show by contradiction that G ( A, B, E ) is a bipartite graph. Assume there is an edge { w, v } with w, v A ( B ). Then by construction d ( u, w ) and d ( u, v ) are even (odd). Thus, edge { w, v } creates an odd cycle, a contradiction. The above uses the fact that the sum of two even (odd) numbers is always even. (b) The number of edges leaving A is computed as k | A | . The number of edges leaving B is computed as k | B | . For a bipartite graph both quantities have to be equal to the total number of edges. Thus | E | = k | A | = k | B | , implies | A | = | B | .

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

View Full Document
3. The stable roommate problem is similar to the stable marriage problem, except pairings are made within a single pool rather than between two genders. As in stable marriage, a rogue pair is a pair ( a, b ) such that a prefers b to his current partner and b prefers a to his current partner. A stable pairing is one that has no rogue pairs.
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