240 likes | 423 Views
V 1. V 2. No edges between vertices in V 1 or V 2 This is a bipartite graph but not a complete bipartite graph ( so it is NOT K 6, 4 ). b. a. c. g. f. e. d. {a, b, d }, {c, e, f, g} K 3, 4. How many vertices and edges in K m, n ?. If a is in V1, then, b, d, e must be in V2 (why?)
E N D
V1 V2 No edges between vertices in V1 or V2 This is a bipartite graph but not a complete bipartite graph ( so it is NOT K6, 4 ).
b a c g f e d {a, b, d }, {c, e, f, g} K3, 4 How many vertices and edges in Km, n?
If a is in V1, then, b, d, e must be in V2 (why?) Then, c is in V1 and there is no inconsistency. So we can rearrange the graph as follows:
Theorem: A simple graph is bipartite if and only if it is possible to assign one of two different colors to each vertex of the graph so that no two adjacent vertices are assigned the same color.
b a c f d e Is a bipartite graph?
b a a c f d e
b a c f d e Is a bipartite graph?
b a c f d e
b a c f d e Not a bipartite graph
Application: Job Assignments Suppose that there are m employees in a group and j different jobs that need to be done, where m ≤ j. Each employee is trained to do one or more these jobs. Use a bipartite graph to model employee capabilities. John Mary Helen Brad Testing Implementation Architecture Requirements
Matching A subset of edges such that no two edges are incident with the same vertex. A matching Not a matching
Maximal matching is a matching with the largest number of edges. Maximal matching Not a maximal matching
Job assignment: To assign jobs to employees so that the largest number of employees are assigned jobs, we seek a maximum matching in the graph that model employee capabilities. John Mary Helen Brad Testing Implementation Architecture Requirements
9.3 Representing Graphs Vertex Adjacent Vertices ------------------------------------------------ u1 u2, u5 u2 u1, u3, u4 u3 u2, u4 u4 u2, u3, u5 u5 u1, u2, u4 Adjacency list
Adjacency Matrix Order the vertices in some way V1, V2, …., Vn , the adjacency matrix is an n-by-n matrix
Vertices Edges