Connected Graph

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom ConnectedGraph

A connected graph is graph that is connected in the sense of a topological space, i.e., there is a path from any point to any other point in the graph. A graph that is not connected is said to be disconnected. This definition means that the null graph and singleton graph are considered connected, while empty graphs on n>=2 nodes are disconnected.

According to West (2001, p. 150), the singleton graph K_1, "is annoyingly inconsistent" since it is connected (specifically, 1-connected), but for consistency in discussing connectivity, it is considered to have vertex connectivity kappa(K_1)=0.

If A is the adjacency matrix of a simple graph G, then entry (i,j) of A^k is the number of k-walks from vertex i to vertex j. As a result, a graph on n>1 nodes is connected iff

 sum_(k=1)^(n-1)A^k

has no matrix element equal to zero.

A connected graph on n>1 nodes satisfies

 sum_(i=1)^nrho(v_i)>=1/2(n-1),

where rho(v_i) is the vertex degree of vertex i (and where the inequality can be made strict except in the case of the singleton graph K_1). However while this condition is necessary for a graph to be connected, it is not sufficient; an arbitrary graph satisfying the above inequality may be connected or disconnected.

The number of n-node connected unlabeled graphs for n=1, 2, ... are 1, 1, 2, 6, 21, 112, 853, 11117, 261080, ... (OEIS A001349). The total number of (not necessarily connected) unlabeled n-node graphs is given by the Euler transform of the preceding sequence, 1, 2, 4, 11, 34, 156, 1044, 12346, ... (OEIS A000088; Sloane and Plouffe 1995, p. 20). Furthermore, in general, if a_n is the number of unlabeled connected graphs on n nodes satisfying some property, then the Euler transform b_n is the total number of unlabeled graphs (connected or not) with the same property. This application of the Euler transform is called Riddell's formula.

The numbers of connected labeled graphs on n-nodes are 1, 1, 4, 38, 728, 26704, ... (OEIS A001187), and the total number of (not necessarily connected) labeled n-node graphs is given by the exponential transform of the preceding sequence: 1, 2, 8, 64, 1024, 32768, ... (OEIS A006125; Sloane and Plouffe 1995, p. 19).

An efficient enumeration of connected graphs on n nodes can be done using the program geng (part of nauty) by B. McKay using the syntax geng -c n. However, since the order in which graphs are returned by the geng program changes as a function of time as improvements are made, the canonical ordering given on McKay's website is used here and in GraphData.

A graph may be tested in the Wolfram Language to see if it is a connected graph using ConnectedGraphQ[g].

If G is disconnected, then its complement G^_ is connected (Skiena 1990, p. 171; Bollobás 1998). However, the converse is not true, as can be seen using the example of the cycle graph C_5 which is connected and isomorphic to its complement.

kConnectedGraph2kConnectedGraph3

One can also speak of k-connected graphs (i.e., graphs with vertex connectivity k) in which each vertex has degree at least k (i.e., the minimum of the degree sequence is >=k). 1-connected graphs are therefore connected with minimal degree >=1.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.