Solutions to Exercises 9

Similar documents
HOMEWORK 4 SOLUTIONS. Solution: The Petersen graph contains a cycle of odd length as a subgraph. Hence,

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

Network flows and Menger s theorem

Topic 10 Part 2 [474 marks]

Problem Set 3. MATH 776, Fall 2009, Mohr. November 30, 2009

Part II. Graph Theory. Year

Lecture 6: Graph Properties

On the Rainbow Neighbourhood Number of Set-Graphs

MAT 145: PROBLEM SET 6

Discrete Mathematics I So Practice Sheet Solutions 1

WUCT121. Discrete Mathematics. Graphs

Small Survey on Perfect Graphs

Math 776 Graph Theory Lecture Note 1 Basic concepts

How many colors are needed to color a map?

5 Graphs

How many colors are needed to color a map?

Vertex coloring, chromatic number

Math 100 Homework 4 B A C E

Graph theory - solutions to problem set 1

Artificial Intelligence

Minimum Number of Palettes in Edge Colorings

Matching Theory. Figure 1: Is this graph bipartite?

Vertex coloring, chromatic number

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

Two remarks on retracts of graph products

Module 7. Independent sets, coverings. and matchings. Contents

Chapter 6 GRAPH COLORING

Lecture 3: Recap. Administrivia. Graph theory: Historical Motivation. COMP9020 Lecture 4 Session 2, 2017 Graphs and Trees

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

Lecture 20 : Trees DRAFT

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

CMSC 380. Graph Terminology and Representation

Number Theory and Graph Theory

Characterizations of graph classes by forbidden configurations

Section 8.2 Graph Terminology. Undirected Graphs. Definition: Two vertices u, v in V are adjacent or neighbors if there is an edge e between u and v.

Graph Theory Questions from Past Papers

MATH 350 GRAPH THEORY & COMBINATORICS. Contents

Double Vertex Graphs and Complete Double Vertex Graphs. Jobby Jacob, Wayne Goddard and Renu Laskar Clemson University April, 2007

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

Some Upper Bounds for Signed Star Domination Number of Graphs. S. Akbari, A. Norouzi-Fard, A. Rezaei, R. Rotabi, S. Sabour.

Minimal Spanning Tree

Vertex-Colouring Edge-Weightings

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

Topics in Combinatorics. Dorottya Sziráki Gergő Nemes

CS 441 Discrete Mathematics for CS Lecture 26. Graphs. CS 441 Discrete mathematics for CS. Final exam

Assignment 1 Introduction to Graph Theory CO342

Packet #6: Counting & Graph Theory. Applied Discrete Mathematics

The Structure of Bull-Free Perfect Graphs

Answers to specimen paper questions. Most of the answers below go into rather more detail than is really needed. Please let me know of any mistakes.

by Troy Parkinson Color

Acyclic Edge Colouring of 2-degenerate Graphs

Module 11. Directed Graphs. Contents

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Elements of Graph Theory

Abstract. A graph G is perfect if for every induced subgraph H of G, the chromatic number of H is equal to the size of the largest clique of H.

DEFINITION OF GRAPH GRAPH THEORY GRAPHS ACCORDING TO THEIR VERTICES AND EDGES EXAMPLE GRAPHS ACCORDING TO THEIR VERTICES AND EDGES

by conservation of flow, hence the cancelation. Similarly, we have

Discrete mathematics

MAS341 Graph Theory 2015 exam solutions

Notes on Minimum Spanning Trees. Red Rule: Given a cycle containing no red edges, select a maximum uncolored edge on the cycle, and color it red.

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

1. The following graph is not Eulerian. Make it into an Eulerian graph by adding as few edges as possible.

2 hours THE UNIVERSITY OF MANCHESTER. 23 May :45 11:45

22 Elementary Graph Algorithms. There are two standard ways to represent a

2. Lecture notes on non-bipartite matching

Graph and Digraph Glossary

Math 170- Graph Theory Notes

Math 485, Graph Theory: Homework #3

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

Colouring graphs with no odd holes

