Network Critical - Efficient Algorithms and Intractable Problems - Exams, Exams of Algorithms and Programming

Main points of this exam paper are: Network Critical, Optimizes Revenue, Constraints, Maximum Available, Reduction From, Vertices, Even Number, Np-Complete, Correctness, Justification

Typology: Exams

2012/2013

Uploaded on 04/02/2013

sushmi_98
sushmi_98 🇮🇳

4.5

(4)

51 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1. (10 points) A cargo plane can carry a maximum of 100 tons and a maximum of 60
cubic meters of cargo. There are three materials that need to be carried, and the cargo
company may choose to carry any amount of each, up to the maximum amount available
in each.
Material 1 has density 2 tons/cubic meter, maximum available amount 40 cubic meters,
revenue $1,000 per cubic meter.
Material 2 has density 1 ton/cubic meter, maximum available amount 30 cubic meters,
revenue $1,200 per cubic meter.
Material 3 has density 3 tons/cubic meter, maximum available amount 20 cubic meters,
revenue $12,000 per cubic meter.
Write a linear program that optimizes revenue while satisfying all the constraints.
2. (10 points) In class we proved that 3-coloring is NP-complete. Use this fact to prove
that the problem of 3-coloring remains NP-complete even in the special case where the
given graph is required to have an even number of vertices and an even number of edges.
Reduction from:
Proof of correctness:
3. (30 points) A subsequence of a given sequence of numbers can be thought of as the new
sequence obtained when you cross out some of the numbers. For example, 1,2,5,6,9, a
CS 170, Midterm #2, Fall 1998
1
pf3
pf4

Partial preview of the text

Download Network Critical - Efficient Algorithms and Intractable Problems - Exams and more Exams Algorithms and Programming in PDF only on Docsity!

  1. (10 points) A cargo plane can carry a maximum of 100 tons and a maximum of 60 cubic meters of cargo. There are three materials that need to be carried, and the cargo company may choose to carry any amount of each, up to the maximum amount available in each.

Material 1 has density 2 tons/cubic meter, maximum available amount 40 cubic meters, revenue $1,000 per cubic meter.

Material 2 has density 1 ton/cubic meter, maximum available amount 30 cubic meters, revenue $1,200 per cubic meter.

Material 3 has density 3 tons/cubic meter, maximum available amount 20 cubic meters, revenue $12,000 per cubic meter.

Write a linear program that optimizes revenue while satisfying all the constraints.

  1. (10 points) In class we proved that 3-coloring is NP-complete. Use this fact to prove that the problem of 3-coloring remains NP-complete even in the special case where the given graph is required to have an even number of vertices and an even number of edges.

Reduction from:

Proof of correctness:

3. (30 points) A subsequence of a given sequence of numbers can be thought of as the new sequence obtained when you cross out some of the numbers. For example, 1,2,5,6,9, a

subsequence of the sequence 3,1,2,17,5,6,9, is obtained by crossing out 3 and 17.

Consider the following problem: Given a sequence of n number x 1 ,... , x n, find the length of the longest increasing subsequence. i.e. a subsequence y 1 ,... , y k with k as large as possible and such that y 1 < y 2 <... < y k.

Give a dynamic programming algorithm for this problem.

Dynamic programming recurrence and initialization:

Justification of correctness:

Running time and justification:

4. (20 points) Call an edge of a flow network critical if decreasing the capacity of this edge results in a decrease in the maximum flow. Give an algorithm that finds a critical edge in a network. Your algorithm should run as fast as maximum flow.

Algorithm:

T F A divide and conquer algorithm that breaks a problem of size n into 2 problems of size n / 2 at the cost of n^2 steps is slower than a divide and conquer algorithm that breaks a problem of size n into 3 problems of size n / 2 at the cost of n steps.

T F Raising the 90 th^ roots of unity to the 5 th^ power yields the 18 th^ roots of unity.

Posted by HKN (Electrical Engineering and Computer Science Honor Society)

University of California at Berkeley

If you have any questions about these online exams

please contact [email protected].

Posted by HKN (Electrical Engineering and Computer Science Honor Society) University of California at Berkeley If y 4