# Its about formula recatants

**URL:** <https://forum.graphviz.org/t/its-about-formula-recatants/1845>\
**Category:** Uncategorized\
**Created:** [October 27, 2023, 2:30am UTC](https://forum.graphviz.org/t/its-about-formula-recatants/1845 "2023-10-27T02:30:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BEBO123](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@BEBO123](https://forum.graphviz.org/u/BEBO123)\
**Post date:** [October 27, 2023, 2:30am UTC](https://forum.graphviz.org/t/its-about-formula-recatants/1845/1 "2023-10-27T02:30:52Z")

</div>

import graphviz

# Create a Digraph object

dot = graphviz.Digraph(format=‘png’)

# Define the flowchart

dot.node(‘Start’, ‘Start’)  
dot.node(‘Reactants’, ‘What are the reactants?’)  
dot.node(‘Choice1’, ‘Choice 1’)  
dot.node(‘Synthesis’, ‘Synthesis’)  
dot.node(‘Choice2’, ‘Choice 2’)  
dot.node(‘Decomposition’, ‘Decomposition’)  
dot.node(‘Choice3’, ‘Choice 3’)  
dot.node(‘Combustion’, ‘Combustion’)  
dot.node(‘SingleDisplacement’, ‘Single Displacement’)  
dot.node(‘Choice4’, ‘Choice 4’)  
dot.node(‘DoubleDisplacement’, ‘Double Displacement’)  
dot.node(‘Choice5’, ‘Choice 5’)  
dot.node(‘Neutralization’, ‘Neutralization’)  
dot.node(‘Other’, ‘Other’)  
dot.node(‘End’, ‘End’)

# Define the edges

dot.edges([  
(‘Start’, ‘Reactants’),  
(‘Reactants’, ‘Choice1’),  
(‘Choice1’, ‘Synthesis’),  
(‘Choice1’, ‘Choice2’),  
(‘Choice2’, ‘Decomposition’),  
(‘Choice2’, ‘Choice3’),  
(‘Choice3’, ‘Combustion’),  
(‘Choice3’, ‘Choice4’),  
(‘Choice4’, ‘SingleDisplacement’),  
(‘Choice4’, ‘Choice5’),  
(‘Choice5’, ‘DoubleDisplacement’),  
(‘Choice5’, ‘Neutralization’),  
(‘Synthesis’, ‘End’),  
(‘Decomposition’, ‘End’),  
(‘Combustion’, ‘End’),  
(‘SingleDisplacement’, ‘End’),  
(‘DoubleDisplacement’, ‘End’),  
(‘Neutralization’, ‘End’),  
(‘Other’, ‘End’)  
])

# Render the flowchart as an image

dot.render(‘chemical\_reactions\_flowchart’, view=True)