Two Characterizations of Hypercubes

Simple Graph. General Graph

Lecture 10 Graph algorithms: testing graph properties

5.1 Min-Max Theorem for General Matching

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

6. Lecture notes on matroid intersection

Greedy algorithms is another useful way for solving optimization problems.

Monochromatic loose-cycle partitions in hypergraphs

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

1 Some Solution of Homework

Exercise set 2 Solutions

Graph Theory. Connectivity, Coloring, Matching. Arjun Suresh 1. 1 GATE Overflow

14 More Graphs: Euler Tours and Hamilton Cycles

COLORING EDGES AND VERTICES OF GRAPHS WITHOUT SHORT OR LONG CYCLES

Varying Applications (examples)

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

In this lecture, we ll look at applications of duality to three problems:

Symmetric Product Graphs

On 2-Subcolourings of Chordal Graphs

Basics of Graph Theory

22 Elementary Graph Algorithms. There are two standard ways to represent a

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

The strong chromatic number of a graph

λ -Harmonious Graph Colouring

Grade 7/8 Math Circles Graph Theory - Solutions October 13/14, 2015

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Transcription:

Discrete Mathematics Lent 2009 MA210 Solutions to Exercises 9 (1) There are 5 cities. The cost of building a road directly between i and j is the entry a i,j in the matrix below. An indefinite entry indicates that the road cannot be built. Determine the least cost of making all the cities reachable from each other. 0 3 5 11 9 3 0 3 9 8 5 3 0 10 11 9 0 7 9 8 10 7 0 Solution. We order the edges according to the weights: 12, 23, 13, 45, 25, 15, 24, 35, 14. Kruskal s Algorithm accepts edges 12, 23, then rejects 13, then accepts 45, 25, and then it stops. Thus, the least cost to build the road network is 3 + 3 + 7 + 8 = 21. (2) For natural numbers n and p, let G(n, p) be the complete graph with vertex set {1, 2,..., n}, and let the weight of the edge ij be given by c ij = i j mod p. (So c ij {0, 1,..., p 1}.) For every n and p, determine the minimum weight of a spanning tree in G(n, p). Solution. We must distinguish two cases: p n and p < n. When p n, we have that 1 i j < n p for every i j, 1 i, j n. From this, we obtain c ij = i j 1 for every two vertices i j of G(n, p). Since every spanning tree of G(n, p) must have n 1 edges and each edge has weight at least 1, it follows that every spanning tree of G(n, p) must have total weight at least n 1. On the other hand, the edges 12, 23,..., (n 1)n have all weight 1 and form a spanning tree of G(n, p). Hence, the minimum weight of a spanning tree of G(n, p) is n 1.

2 When p < n, we must be more careful because some edges have weight 0. Let ij be any edge of G(n, p). Then, c ij = 0 if and only if i j is divisible by p. So, when does this happen? We write n = mp + r, where 0 r < p. We notice that any edge with both endpoints in {p, 2p, 3p,..., mp} or in {1, 1+p, 1+2p,... } has weight 0. More generally, for 0 < k r, we set X k = {k, k + p, k + 2p,..., k + mp} and, for r < k p, we set X k = {k, k + p, k + 2p,..., k + (m 2)p, k + (m 1)p}. Note that c ij = 0 if and only if i, j X k for some k. We order the edges of G(n, p) in the following order: first we list all the edges with both ends X 1, then all the edges with both ends in X 2, etc., until we list all the edges with both ends X k. After this we put edges 12, 23,..., (p 1)p, all of which have weight 1. Then, we list all the remaining edges in any non-decreasing order. So, what happens when we run Kruskal s Algorithm on this order? It first accepts every edge with both endpoints in X 1 as long as it does not create a cycle. The crucial observation is that after Kruskal s Algorithm examines all the edges with both endpoints in X 1, the edges selected form a spanning tree on the vertices in X 1. In other words, Kruskal s Algorithm picked exactly X 1 1 edges (each of weight 0). The same thing remains true for the other sets X k : after Kruskal s Algorithm examines all the edges with both endpoints in X k, the edges selected form a spanning tree on the vertices in X k. Hence, Kruskal s Algorithm picked exactly X k 1 edges. So, before proceeding to edges 12, 23, etc., Kruskal s Algorith selected ( X 1 1) + ( X 2 1) +... ( X p 1) = X 1 + X 2 + + X p p = n p edges. These edges form a forest with exactly p components (one on every X k ). Now, edge 12 connects components on X 1 and X 2 to a tree on X 1 X 2. Adding the edge 23 creates a tree on X 1 X 2 X 3. Similarly, when we add the edge (k 1)k, we join two components, one on X 1 X 2 X k 1 and the other one on X k, and obtain a tree on X 1 X 2 X k. Thus, we never create a cycle. Hence, Kruskal s Algorithm accepts p 1 edges 12, 23,..., (p 1)p and then stops because it selected n 1 edges.

