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

Let $G_1=(V,E_1)$ and $G_2 =(V,E_2)$ be connected graphs on the same vertex set $V$ with more than two vertices. If $G_1 \cap G_2= (V,E_1\cap E_2)$  is not a connected graph, then the graph $G_1\cup G_2=(V,E_1\cup E_2)$

  1. cannot have a cut vertex
  2. must have a cycle
  3. must have a cut-edge (bridge)
  4. has chromatic number strictly greater than those of $G_1$ and $G_2$
asked in Algorithms by Veteran (59.7k points)
edited by | 2.4k views
Refere This question, if you are not able to interpret this image.
yes it is good link
I am not getting what he is trying to say. Can you explain a bit?

This explains it in a simple way.....

G1∩G2=(V,E1∩E2)  is not a connected graph,

wht does it mean

Why we are not taking directed graph here? Will there also be a cycle then?

8 Answers

+27 votes
Best answer

There are two connected graphs $G_1$ and $G_2$, with same vertices. In least case, both graphs will have $n-1$ edges with $n$ vertices as both the given graphs are connected.
When we UNION both the graphs as $G= G_1 \cup G_2$  then $G$ will be having at most $(2n-2)$ edges in the best case when both the graphs don't have any common edges between them (or) at least more than $n-1$ edges if they have few common edges between them as the intersection of these two graphs is not connected.
Suppose if both the graphs $G1$ and $G2$ have exactly the same edges then their intersection will be a connected graph.

A graph with $n$ vertices and more than $n-1$ edges will definitely have a cycle.

Hence (B) is the correct option.

answered by Boss (17.2k points)
edited by
How G1 union G1 will have 2n-2 edges i?there are some common edges between them right?

If in G1 has n-1 edges, and G2 has n-1 edges (both are connected)

then their intersection will have max n-2 edges to be disconnected.

so G1 union G2 will have (2n-2)-(n-2)=n edges, so the cycle is definitely present there.

If G1 and G2 had some edges common then their intersection would surely have been connected. But it is given it is not connected.
@Ayush. No its not necessary.
can someone give me any counter example for D?

counterexample for (D)

+29 votes

Take a tree for example 


  1. False. Every vertex of tree(other than leaves) is a cut vertex.
  2. True.
  3. False. Without E in $G1$ and $G2$, $G1 U G2$  has no bridge.
  4. False. $G1 U G2$, $G1$, $G2$ three graphs have same chromatic number of $2$. 
answered by Veteran (103k points)
edited by

G1 and G2 are connected graph. As G1 $\cap$ G2 is disconnected graph, there must exist two vertices say V1 and V2 such that there is no path between them in G1 $\cap$ G2.

But as G1 is connected graph it must have some path P1 between vertices V1 and V2. Similarly, G2 must have some path P2 between V1 and V2.

Now, these P1 and P2 are not the same paths, if they are they will be present in G1 $\cap$ G2, which will contradict with our assumption.

In G1 $\cup$ G2, we have two paths P1 and P2 to between V1 and V2. That form the cycle. See the image.

@srestha but G1 intersection G2 is connected but should be not connected as specified in question.

Correct me if m wrong.

See the node D, if you try to take intersection of G1 and G2, D will be disconnected as the path is not common in G1 and G2.
+16 votes

Say G1 is Black colored graph, and G2 is red colored graph.
In this figure i overlapped both graphs, to see them together.

Given that $G_1 \cap G_2 $ is Disconnected, To make it happen G1 and G2 has to meet somewhere and then leave at some point, Once they leave each other and then have to meet somewhere again to have atleast two different disconnected component.
Now it is clear that this will form a cycle (See image has cycle.)

Note: If  $G_1 \cap G_2 $ need not to be disconnected then $G_1\cup G_2 $ need not to have a cycle.

(in this case when one of the Graph has cycles then only $G_1\cup G_2$ can have cycle.)

answered by Boss (16.7k points)
+3 votes
A very simple reasoning in this question may fetch the answer very fast. Since the two graphs G1 and G2 are connected, there will be path from a vertex to every other vertex in  both G1 and G2 but since G1 ∩ G2 is not connected , at least for one vertex pair v1,v2 the connecting paths must be different in both G1 and G2. Hence G1 union G2 will definitely have a cycle.
answered by Boss (15.3k points)
+2 votes
Question is indirectly saying in $G_1$ U $G_2$ we have edge disjoin path between some vertices because  $G_1$ ∩  $G_2$ is disconnected (means at least two vertices could reach each other via edge disjoint path ). So option (B) is True in all the cases.
answered by Boss (11.8k points)
+2 votes

There would be "at least " one cycle there in G1 Union G2

answered by Loyal (8.2k points)
+1 vote
As G1 and G2 are connected, let us say one vertex is V,now there is a way from V to all other vertices in both G1 and G2,but as their intersection  is disconnected,means there are some edges which are in G1 but not in G2 and vice versa.Or we can say there is atleast one from V to V' which is different in both G1 and G2 because if for all vertices it is same path from V to all other vertices then it will not give disconnected graph as intersection.

Now whn union will be done then their will be two paths from V to V' (one of G and other of G1) and then it will form a cycle.
answered by Boss (25.8k points)
–1 vote
Ans B
answered by Boss (13.5k points)

Related questions

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

44,255 questions
49,747 answers
65,843 users