In this project, we aim to model organic chemical reactions as a graph theory problem. Consider a graph where the vertices are organic molecules and the edges are alkene reactions used to transform one organic molecule to another. Six alkene reactions are considered: hydrohalogenation, dihalogenation, halohydrination, hydration, hydrogenation, and dihydroxylation. The objective is to find the shortest path needed to transform one organic molecule to another. If one can find such a synthetic pathway, a potential series of optimal alkene reactions can be achieved.

Introduction

Classes of reactions are a critical element of organic chemistry. In order for new organic molecules to be formed, alkene reactions must be applied on organic molecules. Although there are many alkene reactions studied in the field of organic chemistry, this research project specifically considers six alkene reactions. The mechanisms of all six alkene reactions are first explained and implemented. Then, a graph model of the alkene reactions of organic molecules is created and used to solve a shortest path problem. The graph models also gives us the opportunity to discover all the potential molecules that can be formed by starting from a single organic molecule and iteratively applying all the PatternReaction of interest.

Pattern Reactions

We will use the PatternReaction function to implement all six alkene reactions of consideration. Specifically, we apply the pattern reactions to alkenes as this is the standard organic molecule to first consider in the study of organic chemistry.

Hydrohalogenation

Before considering the general hydrohalogenation alkene reaction, first consider the hydrochlorination of alkenes.
​
​A carbon-carbon double bond functional group is given by:
In[]:=
patternAlkene=MoleculePattern[{"C","C"},{Bond[{1,2},"Double"]}]
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1

An ethylene molecule is given by:
In[]:=
moleculeEthylene=Molecule[{"C","C"},{Bond[{1,2},"Double"]}]
Out[]=
Molecule
Formula:
C
2
H
4
Atoms:
6
Bonds:
5

During hydrochlorination, the reactants are an alkene molecule and a molecule of hydrogen chloride. As the molecules interact with one another, the hydrogen atom bonds to one of the carbon atoms in the double bond and the chlorine atom bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a chlorine atom bonded to one of the carbon atoms in the original alkene molecule.
​
​A hydrogen chloride moiety is given by:
In[]:=
patternHCl=MoleculePattern[{"H","Cl"},{Bond[{1,2},"Single"]}]
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1

A chlorinated alkane moiety is given by:
In[]:=
patternChloroAlkane=MoleculePattern[{"C","C","Cl","H"},{Bond[{1,2},"Single"],Bond[{1,3},"Single"],Bond[{2,4},"Single"]}]
Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The reactant and product list of patterns are given by:
In[]:=
chloroReactants={patternAlkene,patternHCl}​​chloroProducts={patternChloroAlkane}
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1
,MoleculePattern
Atoms: 2
Bonds: 1

Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The atom mapping is given by:
In[]:=
atomMappingHydrochlorination={​​{1,1}->{1,1},​​{1,2}->{1,2},​​{2,1}->{1,4},​​{2,2}->{1,3}​​}
Out[]=
{{1,1}{1,1},{1,2}{1,2},{2,1}{1,4},{2,2}{1,3}}
The hydrochlorination reaction is given by:
In[]:=
hydrochlorination=PatternReaction[chloroReactants->chloroProducts,atomMappingHydrochlorination]
Out[]=
Hydrogen chloride is given by:
In[]:=
molHCl=Molecule
hydrogen chloride
CHEMICAL

Out[]=
Molecule
Formula: ClH
Atoms: 2 Bonds: 1

Applying hydrochlorination to ethylene, all the possible products are given by:
In[]:=
ApplyReaction[hydrochlorination,{moleculeEthylene,molHCl},All]
Out[]=
Molecule
Formula:
C
2
H
5
Cl
Atoms: 8 Bonds: 7

For the general hydrohalogenation pattern reaction, we can consider other hydrogen halides such as hydrogen bromide and hydrogen iodide.
We can construct a general hydrohalogenation pattern reaction by considering the general reactants and product as follows:
In[]:=
patternHX=MoleculePattern[{"H",Alternatives["Cl","Br","I"]},{Bond[{1,2},"Single"]}]​​patternHalogenatedAlkane=MoleculePattern[{"C","C",Alternatives["Cl","Br","I"],"H"},{Bond[{1,2},"Single"],Bond[{1,3},"Single"],Bond[{2,4},"Single"]}]
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1

Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The reactant and product list of patterns are given by:
In[]:=
halogenReactants={patternAlkene,patternHX}​​halogenProducts={patternHalogenatedAlkane}
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1
,MoleculePattern
Atoms: 2
Bonds: 1

Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The general hydrohalogenation pattern reaction (noting that that atom mapping for the general pattern reaction is the same as the one used for hydrochlorination) is given by:
In[]:=
hydrohalogenation=PatternReaction[halogenReactants->halogenProducts,atomMappingHydrochlorination]
Out[]=