What is the weight of this spanning tree? The only edges with non-zero weight are 12, 23,..., (p 1)p, hence, the minimum weight of a spanning tree is p 1. each of the edges 12, 23,..., (p 1)p connects two of the components (draw a picture to see this!) (3) (a) What is the chromatic number of the complete graph K n? Solution. Every two vertices of K n are adjacent, therefore, every two vertices must have different colours in any colouring of K n. Clearly, if every vertex get a distinct coulour, we obtain a proper colouring of K n. Thus, χ(k n ) = n. (b) What is the chromatic number of the path P n? Solution. Clearly χ(p 1 ) = 1. Since P n has at least one edge for n 2, we have χ(p n ) 2. P n also has no (odd) cycles, so it is bipartite. Each partite set can be viewed as one colour class, so we have a proper colouring of P n with two colours. Hence, χ(p n ) = 2 for n > 1. (c) What is the chromatic number of the cycle C n? Solution. Since C n has at least one edge for n 3, we have χ(c n ) 2. As observed in part (b), any graph is colourable with 2 colours if and only if it is bipartite. For n even, C n has no odd cycles, so it is bipartite and χ(c n ) = 2. For n odd, C n is not bipartite, so χ(c n ) > 2. It is easy to see that if C n has vertices v 1,..., v n and edges v 1 v 2, v 2 v 3,..., v n 1 v n, v n v 1, then c(v 1 ) = c(v 3 ) = = c(v n 2 ) = 1, c(v 2 ) = c(v 4 ) = = c(v n 1 ) = 2, c(v n ) = 3 is a proper colouring of C n with 3 colours. Hence, for n odd, χ(c n ) = 3. (4) Prove or disprove: (a) Every k-chromatic graph G has a proper k-colouring in which some colour class has α(g) vertices. Solution. This is false. Let G be a graph with vertices {a, b, c, A, B, C} and edges {aa, ab, ac, ba, ca}. This graph is bipartite (why?), hence it is 2-chromatic. In every 2-colouring of G, the vertices a and A must be in different colour classes because aa is an edge. However, this force B, C to be in the same colour class as A, and b, c to be in the same colour class as a. Hence, in every 2-colouring of G, every colour class has size 3. However, {b, c, B, C} is an independent set of size 4, so α(g) > 3. 3

