Answered step by step
Verified Expert Solution
Link Copied!

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 1. We are given 2n equally-spaced 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 n 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 1: find any pair (a,b) of points, where a is black and b is white, and no
other point lies between the two. Connect a to b and delete both points from the line.
Greedy Rule 2: Let a be the leftmost black point and let b be the leftmost white point.
Connect a to b and delete both points from the line.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago