The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+16 votes

Consider the undirected graph $G$ defined as follows. The vertices of $G$ are bit strings of length $n$. We have an edge between vertex $u$ and vertex $v$ if and only if $u$ and $v$ differ in exactly one bit position (in other words, $v$ can be obtained from $u$ by flipping a single bit). The ratio of the chromatic number of $G$ to the diameter of $G$ is

  1. 1/(2n-1)
  2. 1/n
  3. 2/n
  4. 3/n
asked in Graph Theory by Veteran (21.5k points) | 1.1k views

After reading this question words "Gray code", "Hypercube graph", "Haming Distance" and "Even length cycles"  are  coming in mind.


Now if you are thinking why Hypercube graph has chromatic no = 2  or Even length cycle then refer -->


Chromatic number is 2 so maximum independent set size is $2^{n-1}$.

how u calculate diameter of graph?

The diameter of a graph is the length of the shortest path between the most distanced nodes

3 Answers

+15 votes
Best answer

Answer is (C)

For the given condition we can simply design a K-MAP and mark an edge between every two adjacent cells in K-Map.(adjacency has to seen just as we do for minimization )

That will give us a Bipartite graph. chromatic number for this =2

Also from the same we can conclude that we need ,for a 'n' bit string, to traverse NO MORE than (n-1) edges or 'n' vertices to get a path b/w two arbitrary points.

So ratio is 2/n.

The given graph is actually hypercubegraph.

See problem 4 here:

answered by Boss (7.4k points)
edited by

for traversing from 000. . .0   ⟶  111. . .1   , we require to traverse atleast 'n' edges.

How to find diameyer of the graph ?
Diameter is shortest path of maximum lenght  in between any two vertices of a graph. maximum lenght can occure between any two vertices. for this we can do it by intution or by applying all pair shotest path algorithm(floyed warshall)

To find the diameter of a graph, first find the shortest path between each pair of vertices. The greatest length of any of these paths is the diameter of the graph.

+5 votes
answered by Veteran (23.2k points)
+3 votes
answer C
answered by Veteran (13.7k points)

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,017 questions
36,844 answers
34,721 users