4 (b) For every n-vertex graph G, χ(g) n α(g) + 1. Solution. Let G = (V, E) be a graph and let X be an independent set of size α(g). We assign the same colour 1 to all the vertices of X. Each of the remaining n α(g) vertices gets a new colour. Except colour 1, all the other colour classes have size 1, i.e., they cannot contain an edge. The colour class for colour 1 is X and it contains no edge because it is an independent set. Hence, we found a proper colouring of G using n α(g) + 1 colours. This means that χ(g) n α(g) + 1. (c) For every two vertex disjoint graphs G and H, χ(g + H) = max{χ(g), χ(h)}. Here, G + H is defined as follows: Let G = (V, E) and H = (V, E ) be two graphs with disjoint vertex sets, i.e., V V = 0. The disjoint union of G and H, denoted by G + H, is the graph with vertex set V V and edge set E E. Solution. G + H contains both G and H as subgraphs. SO, every proper colouring of G + H also produces a proper colouring of G and H. Hence, χ(g + H) max{χ(g), χ(h)}. On the other hand, since χ(g), χ(h) max{χ(g), χ(h)}, we can find a proper colourings of G and H using max{χ(g), χ(h)} colours. Since there is no edge between G and H in G + H, we can combine these two colourings to a colouring of G + H. Hence, χ(g + H) max{χ(g), χ(h)}. (5) Let G be a graph. Prove that there exists some ordering of the vertices of G such that the greedy algorithm uses exactly χ(g) colours. Solution. Take any colouring of G using χ(g) colours. (We may not know how this colouring looks like, but we do know it exists!) We first list the vertices from colour class 1, then from colour class 2, etc., and the end we list the vertices from the colour class χ(g). So, we have an ordering of the vertices of G. (More precisely, we know that the ordering described above exists.) So, how will the greedy algorithm (GA from now on) colour graph G using this order? First, remember that each colour class is an independent set. So, the GA will assign colour 1 to all the vertices coming from colour class 1. (We use 1 to distinguish this colour from colour 1 used in the definition of the ordering.)

Then, the GA will assign colour 1 or 2 to all the vertices coming from the colour class 2. This is because each such vertex may have neighbours among vertices from the colour class 1 (GA coloured these by 1 ) but none coming from the colour class 2. In general, when the GA considers a vertex coming from the colour class i, it gets a colour from {1, 2,..., i } because may have neighbours among vertices from colour classes 1,..., i 1 (GA coloured these by one of {1,..., (i 1) }) but none coming from the colour class i. Hence, the GA used at most χ(g) colours 1, 2,..., χ(g). But no proper colouring of G can use less than χ(g) colours (this comes from the definition of χ(g), so the GA used exactly χ(g) colours. (6) Find the minimum distance for the following codes: (a) C 1 = {10000, 01010, 00001}; (b) C 2 = {0000, 0011, 0101, 0110, 1001, 1010, 1100, 1111}; (c) C 3 = {000000, 101010, 010101}. Suppose we want to add extra codewords to the codes above. For which of the three of them is that possible without altering the minimum distance? Solution. A quick examination yields δ(c 1 ) = 2, δ(c 2 ) = 2, δ(c 3 ) = 3. We can add 11111 to C 1 and 111000 to C 3. (Check!) If we can add any word to C 2, it must have distance at least 2 from every word of C 2. Since 0000, 1111 C 2, every such word must contain at least two 0 s and at least two 1 s. But the length of the code is 4 so if we want to enlarge C 2 without changing the minimum distance, such a word must have exactly two 0 s and exactly two 1 s. Number of such words is ( 4 2) = 6 (Why?) and we see all of them are already in C 2. (7) Prove the triangle inequality: for all x, ȳ, z {0, 1} n, 5 d H ( x, z) + d H ( z, ȳ) d H ( x, ȳ). Solution. Let x = x 1 x 2... x n, ȳ = y 1 y 2... y n, z = z 1 z 2... z n {0, 1} n be given. Let A be the set of positions at which x, z differ, that is, A = {i 1 i n, x i z i }.

6 Then, A = d H ( x, z). Similarly, we define B = {i 1 i n, z i y i }, C = {i 1 i n, x i y i }. Then, B = d H ( z, ȳ) and C = d H ( x, ȳ). We will show that C A B. Indeed, let i C, that is x i y i. If i A B, then i A and i B, so x i = z i and z i = y i. Hence, x i = z i = y i and this is not possible. Thus, i A B. Consequently, we have C A B and d H ( x, ȳ) = C A B A + B = d H ( x, z) + d H ( z, ȳ). (8) Construct a binary code C of length 6 such that C = 5 and C is 1-error-correcting. Solution. We know that C is 1-error-correcting if and only if δ(c) 2(1) + 1 = 3. So, we need to find binary code C of length 6 such that C = 5 and δ(c) 3. One such a code is C = {000000, 101010, 010101, 111100, 001111}. (Are you sure?)