Dihalogenation

Before considering the general dihalogenation alkene reaction, first consider the dichlorination of alkenes.
​
During dichlorination, the reactants are an alkene molecule and a molecule of chlorine gas. As the molecules interact with one another, the chlorine atom bonds to one of the carbon atoms in the double bond and the chlorine atom bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a chlorine atom bonded to one of the carbon atoms and a chlorine atom bonded to the other carbon atom in the original alkene molecule.
A chlorine moiety is given by:
In[]:=
patternCl2=MoleculePattern[{"Cl","Cl"},{Bond[{1,2},"Single"]}]
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1

A dichlorinated alkane moiety is given by:
In[]:=
patternDichlorinatedAlkane=MoleculePattern[{"C","C","Cl","Cl"},{Bond[{1,2},"Single"],Bond[{1,3},"Single"],Bond[{2,4},"Single"]}]
Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The reactant and list of patterns are given by:
In[]:=
dichloroReactants={patternAlkene,patternCl2}​​dichloroProducts={patternDichlorinatedAlkane}
Out[]=
MoleculePattern
Atoms: 2
Bonds: 1
,MoleculePattern
Atoms: 2
Bonds: 1

Out[]=
MoleculePattern
Atoms: 4
Bonds: 3

The atom mapping is given by:
In[]:=
atomMappingDichlorination={​​{1,1}->{1,1},​​{1,2}->{1,2},​​{2,1}->{1,4},​​{2,2}->{1,3}​​}
Out[]=
{{1,1}{1,1},{1,2}{1,2},{2,1}{1,4},{2,2}{1,3}}
The dichlorination reaction is given by:
In[]:=
dichlorination=PatternReaction[dichloroReactants->dichloroProducts,atomMappingDichlorination]
Out[]=
Chlorine gas is given by:
Applying dichlorination to ethylene, all the possible products are given by:
For the general dihalogenation pattern reaction, we can consider other halogen gases such as bromine gas and iodine gas.
Construct dihalogen pattern:
Construct a general dihalogenation pattern reaction as follows:
The reactant and product list of patterns are given by:
With the current state of apply reaction, it’s possible for the two halogens in the dihalogen molecule to not be the same. In order to correct this, we build a modified apply reaction function to ensure that both of the halogens in the dihalogen molecule are the same:
Construct the dihalogenQ function as follows:
The general dihalogenation pattern reaction (noting that that atom mapping for the general pattern reaction is the same as the one used for dichlorination) is given by:

Halohydrination

Before considering the general halohydrination alkene reaction, first consider the chlorohydrination of alkenes.
​
During chlorohydrination, the reactants are given by an alkene molecule and a molecule of hypochlorous acid. As the molecules interact with one another, the alcohol group bonds to one of the carbon atoms in the double bond and the chlorine atom bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a chlorine atom bonded to one of the carbon atoms and an alcohol group bonded to the other carbon atom in the original alkene molecule.
A hypochlorous acid moiety is given by:
A chlorohydrinated alkane moiety is given by:
The reactants and list of patterns are given by:
The atom mapping is given by:
The chlorohydrination reaction is given by:
Hypochlorous acid is given by:
Applying chlorohydrination to ethylene, all the possible products are given by:
For the general halohydrination pattern reaction, we can consider other hypohalous acids such as hypobromous and hypoiodous acid.
Construct a general dihalogenation pattern reaction:
The reactant and product list of reactants are given by:
The general halohydrination pattern reaction (noting that that atom mapping for the general pattern reaction is the same as the one used for chlorohydrination) is given by:

Hydration

During hydration, the reactants are an alkene molecule and a molecule of water. As the molecules interact with one another, the alcohol group bonds to one of the carbon atoms in the double bond and the hydrogen atom bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a hydrogen atom bonded to one of the carbon atoms and an alcohol group bonded to the other carbon atom in the original alkene molecule.
A water moiety is given by:
A hydrated moiety is given by:
The reactant and list of patterns are given by:
The atom mapping is given by:
The hydration reaction is given by:
Water is given by:
Applying hydration to ethylene, all the possible products are given by:

