Presentation is loading. Please wait.

Presentation is loading. Please wait.

D1: Matchings.

Similar presentations


Presentation on theme: "D1: Matchings."— Presentation transcript:

1 D1: Matchings

2 D1: Matchings Another D1 topic is matchings. A matching is based on a bipartite graph. The graphic in the top right corner is a bipartite graph: a graph which has two sets of vertices arranged to be opposite each other. The vertices on the left can be connected to the vertices on the right via edges, as normal. However, the vertices on the left cannot be connected to each other, and the same goes for the vertices on the right. The number of vertices on the left does not have to match the number of vertices on the right.

3 D1: Matchings Bipartite graphs can be used to model situations, such as shift work (with workers on the left and shifts that need to be done on the right). A matching occurs when a number of vertices on the left are connected to vertices on the right, and vice versa. A F This is a matching. B G This is not a matching. C H To get a matching, no vertex can have two or more edges going into it. D I E J You do not have to match up all vertices to get a matching!

4 Some edges will be unused.
D1: Matchings A bipartite graph shows all the possible edges already, like this: You may be asked to find a complete matching using the bipartite graph and an attempt at a matching as a starting point. Each vertex on the left must be paired with one on the right using edges that are on the bipartite graph. Some edges will be unused. A B C D E F G H I J If a complete matching is not possible, the best you can do is called a maximal matching. This is a matching in which as many of the vertices are connected as possible.

5 D1: Matchings At the start of a typical matchings question, you are given the bipartite graph (which shows all the possible vertices) and a matching, like this: You will then typically improve the matching using the alternating path algorithm (HINT: Here, start at J). You can only use vertices from the bipartite graph (here, Figure 3) for this!


Download ppt "D1: Matchings."

Similar presentations


Ads by Google