There n boys and n girls at a party. Whenever a song starts, they will form exactly n pairs to dance. No boy will dance

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

There n boys and n girls at a party. Whenever a song starts, they will form exactly n pairs to dance. No boy will dance

Post by answerhappygod »

There n boys and n girls at a party. Whenever a song starts,they will form exactly n pairs todance. No boy will dance with the same girl twice.Some pairs of boys and girls like each other, and all other pairsof boys and girls dislike each other.Every boy will dance with at most k girls that he dislikes, andeach girl will dance with at most kboys that she dislikes, where k < n.As the DJ, your job is to determine the maximum number of songs youcan play, such that it ispossible for pairs to be formed for all songs according to theabove requirements.
Using maximum flow algorithms, such as Ford-Fulkerson andEdmonds-Karp. Design an algorithm which achieves this and runs intime polynomial in n:
1) For arbitrary k.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply