Question: Consider the following algorithm that takes as input a graph G = (V, E) and returns a colouring f that uses numbers as colours: 1.
Consider the following algorithm that takes as input a graph G = (V, E) and returns a colouring f that uses numbers as colours: 1. Pick any vertex v V . Colour it colour 1 (i.e. define f(v) := 1.) 2. Pick any uncoloured vertex w V . Colour it with the lowest-numbered colour that is not used by any of its neighbours (i.e. define f(w) :=min colour not used by any u nbr(w).) Use a new colourthe smallest unused natural numberas necessary. 3. Repeat step 2 until all vertices are assigned a colour/number. We will use this algorithm as a basis for the problems below.Prove that the algorithm does not always produce a colouring with (G) colours (in algorithms parlance, that this algorithm is not optimal). Do this by providing a small ( 6 nodes) (counter-)example G for which the algorithm uses > (G) colours. Be sure to: clearly define a concrete G (if it has more than 5 edges then please draw it. You may include a photo of hand-drawn graphs in your solutions), show the steps the algorithm would take on your example, along with the colouring that is produced, and what the optimal colouring is (i.e. what (G) is, which should be less than what the algorithm found.) c.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
