# Can an undirected graph be disconnected?

This may be a rather trivial question but I am still trying to get the hang of all the graph theory terms. Nonetheless, I haven't found a source that explicitly says that an undirected graph can only be connected so is it possible to have an undirected graph that is disconnected? And if so, may I have an example one?

Much thanks!

• if they are made of separate pieces. – hbm Dec 4 '18 at 23:30
• Here's an example of (the diagram of) a disconnected undirected graph: $$\huge ○\,\,\,\, ○$$ – Git Gud Dec 4 '18 at 23:30

Undirected just mean The edges does not have direction. connected means that there is a path from any vertex of the graph to any other vertex in the graph. so take any disconnected graph whose edges are not directed to give an example. following is one:

Yes. The simplest such graph is just two vertices (no edges).

The definition of graph that I know is the following: A graph consists of two sets $$(V,E)$$ where $$V$$ is the set of vertices and $$E$$ is the set of edges.

The elements of $$E$$ are subsets (or multisets in the case of loops) of cardinality $$2$$ of $$V$$.

A graph is undirected if $$\{x,y\}=\{y,x\}$$ where $$\{x,y\},\{y,x\}\in E$$ and it is directed if $$\{x,y\}\neq \{y,x\}$$.

Therefore, by taking $$V=\{a,b,c\}$$ and $$E=\{\{a,b\}\}$$, you obtain a disconnected undirected graph.

I believe, since you can define a graph $$G = (E,V)$$ by its edge and vertex sets, it is perfectly ok to have a disconnected graph (i.e. a graph with no path between some vertices). In fact, taking $$E$$ to be empty still results in a graph.