1 / 9

Homework - hints

Homework - hints. Problem 1. Node weights  Edge weights single source shortest paths problem (SSSP). 1/2. 1/2. s. 1. Hint. Return:shortest path and its length. sink. 2. 3. Problem 2: Shortest even (or odd) path

imelda
Download Presentation

Homework - hints

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework - hints Problem 1. Node weights  Edge weights single source shortest paths problem (SSSP) 1/2 1/2 s 1 Hint Return:shortest path and its length sink 2 3 Problem 2: Shortest even (or odd) path Hint: create a copy of each node  bipartite graph, add necessary edges so that, for edge (u,v) in the new graph you always come to v in even paths and to copy of v in odd paths. Problem 3: for extra points

  2. Matching in Bipartite Graphs“ assignment problem” Problem: Given: bipartite graph, find the maximum # of edges that do not overlap  Job assignment problem Jobs Job nobody can do Employees cannot do anything - at the same time assign only 1 job to 1 employee

  3. Matching in Bipartite Graphs“ assignment problem” assignment Find a job assignment such that each job is assigned to one employee and vice versa. -there is a solution in polynomial time -we need to find “extending alternating paths”: start with a node that’s not covered  edge not covered  end in not covered node

  4. Matching in Bipartite Graphs remove Blue = matching red = so-called free node When we go down  always red, when we go up  always green Claim: if there is no alternating path, we cannot add more matching (no improvement)

  5. Matching in Bipartite Graphs node v  M’, v  M M v M Claim:no extending alternating path  this is the maximum possible matching Proof: assume, on the contrary, that larger matching exists: M’ there is a node v  M’, v  M M+M’ has some connected components remove from M+M’ , in the rest still |M| < |M’|

  6. Minimum Weight Matching Problem: Given: complete bipartite graph with weights on edges. Find minimum weight matching. ( G = (A  B, E,w) ) |A| = |B| w  R, not R+ +1 +1 +1 +1 any matching will increase by 1 (if we add +1 to weights of all edges outgoing from a fixed node)

  7. Computation Geometry Application of Matching crystal defects non-convex points - all pieces rectangular, cut in vertical (or horizontal) cuts Problem: minimize # of cats - only 90, 180, 270 cuts (180  -we don’t care about), 270  - problem Fact: if we make a cut from each non-convex point, then the pieces are rectangles.  if we solve matching of non convex, then we find the optimum

  8. Minimum Weight Matching If we change weights with the above procedure, and come to a graph with perfect matching (all nodes matched), of zero weight, then M is minimum weight matching! - we do not change matching by adding and subtracting - for each node v, v  A subtract min(v) = min u B w(v,u) next time  algorithm

  9. Matching in Bipartite Graphs Repeat from v’  M’, v’  M. Either we find alternating path or there will be no edges in M and M’ contradiction to |M| < |M’|

More Related