Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 . We are given 2 n equally - spaced points on a line. Half the points are black, and half are white. The
Problem We are given equallyspaced points on a line. Half the points are black, and
half are white. The goal is to connect every black point to a distinct white point with a wire
so as to minimize the total wire length.
Below are two suggestions for greedy algorithms, which may or may not solve the problem
correctly. For each suggested algorithm, if it is correct, prove its correctness. If it is incorrect,
prove that by providing an input on which the algorithm does not find an optimal solution.
Each of the suggested algorithms performs iterations. In every iteration, it selects a
single pair of points to connect and then deletes these two points from the line. In order to
define each algorithm, it is now enough to specify the greedy rule for selecting the pair of
points to connect.
Greedy Rule : find any pair of points, where is black and is white, and no
other point lies between the two. Connect to and delete both points from the line.
Greedy Rule : Let be the leftmost black point and let be the leftmost white point.
Connect to and delete both points from the line.
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