Constructing Classic Graphs in Graph Theory Using Python and Generative AI: A Case Study in Computational Visualization and Prompt Engineering

Authors

  • Dr. Shanzhen Gao

  • Dr. Weizheng Gao

  • Dr. Julian D. Allagan

  • Dr. Jianning Su

  • Dr. Ephrem Eyob

Keywords:

graph theory, python programming, graph visualization, classic graphs, generative AI, prompt engineering

Abstract

This study explores the construction of several classic graphs in graph theory through Python programming, offering a hands-on computational approach to understanding their mathematical properties. The selected graphs-including the Wagner, Desargues, Herschel, Möbius-Kantor, Franklin, truncated icosahedral, and triangular grid graphs-are chosen for their historical significance and structural complexity. Using Python's turtle graphics module, each graph is visualized through trigonometric and geometric logic, illustrating core concepts such as regularity, symmetry, Hamiltonicity, and planarity. In addition to manual code development, the study integrates generative AI, specifically ChatGPT, to reproduce graph constructions via prompt engineering.

Downloads

References

K Ananiadou, M Claro (2009) 21st century skills and competences for new millennium learners in OECD countries. 41.

M Byrka, A Sushchenko, V Luchko, G Perun, V Luchko (2024) Algorithmic thinking in higher education: Determining observable measurable content. 104(6), 1-13.

J Bondy, U Murty (2007) Graph Theory with Applications. 275-276.

Roderic Page (2024) Google Knowledge Graph using data from BBC and Wikipedia.

A Soifer (2008) The mathematical coloring book. 245.

Dmitry Jakobson, Igor Rivin (1999) On some extremal problems in graph theory.

Hans Bodlaender (1998) A partial k-arboretum of graphs with bounded treewidth. 209(1-2), 1-45.

Hans Bodlaender, Dimitrios Thilikos (1999) Graphs with Branchwidth at Most Three. 32(2), 167-194.

K Wagner (1970) Graphentheorie (B.J. Hoch schul taschenbücher. 248, 61.

László Lovász (2006) Graph minor theory. 43(1), 75-86.

(2024) Desargues graph.

A Balaban, D Fǎrcaşiu, R Bǎnicǎ (1966) Graphs of multiple 1, 2-shifts in carbonium ions and related systems. 65(11), 1205.

Kurt Mislow (1970) Role of pseudorotation in the stereochemistry of nucleophilic displacement reactions. 3(10), 321-331.

Andries Brouwer, Arjeh Cohen, Arnold Neumaier (1989) Q-polynomial Distance-Regular Graphs. 235-254.

Herschel Graph (2025) In Wikipedia, the Free Encyclopedia.

C Lawson-Perfect (2013) An enneahedron for Herschel.

J Bondy, R Häggkvist (1981) Edge-disjoint Hamilton cycles in 4-regular planar graphs. 22(1), 42-45.

Meir Russ (2024) Knowledge Management for Sustainable Development in the Era of Continuously Accelerating Technological Revolutions: A Framework and Models. 13(6), 3353.

H Coxeter (1950) Self-dual configurations and regular graphs. 56(5), 413-455.

Roderic Page (2022) Google Knowledge Graph using data from BBC and Wikipedia.

Philip Franklin (1934) A Six Color Problem. 13(1-4), 363-369.

(2024) Truncated icosahedron.

E Weisstein (2025) Truncated icosahedral graph. From MathWorld-A Wolfram Web Resource.

D West (2000) Introduction to graph theory. 390-392.

E Weisstein (2025) Triangular grid graph. MathWorld-A Wolfram Web Resource.

S Gao, W Gao, J Allagan, J Su (2025) Innovative teaching in business analytics: Bridging theory, practice, and student engagement. 12.

Shanzhen Gao, Weizheng Gao, Olumide Malomo, Julian Allagan, Ephrem Eyob, Chandrasheker Challa, Jianning Su (2024) Exploring the interplay between AI and human logic in mathematical problem-solving. 12(1), 73-93.

Shanzhen Gao, Weizheng Gao (2026) Enhancing Business Education With the Knowledge Management Mesosystem Model: A Framework for Active Learning, AI Integration, and Knowledge Sharing. 231-255.

Meir Russ (2021) Knowledge Management for Sustainable Development in the Era of Continuously Accelerating Technological Revolutions: A Framework and Models. 13(6), 3353.

Ashish Garg, Ramkumar Rajendran (2024) The Impact of Structured Prompt-Driven Generative AI on Learning Data Analysis in Engineering Students. 270-277.

J Hernández, J Conde, B Querol, G Martínez, P Reviriego (2024) ChatGPT: Learning prompt engineering with 100+ examples.

Shanzhen Gao, Weizheng Gao, Julian Allagan, Jianning Su (2025) Integrating Python and Generative AI for Graph Theory Visualization and Problem-Solving. 319-336.

May Gao, Aurelia Donald (2024) Blending Computational Thinking and Creativity: Algorithmic Art with Python. 285-303.

Constructing Classic Graphs in Graph Theory Using Python and Generative AI: A Case Study in Computational Visualization and Prompt Engineering

Published

2025-09-18