Homework 8 Solved Problems - Combinatorial Algorithms - Spring 2002 | CS 373, Assignments of Computer Science

Material Type: Assignment; Class: Theory of Computation; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2001;

Typology: Assignments

Pre 2010

Uploaded on 03/16/2009

koofers-user-uzk
koofers-user-uzk 🇺🇸

8 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 373 Homework 8 Spring 2002
CS 373: Combinatorial Algorithms, Spring 2002
This is not homework 8 - DO NOT SUBMIT
The following is what hw8 would have been, if we had enough time to check it (we don’t). This
homework is an exercise - solve it if you want, don’t solve it if you don’t feel like it. Whatever you
do don’t submit it.
However, there is a non-zero probability that a question from this homework would appear in
the final exam. Ignore this exercise at your own risk.
No solutions for this exercise would be posted.
Problems
1. [20 Points] Provide detailed solutions for the following problems, showing each pivoting stage
separately.
(a) [5 Points]
maximize 6x1+ 8x2+ 5x3+ 9x4
subject to
2x1+x2+x3+ 3x45
x1+ 3x2+x3+ 2x43
x1, x2, x3, x40.
(b) [5 Points]
maximize 2x1+x2
subject to
2x1+x24
2x1+ 3x23
4x1+x25
x1+ 5x21
x1, x20.
(c) [5 Points]
maximize 6x1+ 8x2+ 5x3+ 9x4
subject to
x1+x2+x3+x4= 1
x1, x2, x3, x40.
(d) [5 Points]
minimize x12 + 8x13 + 9x14 + 2x23 + 7x24 + 3x34
subject to
x12 +x13 +x14 1
x12 +x23 +x24 = 0
x13 x23 +x34 = 0
x14 +x24 +x34 1
x12, x13, . . . , x34 0.
2. [5 Points] A steel company must decide how to allocate next week’s time on a rolling mill,
which is a machine that takes unfinished slabs of steel as input and produce either of two
1
pf3
pf4
pf5

Partial preview of the text

Download Homework 8 Solved Problems - Combinatorial Algorithms - Spring 2002 | CS 373 and more Assignments Computer Science in PDF only on Docsity!

CS 373: Combinatorial Algorithms, Spring 2002

This is not homework 8 - DO NOT SUBMIT

The following is what hw8 would have been, if we had enough time to check it (we don’t). This homework is an exercise - solve it if you want, don’t solve it if you don’t feel like it. Whatever you do don’t submit it. However, there is a non-zero probability that a question from this homework would appear in the final exam. Ignore this exercise at your own risk. No solutions for this exercise would be posted.

Problems

  1. [20 Points] Provide detailed solutions for the following problems, showing each pivoting stage separately.

(a) [5 Points] maximize 6x 1 + 8x 2 + 5x 3 + 9x 4 subject to 2 x 1 + x 2 + x 3 + 3x 4 ≤ 5 x 1 + 3x 2 + x 3 + 2x 4 ≤ 3 x 1 , x 2 , x 3 , x 4 ≥ 0. (b) [5 Points] maximize 2x 1 + x 2 subject to 2 x 1 + x 2 ≤ 4 2 x 1 + 3x 2 ≤ 3 4 x 1 + x 2 ≤ 5 x 1 + 5x 2 ≤ 1 x 1 , x 2 ≥ 0. (c) [5 Points] maximize 6x 1 + 8x 2 + 5x 3 + 9x 4 subject to x 1 + x 2 + x 3 + x 4 = 1 x 1 , x 2 , x 3 , x 4 ≥ 0. (d) [5 Points] minimize x 12 + 8x 13 + 9x 14 + 2x 23 + 7x 24 + 3x 34 subject to x 12 + x 13 + x 14 ≥ 1 −x 12 + x 23 + x 24 = 0 −x 13 − x 23 + x 34 = 0 x 14 + x 24 + x 34 ≤ 1 x 12 , x 13 ,... , x 34 ≥ 0.

  1. [5 Points] A steel company must decide how to allocate next week’s time on a rolling mill, which is a machine that takes unfinished slabs of steel as input and produce either of two

semi-finished products: bands and coils. The mill’s two products come off the rolling line at different rates:

Bands 200 tons/hr Coils 140 tons/hr.

They also produce different profits:

