Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[ 1 0 points ] Assume there are n buyers making offers b 1 , dots, b n for some items, and there are n
points Assume there are buyers making offers dots, for some items, and there are sellers wishing to get
the amount dots, Your goal is to match a buyer with a seller such that the total sum of all differences
between the offer and their assigned target value is minimized. For example, assume you have two offers with
values and and two target amounts of and If you match with and with the total sum is
However, if you match them the other way around, the cost will be Hence the first
solution is more preferable.
Consider the following two greedy strategies:
Find the offer and the selling value with the minimum difference. Match this offer to the selling amount. Repeat
until every offer is matched.
Sort the buying offers and sort the selling targets. Match the smallest offer to the smallest target value according
to the sorting, and repeat.
One of these strategies is optimal. Give a counterexample for the wrong one and argue about the optimality
of the other one pts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started