• Keine Ergebnisse gefunden

Algorithmic Discrete Mathematics 3. Exercise Sheet

N/A
N/A
Protected

Academic year: 2022

Aktie "Algorithmic Discrete Mathematics 3. Exercise Sheet"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Algorithmic

Discrete Mathematics 3. Exercise Sheet

Department of Mathematics SS 2012

PD Dr. Ulf Lorenz 23. and 24. May 2012

Dipl.-Math. David Meffert Version of May 16, 2012

Groupwork

Exercise G1

Let the algorithm CLIQUE be defined by:

input : A graphGand a natural numberk.

output : ’yes’, ifG contains a clique of cardinalityk. Otherwise ’no’.

Let the algorithm IDEPENDENT SET (IS) be defined by:

input : A graphGand a natural numberk.

output : ’yes’, ifG contains an independent set consisting ofkvertices. Otherwise ’no’.

Show that CLIQUE≤P IS.

Exercise G2 (Bipartite graphs)

Prove that a graph(V,E)is bipartite iff it contains no cycles of odd length.

Exercise G3 (Eulerian graphs)

A path in a GraphG= (V,E)is calledEulerian path, if it contains every edgeeEexactly once. An Eulerian path which is a cycle is calledEulerian cycle. A graph is calledeulerianif it contains an Eulerian cycle.

(a) Which of the given graphs inFigure 1are Eulerian graphs?

Figure 1:Eulerian graphs?

(b) Now letGbe a connected graph. Name necessary conditions forGbeing eulerian.

(c) Are these conditions sufficient, too?

1

(2)

Exercise G4 (Primes and the classN P)

The class of problems whose complement is inN P is called co-N P. For the following exercise assume that the coding length of a natural numbernis given by〈n〉=blog2nc+1.2

(a) Show that the problem PRIMES, to determine if a given natural number is prime, is a co-N P problem.

(b) Why would it be much harder to show that this problem is also in the classN P? (c) Prove PRIMES∈ N P under the assumption〈n〉=n.

Homework

Exercise H7 (Trees) (10 points)

LetG= (V,E)be a graph withn≥2vertices. Proof that the following statements are equivalent:

(a) Gis a tree.

(b) Gis connected and containsn−1edges.

(c) Gcontainsn−1edges but no cycles.

(d) Gis minimally connected. That means for every edgeeEthe graphG\ {e}= (V,E\ {e}) is not connected.

(e) Gcontains no cycles and adding one edge generates exactly one cycle.

(f) For every two nodesu,vV there is exactly one[u,v]-path inG.

Exercise H8 (The complement graph) (10 points)

The complement graphG of G = (V,E)is the graph were two vertices are adjacent iff they are not adjacent inG. So formally speaking we haveG:= (V, [n]

2

\E)with [n]

2

\E:={(i,j)|i6=j∈ {1, . . . ,n}(i,j)∈/E}. LetGbe an undirected graph. Prove thatGorGis connected.

Exercise H9 (10 points)

Prove SUBSETSUM≤pPARTITION.

problem : SUBSETSUM input :a1, ...,an,b∈N output :T⊆ {1, ...,n}withP

kTak=b problem : PARTITION

input :a1, ...,al∈N

output :T⊆ {1, ...,l}withP

k∈Tak=P

k/∈Tak

2 This is the common binary representation of a natural numbern. Hence you needblog2nc+1digits.

2

Referenzen

ÄHNLICHE DOKUMENTE

A walk in a connected graph G = ( V, E ) is called an Eulerian trail if it contains each edge of G exactly once?. A closed Eulerian trail is called an

To this end, we could store adjacency lists as linked lists (so that deletion works in constant time) and endow each entry v 0 of an adjacency list A ( v ) with a pointer to the

(a) Devise an equal length code (i.e., every symbol is encoded with a code word of equal length) for this problem and encode the following sentence using your code (without

Devise an algorithm that returns an Eulerian tour in G, prove its correctness and estimate its running time in O-notation.. Optimierung

Generalize the breadth-first-search algorithm so that it computes a spanning forest of a not necessarily connected graph... To this end, we have to verify whether inserting the edge

Describe an algorithm that finds all upwards critical edges and has a considerably better running time than solving m max flow problems.. (b) An edge e in a network ( G = ( V, E ),

For each of the following families of sets determine whether the condition of the theorem on SDRs is met.. If so, then find an SDR and the corresponding

(a) Devise an equal length code (i.e., every symbol is encoded with a code word of equal length) for this problem and encode the following sentence using your code (without