• Nem Talált Eredményt

Combinatorial optimization

N/A
N/A
Protected

Academic year: 2022

Ossza meg "Combinatorial optimization"

Copied!
2
0
0

Teljes szövegt

(1)

Combinatorial optimization

László Papp<lazsa@cs.bme.hu>

2022. spring 4th practice solutions

1. In the BIN PACKING problem we have 4 items. The sizes are0.4,0.7,0.1 and 0.6. Run the

(a) First Fit algorithm!

(b) First Fit Decreasing algorithm!

(c) How many bins are utilized by the optimal packing?

2. HAMILTONIAN PATH is the following decision problem:

Input: A graph G

Question: Is there a Hamiltonian path in G? (a) Show that HAMILTONIAN PATH is in NP.

(b) Show that a HAMILTONIAN PATH≺ 3-SAT Karp reduction exists.

(c) Give a Karp reduction from HAMILTONIAN (CYCLE) to HAMILTONIAN PATH.

(d) Show that HAMILTONIAN PATH is an NP-complete problem.

3. Let SHORT PATH be the following decision problem:

Input: A graph G, vertices u, v and a number k.

Question: Is there a path between uand v whose length is at most k (contains at most k edges)?

Assume that P̸=NP. Under this assumption, do these Karp reductions exists?

(a) SHORT PATH ≺ 3-SAT.

(b) 3-SAT ≺ SHORT PATH

(c) BIN PACKING ≺ HAMILTONIAN (CYCLE)

4. Consider the Bin packing problem where the sizes of the items are the following: 0.15, 0.4, 0.25, 0.55, 0.55, 0.55, 0.55, 0.55, 0.2, 0.1, 0.1.

(a) Run the First Fit algorithm. Is the result of this algorithm is an optimal packing?

(b) Run the First Fit Decreasing algorithm. Is the the result of this algorithm is an optimal packing?

5. A glassware producer sends a lot of fragile items to one of its customers. All of the boxes, which the company uses, have the same size. On the other hand, the size of the items is varying. The company lls the empty space in each box with a ller material. This material is much more expensive than the boxes, therefore the company want to minimize the amount of this material which it uses. Is the First Fit or the First Fit Decreasing algorithm is a c-approximation algorithm for this problem?

1

(2)

6. S-T HAMILTONIAN PATH is the following decision problem:

Input: A graph G and two vertices of G: s and t.

Question: Does Gcontain a Hamiltonian path which starts with s and ends with t? (a) Show that S-T HAMILTONIAN PATH is in NP.

(b) Give an S-T HAMILTONIAN PATH ≺HAMILTONIAN (CYCLE) Karp reduction.

7. Let BIPARTITE PERFECT MATCHING be the following decision problem:

Input: A bipartite graph G.

Question: Does Ghave a perfect matching?

Assume that P ̸=N P. Under this assumption, do these Karp reductions exist?

(a) 3-SAT ≺ BIPARTITE PERFECT MATCHING (b) BIPARTITE PERFECT MATCHING ≺ CLIQUE 8. Let LONG PATH be the following decision problem:

Input: A simple graph G and a numberk.

Question: Is there a path in Gwhose length is at least k (contains at least k edges)?

(a) Show that LONG PATH is in NP.

(b) Show that the LONG PATH ≺ 3-SAT Karp reduction exists.

9. Let BIPARTITE VERTEX COVER be the following decision problem:

Input: A bipartite graph G and a numberk.

Question: Does G contain a vertex cover of size at most k?

(a) Give a BIPARTITE VERTEX COVER≺VERTEX COVER Karp reduction.

(b) Show that a BIPARTITE VERTEX COVER ≺ CLIQUE Karp reduction exists.

(c) *Show that if P̸=NP, then a SAT≺BIPARTITE VERTEX COVER Karp reduction does not exist.

10. Give a HAMILTONIAN PATH≺ HAMILTONIAN (CYCLE) Karp reduction.

11. In all of these problems the input is a simple undirected graph G and a set S which is a subset of V(G). Decide which ones of these problems are contained in P and which ones are NP-Complete?

(a) DoesGcontain a spanning treeT where each element ofS is a leaf(a vertex is a leaf if its degree is one)?

(b) DoesG contain a spanning treeT whose leaf vertices are exactly the elements ofS? (c) Does G contain a spanning treeT whose leaf vertices are contained in S?

12. Assume that we have an algorithm A which decides the HAMILTONIAN problem in polynomial time. So it tells for each graph whether it contains a hamiltonian cycle or not.

Design a polynomial time algorithm which uses A several times and nds a hamiltonian cycle in any given graph.

2

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

The company has three centers where Tshirts can be manufactured and these centers have a capacity of turning out 230, 280, and 190 pieces of Tshirts per day, respectively, regardless

His research interests are in the combinatorial optimization, algorithmic solution of hard optimization prob- lems related to networks (network design, optimal routing, routing

A county want to build a sewage system which connects all the towns and the wastewater treatment facility.. The above graph represents

In the left network given in the rst problem, replace the top-left edge's capacity (which was 8) by a parameter p... In the given network each number in a round bracket is the

We can solve in polynomial time a CSP instance if its primal graph G is planar and has a projection sink.

Remember that we have learnt a polynomial time algorithm for finding maximum matching in a bipartite graph?. The formalization works for all kind of graphs so it looks like a

Lemma: Given a graph G without isolated vertices and an integer k, in polynomial time we can eitherI. find a matching of size k + 1, find a

Since in this example the optimization uses continuous design variables, therefore the resulting optimal design variable values should be adjusted due to manufacturability