Bands $ 25/ton Coils $ 30/ton.

Based on current booked orders, the following upper bounds are placed on the amount of each product to produce:

Bands 6000 tons Coils 4000 tons.

Given that there are 40 hours of production time available this week, the problem is to decide how many tons of bands and how many tons of coils should be produced to yield the greatest profit. Formulate this problem as a linear programming problem. Can you solve this problem by inspection?

  1. [5 Points] A small airline, Ivy Air, flies between three cities: Ithaca (a small town in upstate New York), Newark (an eyesore in beautiful New Jersey), and Boston (a yuppie town in Massachusetts). They offer several flights but, for this problem, let us focus on the Friday afternoon flight that departs from Ithaca, stops in Newark, and continues to Boston. There are three types of passengers:

(a) Those traveling from Ithaca to Newark (god only knows why). (b) Those traveling from Newark to Boston (a very good idea). (c) Those traveling from Ithaca to Boston (it depends on who you know).

The aircraft is a small commuter plane that seats 30 passengers. The airline offers three fare classes:

(a) Y class: full coach. (b) B class: nonrefundable. (c) M class: nonrefundable, 3-week advanced purchase.

Ticket prices, which are largely determined by external influences (i.e., competitors), have been set and advertised as follows:

Ithaca-Newark Newark-Boston Ithaca-Boston Y 300 160 360 B 220 130 280 M 100 80 140

(c) [2 Points] Given a directed graph G = (V, E)), in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0. Write a linear program to compute the maximum flow f : V × V → IR. (d) [3 Points] (Based on CLRS 29.2-7) In the minimum-cost multicommodity-flow problem, we are given a directed graph G = (V, E), in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0 and a cost α(u, v). As in the multicommodity-flow problem (Chapter 29.2, CLRS), we are given k different commodities, K 1 , K 2 ,... , Kk, where commodity i is specified by the triple Ki = (si, ti, di). Here si is the source of commodity i, ti is the sink of commodity i, and di is the demand, which is the desired flow value for commodity i from si to ti. We define a flow for commodity i, denoted by fi, (so that fi(u, v) is the flow of commodity i from vertex u to vertex v) to be a real-valued function that satisfies the flow-conservation, skew-symmetry, and capacity constraints. We now define f (u, v) , the aggregate flow, to be sum of the various commodity flows, so that f (u, v) =

∑k i=1 fi(u, v). The aggregate flow on edge (u, v) must be no more than the capacity of edge (u, v). The cost of a flow is

u,v∈V f^ (u, v), and the goal is to find the feasible flow of minimum cost. Express this problem as a linear program.

  1. [10 Points] Show the following problem in NP-hard.

Problem: Integer Linear Programming Instance: A linear program in standard form, in which A and B contain only integers. Question: Is there a solution for the linear program, in which the x must take integer values?

  1. [10 Points] (Based on CLRS 30.1-7) Consider two sets A and B, each having n integers in the range from 0 to 10n. We wish to compute the Cartesian sum of A and B, defined by

C = {x + y : x ∈ A and y ∈ B}.

Note that the integers in C are in the range from 0 to 20n. We want to find the elements of C and the number of times each element of C is realized as a sum of elements in A and B. Show that the problem can be solved in O(n lg n) time. (Hint: Represent A and B as polynomials of degree at most 10n.)

  1. [15 Points] Divide-and-Conquer Multiplication (Based on CLRS 30-1)

(a) [5 Points] Show how to multiply two linear polynomials ax + b and cx + d using only three multiplications. (Hint: One of the multiplications is (a + b) · (c + d).)

(b) [5 Points] Give two divide-and-conquer algorithms for multiplying two polynomials of degree-bound n that run in time Θ(nlg 3). The first algorithm should divide the input polynomial coefficients into a high half and a low half, and the second algorithm should divide them according to whether their index is odd or even. (c) [5 Points] Show that two n-bit integers can be multiplied in O(nlg 3) steps, where each step operates on at most a constant number of 1-bit values.

  1. [10 Points] Given two sequences, a 1 ,... , an and b 1 ,... , bm of real numbres, We want to determine whether there is an i ≥ 0, such that b 1 = ai+1, b 2 = ai+2,... , bm = ai+m. Show how to solve this problem in O(n log n) time with high probability.