# Algorithms Questionnaire Paper Homework Help Assignment

Algorithms Questionnaire Paper Homework Help

CS 330 – Spring 2021
Homework 4
Due: Wednesday, March 3 by midnight via gradescope

Read Pages 12-14 from Chapter 1 of our 330 textbook.
Also read the following pages from Chapter 4, Greedy Algorithms, from the textbook: pages 115-
125 and for next week pages 137-151.

Problem 1
Do the three short questions (a), (b) and (c). Recall the Interval Scheduling Problem from sec-
tion 4.1 of the text and which we discussed in class. The questions below all refer to this problem.
(a). (4 points) Give an example of an interval scheduling problem instance where at least 3 of
the intervals can be scheduled (that is they don’t overlap) and which has EXACTLY 5 different
optimal solutions.
Note: As in the book, you should draw a picture to define the problem instance.
To get credit you must state the size of the optimal solutions and also number the intervals and
write down the 5 different optimal solutions to the problem.
You can write down each optimal solution by writing down the numbers of the intervals that
make up the solution.
(b). (4 points)

Suppose we choose 2 rules for interval scheduling and combine them into one algorithm. Rule
1 selects the interval that is shortest and Rule 2 selects the interval with the fewest conflicts.
Both of these rules is considered separately in our textbook.
The algorithm A is then: Run rule 1 on the Interval Scheduling Problem instance and then run
rule 2 on the same Interval Scheduling Problem instance and output the result which is largest.
Show that algorithm A is not optimal by giving a example of an interval scheduling problem
instance I which, when we run algorithm A on instance I, results in an answer which is not optimal.
Specifically your answer should look like one of those pictured in our textbook (or lecture) and
you should explain briefly how this combined algorithm works on your example, what result you
get when you run algorithm A on your example and why it is not optimal.
(c). (4 points) This question concerns the weighted interval scheduling problem whose short
description can be found on page 14 of the textbook, and also see the first paragraph on page 122.
1Here each interval i has a start time ti and find time fi and also positive value vi > 0 assigned
to it. Here we assume that no two intervals have the same weight (Just to avoid ties).
The goal of the algorithm is to find a list of intervals which don’t overlap and and whose
total weight is maximum. (The total weight is the sum of all the weights in the interval chosen.)
Show an example where the rule which chooses the largest weight interval at each iteration does
not always result with an optimal (that is maximum) solution.
So you start with all the intervals, apply the rule to get a largest weight interval (say L), delete
all intervals which overlap with L, and repeat until all of the Intervals have either been chosen or
deleted.
For your answer you should just draw a picture (for example, as in Figure 4.1) which shows all
the n intervals in your problem instance and where each interval is labeled by number i from 1 to
n, where n = the number of intervals in your example. Also give each interval i has a value vi.
Then say why the rule does not result in a maximum total value solution by giving the total
value of your results using the rule and also the total maximal value of any compatible solution
(which should be larger than the one you found).
2

Do you have a similar assignment and would want someone to complete it for you? Click on
the ORDER NOW option to get instant services at LindasHelp.com. We assure you of a well