Bài giảng Toán rời rạc: Ghép cặp trên đồ thị hai phần cung cấp cho người học những nội dung kiến thức như: Ghép cặp Nam & Nữ, định lý Hall, làm thế nào để tìm ghép cặp cực đại? Mời các bạn cùng tham khảo để biết thêm nội dung chi tiết.
Trang 1Ghép cặp trên đồ thị hai phần
Trần Vĩnh Đức
HUST
Ngày 24 tháng 7 năm 2018
Trang 2Ghép cặp trên đồ thị hai phần
Mathematics for Computer Science, 2013 (Miễn phí)
Trang 3Tìm bạn nhảy
người đôi một lạ nhau!
Trang 4Tìm bạn nhảy
quen đúng 50 cô gái!
nhảy cùng nhau phải biết nhau?
Trang 5Nội dung
Ghép cặp Nam & Nữ
Định lý Hall
Làm thế nào để tìm ghép cặp cực đại?
Trang 6Đồ thị Nam & Nữ
Albert R Meyer April 3, 2013
Nam & Nữ hợp nhau
Hợp nhau
bipartite.2
Trang 7Đồ thị Nam & Nữ
Albert R Meyer April 3, 2013
bipartite.3
Compatible Boys & Girls
Trang 9Đồ thị Nam & Nữ
Albert R Meyer April 3, 2013
Compatible Boys & Girls
Trang 10Đồ thị Nam & Nữ
Albert R Meyer April 3, 2013
bipartite.6
Compatible Boys & Girls
Trang 11Đồ thị Nam & Nữ
Albert R Meyer April 3, 2013
bipartite.7 3
Compatible Boys & Girls
Trang 12Compatible Boys & Girls
Not enough boys for these girls!
Có 3 cô gái nhưng chỉ có 2 chàng trai phù hợp
Trang 13Không tồn tại cặp ghép cho Nữ
Albert R Meyer April 3, 2013
Trang 16Bổ đề (Tắc nghẽn)
Nếu tồn tại tắc nghẽn, vậy không tồn tại cặp ghép
Trang 17Định lý (Hall)
Ngược lại, nếu không có tắc nghẽn, vậy có tồn tại cặp ghép
Trang 18Bài tập
114 Matching, marriage and Menger's theorem
of'V\, let (p(A) be the set of vertices ofVi that are adjacent to at least one vertex of
A Then a complete matching from V\ to V 2 exists if and only if jAj S l<p(A)/\ for each subset A ofV\
Proof The proof of this corollary is a translation into graph terminology of the above
(i) Draw the bipartite graph corresponding to this table of relationships,
(ii) Find five different solutions of the corresponding marriage problem,
(iii) Check the marriage condition for this problem
tool-maker, and receives five applicants - one for the job of bricklayer, one for carpenter, one for bricklayer and plumber, and two for plumber and toolmaker
(i) Draw the corresponding bipartite graph
(ii) Check whether the marriage condition holds for this problem
Can all of the jobs be filled by qualified people?
the marriage condition fail?
Fig 25.4
marry more than one of his girl friends Find a necessary and sufficient condition for the
18 / 39 CuuDuongThanCong.com https://fb.com/tailieudientucntt
Trang 19Nội dung
Ghép cặp Nam & Nữ
Định lý Hall
Làm thế nào để tìm ghép cặp cực đại?
Trang 22Định lý (Hall)
|S| ≤ |E(S)|
vậy có tồn tại một cặp ghép
Trang 23Chứng minh định lý Hall
Bổ đề
Giả sử không có tắc nghẽn Hơn nữa, nếu S là một tập những cô
Trang 24Albert R Meyer April 3, 2013
Trang 25Chứng minh định lý Hall
Trang 26Trường hợp 1
hai phần
Trang 27Trường hợp 2
|S| < |E(S)|
nào đó Tại sao?
còn lại Tại sao?
Trang 28Kiểm tra tắc nghẽn?
Mệnh đề
Trang 30Tìm bạn nhảy
quen đúng 50 cô gái!
nhảy cùng nhau phải biết nhau?
Trang 31Nội dung
Ghép cặp Nam & Nữ
Định lý Hall
Làm thế nào để tìm ghép cặp cực đại?
Trang 32Đường mở
Định nghĩa
Xét đồ thị hai phần G và M là một ghép cặp trong G Ta nói rằng
▶ P bắt đầu và kết thúc ở hai đỉnh u, v nào đóchưa được ghépcặp; và
Trang 33Tính chất của đường mở
10.4.1 Show by an example that it may happen that a bipartite graph G has
a perfect matching, but if we are unlucky, the greedy matching M constructed
above is not perfect.
10.4.2 Prove that if G has a perfect matching, then every greedy matching
matches up at least half of the nodes.
So suppose that we have constructed a matching M that is not perfect.
We have to try to increase its size by “backtracking,” i.e., by deleting some
of its edges and replacing them by more edges But how do we find the
edges we want to replace?
The trick is the following We look for a path P in G of the following
type: P starts and ends at nodes u and v that are unmatched by M; and
every second edge of P belongs to M (Figure 10.6) Such a path is called
an augmenting path It is clear that an augmenting path P contains an odd
number of edges, and in fact, the number of its edges not in M is one larger
than the number of its edges in M.
v u
Trang 34Tăng kích thước ghép cặp dùng đường mở
Hình:Nếu tìm được một đường mở P, ta có thể xóa các cạnh trong M
và thay bằng các cạnh P không thuộc M.
Trang 35Chiến lược tìm ghép cặp cực đại
Trang 36Tại sao chiến lược này đúng?
Định lý
Nếu ghép cặp M trong đồ thị hai phần G không phải ghép cặp cực đại, thì G chứa một đường mở cho M.
Trang 37bậc 1 hoặc 2 Tại sao?
hoặc chu trình;
Trang 39Bài tập
Hãy tìm ghép cặp cực đại cho cho đồ thị hai phần sau và chứng
minh nó là ghép cặp cực đại
10.4Ho wto Finda Perfect Matching
177
FIGURE10.9.
Agraph fortrying
outthe algorithm.
10.4.8 Now suppose thatw eha ve thew eaker conditionthat
every nonempty
subsetA onthe lefthas atleast
|A
|−
1neigh bors onthe right.
Prove thatG
contains amatc hingthat
matches upall butone node oneac hside.
10.4.9 LetG be abipartite graphwith
mno deson both sides.Pro
ve thatif
each node hasdegree largerthan
m/2, thenit hasa perfect matching.
10.4.10 Does thegraph inFigure 10.10ha
ve ap erfectmatc hing?
FIGURE10.10.
Atruncated chessb
oard.
10.4.11 Draw agraph whoseno
desare thesubsets of
{a, b,c }, andfor which
tw ono desare adjacent
ifand onlyif
theyare subsetsthat
diff erin exactlyone
element.
(a)What isthe num ber ofedges andno
desin thisgraph?
Cany ouname this
graph?
(b)Is thisgraph connected?Do
esit have ap erfectmatc hing?Do
esit have
a
Hamiltoncycle?