A molecular graph, also called a chemical graph, is a graph representing the connectivity of a molecule, with vertices corresponding to atoms and edges corresponding to chemical bonds. Labels on the vertices specify atom types, while labels on the edges specify bond types or orders (IUPAC 2025b). A double or triple bond can thus be represented by a single graph edge carrying the appropriate bond label.
Two representations describe the same labeled connectivity when a graph isomorphism between them preserves the atom and bond labels as well as the adjacency relation. The connectivity alone does not specify bond lengths, bond angles, or the positions of atoms in three-dimensional space. Additional geometric information is needed to specify a spatial molecular structure (IUPAC 2025a).
Hydrogen atoms may be included explicitly or omitted to obtain a hydrogen-suppressed representation. In particular, omitting hydrogen atoms from an alkane
graph leaves a tree of carbon atoms with maximum vertex degree at most 4. For example, butane and isobutane
both have composition ,
but their hydrogen-suppressed representations are the path
graph
and the star graph
, respectively. These graphs
are not isomorphic.
Topological indices, such as the Wiener index and the molecular topological
index, provide numerical descriptors of molecular connectivity. The choice of
whether to include hydrogen atoms must be specified when comparing their values.
For the hydrogen-suppressed butane and isobutane representations, the Wiener
index values are
and
,
respectively.
The Wolfram Language represents molecules using Molecule[...], and their connectivity graphs can be obtained using MoleculeGraph[mol]. The latter includes all hydrogen atoms by default. The call MoleculeGraph[mol, IncludeHydrogens -> None] produces the hydrogen-suppressed representation.