Hydrogenation

During hydrogenation, the reactants are an alkene molecule and a molecule of hydrogen gas. As the molecules interact with one another, one hydrogen bonds to one of the carbon atoms in the double bond and the other hydrogen atom bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a hydrogen atom bonded to one of the carbon atoms and a hydrogen bonded to the other carbon atom in the original alkene molecule.
A hydrogen gas moiety is given by:
A hydrogenated alkane is given by:
The reactant and list of patterns are given by:
The atom mapping is given by:
The hydrogenation reaction is given by:

Dihydroxylation

During dihydroxylation, the reactants are an alkene molecule and a molecule of hydrogen peroxide. As the molecules interact with one another, one hydroxyl group to one of the carbon atoms in the double bond and the other hydroxyl group bonds to the other carbon atom. The product is an alkane molecule containing a carbon-carbon single bond with a hydroxyl group bonded to one of the carbon atoms and the other hydroxyl group bonded to the other carbon atom in the original alkene molecule.
A hydrogen peroxide moiety is given by:
A dihydroxylated alkane moiety is given by:
The reactants and list of patterns are given by:
The atom mapping is given by:
The dihydroxylation reaction is given by:
Considering the six implemented pattern reactions, a reaction function is created for each. 1,4-Hexadiene is used as a reactant to test all the reaction function:
The hydrohalogenation reaction function is constructed as:
Applying the hydrohalogenation reaction function to 1,4-Hexadiene:
The halogenation reaction function is constructed as:
Applying the halogenation reaction function to 1,4-Hexadiene:
The halohydrination reaction function is constructed as:
Applying the halohydrination reaction function to 1,4-Hexadiene:
The hydration reaction function is constructed as:
Applying the hydration reaction function to 1,4-Hexadiene:
The hydrogenation function is constructed as:
Applying the hydrogenation reaction function to 1,4-Hexadiene:
The dihydroxylation reaction function is constructed as:
Applying the dihydroxylation reaction function to 1,4-Hexadiene:

Synthetic Pathways

Consider a graph where the vertices represent organic molecules and the edges represent pattern reactions. Applying the six implemented pattern reactions on a start organic functional molecule to output all possible products inspires a graph theory problem. We now make use of the implemented pattern reaction functions to generate a graph model of reactivity in organic chemistry and solve a shortest path problem to find optimal synthetic pathways.
We use 1,3,6-octatriene as the molecule of choice to visualize and solve the shortest path problem:
Define GraphView to generate the product graph:
Generate the product for 1,3,6-octatriene:
Visualize that in three dimensions:
Starting from one single organic molecule, the optimal path needed to transform the molecule into a different organic molecule can be found as:

Conclusion

The six alkene reactions of interest were implemented and shown to output products. Furthermore, the alkene reactions of organic molecules were translated into a graph theory problem. Specifically, the aim was to solve the shortest path problem in graph theory in order to find an optimal synthetic pathway to transform one organic molecule into another. Our results ultimately show that we were able to generate a graph model of the alkene reactions of interest (from both a two and three dimensional visualization perspective) and find optimal synthetic pathways.

Acknowledgement

Although there are many people who have contributed to the success of my research project, I would like to express my gratitude in particular to my mentor Jason Sonnenberg and teaching assistant Joseph Stocke. My research project involved extensive knowledge in both organic chemistry and graph theory. Both Jason and Joseph where able to give me ideas (from both the organic chemistry and graph theory viewpoints) to ultimately shape the outcome of my research project. The results from my research project wouldn’t have been successful without the help from Jason and Joseph among other peers, mentors, and teaching assistants that guided me throughout my research.

References

◼
  • [1] “Mathematica & Wolfram Language Fast Introduction for Chemistry Students.” Wolfram Alpha Chemistry Team, www.wolframcloud.com/obj/WolframChemistryTeam/Published/FastIntro/FastIntro.nb. Accessed 13 July 2023.
  • ◼
  • [2] “Organic Chemistry: A Tenth Edition” OpenStax, openstax.org/details/books/organic-chemistry. Accessed 13 July 2023.
  • CITE THIS NOTEBOOK

    Mapping reactivity in organic chemistry​
    by Alexander Do​
    Wolfram Community, STAFF PICKS, July 13, 2023
    ​https://community.wolfram.com/groups/-/m/t/2964446