Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,

Similar presentations


Presentation on theme: "Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,"— Presentation transcript:

1 Lecture 11

2 Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios, no interference constraint A set of links can be scheduled only if the set is a matching

3 Input Queued Switches The links scheduled must be a matching

4 Maximum Matching Matching of largest cardinality Augmenting path is a path of alternating sequence of matched and unmatched edges with free end nodes. A node is free if none of its incident edges is in a matching. e1e1 e2e2 e3e3 Size of matching increases if {e 2 } is replaced by {e 1, e 3 }

5 A  B = (A – B)  (B – A) Suppose M is a matching and P is an augmenting path. Then M  P is also a matching A matching is maximum if and only if there is no augmenting path. Also, |M  P | = |M| + 1 If there is no augmenting path, then the matching is not maximum.

6 Let there be a matching M` of greater cardinality than M. Consider the graph M  M’ Clearly, a vertex can have at most 2 incident edges So the new graph consists of disjoint paths and cycles. The cycles must be even cycles with alternating edges from M and M’ A vertex can have one incident edge from M, or one incident edge from M’, or one incident edge from M and another from M’

7 Paths will also have edges altering between M and M’ Since M’ has a cardinality greater than M, there must be at least one path which starts and ends in M’. This is an augmenting path for M.

8 Maximum Matching Algorithm Start with an empty set. 1) Search for an augmenting path. If there is an augmenting path, then update the matching, else terminate. Go to (1) How does one find an augmenting path?

9 Bipartite Graph Augmenting path can be found by Hungarian tree method Breadth first search like method Consider one of the two partitions S. S T Start from the free vertices in S All the edges from the free vertices are in the tree.

10 S T Start from the free vertices in S All the edges from the free vertices are in the tree. If we happen to reach a free vertex in T, then we have found an augmenting path. Suppose all the vertices in T are matched, then we follow the matched edges back to S, and subsequently all free edges from the newly encountered ones in S. If we reach a free vertex in T we are done, otherwise again follow back the matched edges into S.

11 We would never reach the same vertices in S anyway. Vertices in S are either matched or free. We take only matched edges to reach S from T. A matched edge can not reach a free vertex. A matched edge can not reach an already reached matched vertex, because it has been reached using a different matched edge. Don’t include free edges from S into already reached vertices in T. So vertices in T are never repeated

12 Hungarian tree search finishes in O(E)

13 Is it possible that there is an augmenting path, but the Hungarian tree does not yield one? An augmenting path has odd length. Any odd length path must have one end in S and another end in T. An augmenting path must have one free vertex in S and another in T. Consider an augmenting path from the free vertex in S.

14 The first edge is from a free vertex in S. The second edge is a matched edge from T. The third edge is a free edge from S. The fourth is a matched edge from T…. We are looking at all such paths in the Hungarian method. If there is an augmenting path, we would find one!

15 Complexity Analysis Once an augmenting path is found, one new vertex is matched. Need to look for augmenting paths at most V times. Looking for an augmenting path consume O(E). So, overall O(VE).

16 Nonbipartite Graph Basic algorithm remains same. Need to find augmenting paths in different ways. We can not partition the vertex set into two sets, and start with free vertices in just one set. As a result need to consider all free vertices. You may clearly reach some free vertex in your search because an augmenting path ends in a free vertex.

17 But reaching a free vertex does not mean that we have reached an augmenting path. So we can not rule out reaching free vertices (as an augmenting path starts and ends in a free vertex). At the same time when we reach a free vertex, we do not know whether we have an augmenting path or not! Odd cycles are the problems.

18 So for nonbipartite graphs, we start from a single free vertex at a time. Also, whenever odd cycles are detected they are shrunk into one vertex, called blossoms. After discovering augmenting paths, the blossoms are expanded. Need an O(V 4 ) algorithm.

19 Weighted Matching Now, every edge has a weight. Weight of a matching is the sum of the weights of its edges. Need to find a maximum weighted matching. More general case of maximum matching (maximum matching is maximum weighted matching with edge weight 1)

20 Application Wireless networks with only constraints on the number of radios. Any set of edges scheduled is a matching. Throughput optimal policy calls for scheduling the matching with maximum backlog difference. Consider the weight of an edge as the difference between its source and destination backlog. We need to find a maximum weighted matching every step.

21 Is it sufficiently general to consider a graph with nonnegative weights? Is it sufficiently general to consider complete graphs? (A complete graph is one where there is an edge between every pair of vertices). For bipartite graphs, is it sufficient to consider equal size partitions only.

22 Bipartite Graphs Will consider bipartite graphs. Partitions are X and Y and |X| = |Y| We assume that there is always an edge between vertex x in partition X, and vertex y in partition Y. Every edge has a nonnegative weight. A matching where every vertex is matched is a perfect matching. Such a bipartite graph has a perfect matching.

23 Vertex Labelling We assign a nonnegative real number with each vertex. This nonnegative real number is the label of the vertex. Label of vertex x is l(x). A label is feasible if for every edge (x, y), l(x) + l(y)  w(x, y) An example of a feasible label is l(y) = 0 for all vertices in Y and l(x) = max y w(x, y) l(x) + l(y) = max y w(x, y)  w(x, y)

24 Equality Subgraph Equality subgraph consists of all vertices. An edge (x, y) is included in the equality subgraph if l(x) + l(y) = w(x, y). If the equality subgraph G l has a perfect matching M , then M  is the maximum weighted matching in the original graph G. Weight of M  =  e  M w(e) =  u, : u, is matched l(u) (since M  is a matching and G l is an equality subgraph) =  u, : u, is in V l(u) (since M  is a perfect matching)

25 Consider any other matching M in the graph G. Weight of M =  e  M w(e)  u, : u, is matched l(u) (since M is matching)  u, : u, is in V l(u) (since labels are nonnegative) = Weight of M  So, if we can adjust the labels so that the equality subgraph has a perfect matching, then we are done. Why?

26 If a perfect matching exists, then it is the maximum matching. So, existence of a perfect matching can be tested by computing the maximum matching in the equality subgraph. Supposing, the equality subgraph had all the edges in the original graph. Then it is a complete bipartite graph. Hence, it would have a perfect matching.

27 So, if the equality subgraph does not have a perfect matching, we should adjust the labels so that the number of edges in the equality subgraph increases. However, any adjustment should be such that the labels are feasible. Adjustment should aim at satisfying equality constraints in the edges.

28 Maximum Weighted Matching Algorithm Start with the following labels: l(y) = 0 for all vertices in Y and l(x) = max y w(x, y) 2. Construct the equality subgraph. Find a maximum matching in the equality subgraph. If this is a perfect matching, then stop. Otherwise, readjust the labels and go to step (2).

29 Readjustment of Labels Construct the Hungarian tree w.r.t. the current maximum matching in the equality subgraph. Let S be the set of vertices in X in the tree, and T be the set of vertices in Y. Start from the free vertices in X. Free vertices exist since the matching is not perfect. The hungarian tree will not yield an augmenting path in the equality subgraph.

30 Observe that there are no edges between S and Y – T in the equality subgraph (else hungarian tree has not been grown properly). At the same time, there are edges between S and Y – T in the original graph. Reason: Current matching is not maximum in G, as G has a perfect matching, and this is not a perfect matching. So the hungarian tree must have an augmenting path in G. But we know there is no augmenting path in the current hungarian tree. This means that the current hungarian tree can grow further in G, and this is possible only if there are edges between S and Y-T.

31 Decrease the labels in S uniformly, and increase those in T uniformly so that the labels are valid. Edges between S and Y-T in G will now start entering the equality subgraph. Stop when the first edge enters. A new vertex in Y is added to the Hungarian tree. If this vertex is free we have an augmenting path, otherwise the Hungarian tree grows.

32 If this vertex is free, stop the relabelling and go to step (2). Otherwise, relabel once again. Hungarian tree can not grow indefinitely. So we always improve the matching before going to step (2). Now, we improve the matching till we find a perfect matching in the equality subgraph.

33 Input Queueing The switch can transport at most one packet between any input and output in any slot. 1 2 3 4 5 A B C D E There can be a packet transmission between 1-A, 2-B, 3-D in one slot. But 1-A, 2-A transmissions can not take place simultaneously, nor 1-A 1-C.

34 Activation schedule needs to be a matching in every slot. HOL Blocking: Every input line maintains a single queue. Only the first packet in any queue can be scheduled (head of line packet). It was shown that even if inputs always have packets, an input or output line can not be utilized more than 58.5% Karol et. al., 1988, JSAC Now let the head of line packet of line 1 be intended for A, the second packet of line 1 is intended for B, head of line packet of line 2 is intended for B. In this case, either line 1 or line 2 would be idle.

35 Look ahead scheduling: It is allowed to schedule packets other than HOL, look upto second or third packets…. Improvement of Throughput Achieving 100 % Throughput in Input Queued Switches N. Mckeown, V. Annantharam, J. Walrand, INFOCOM 96

36 Consider an N x N input queued switch Every input maintains N separate queues, one for each output. In all, there are N 2 queues at the input. The scheduled queues should be a matching, since no two scheduled queues must share an input or an output node. Weight of a queue is the number of packets in the queue. Schedule the queues to form a maximum weighted matching. Incidentally, queues form a complete bipartite graph.

37 Stability Results Suppose, arrival process for any input output pair is i.i.d. Also, arrival processes for different input output pairs are independent. Probability of a packet arrival in a slot for input output (u, v) is p uv. Let  u p uv  1 and  v p uv  1 Then the system is stable under the above policy.

38 Resource allocation constraints in input queued switches and single hop wireless networks are fundamentally similar. Consider a system of wireless nodes. Single hop transmission. Every node has a single radio. No interference constraint. Collision can be avoided if scheduled links are matchings. Studied by Tassiulas and Ephremidis in Automatic Control, 1992.

39 Weight of a link = difference in backlog across the link Difference in backlog in this case is number of packets waiting at the source of a link. Throughput optimum policy schedules the matching with maximum difference in backlog (maximum weighted matching).


Download ppt "Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,"

Similar presentations


Ads by Google