Student writes program to solve LinkedIn’s 8 Queens puzzle
July 21, 2025
Computer Science student Sindhuja Tamang was inspired to write a program after a graph theory lesson in her math class about the 8 Queens puzzle on LinkedIn.
According to Justin Schroeder, assistant professor of mathematics, graph theory originated from the famous Seven Bridges of Königsberg problem. The Seven Bridges of Königsberg asked whether it’s possible to cross all seven bridges of Königsberg only once. Mathematician Leonhard Euler proved it was impossible, which laid the foundation for graph theory.
Graph theory is a branch of mathematics that studies relationships between objects using graphs.
“The puzzle of placing queens on a chessboard actually led to the study of dominating sets in my classroom,” Schroeder said. “Highlighting these puzzles helps make the abstract concepts come to life in a very concrete way.
Tamang has always enjoyed problem-solving activities, such as puzzles and games. “As I started learning graph theory and search algorithms in classes like discrete math and intro to AI, I noticed how much they overlapped with the kinds of logic puzzles I already enjoyed,” she said. “That connection made me want to take what we were learning and see what it could do when put into practice.”
The 8 Queens puzzle has long held Tamang’s interest, and she regularly solves it on LinkedIn’s daily puzzle posts to start her day.
Writing code for a program to solve a puzzle requires a lot of trial and error, which she finds easiest to deal with by breaking the problem down into tiny pieces, working on one section at a time until it works. She also recommends celebrating tiny wins to stay positive.
“Writing the code made everything click way more than just hearing about it in class,” Tamang said. “Watching the algorithm play out—where it worked, where it didn’t—helped me really get what was going on. It stopped feeling like just a theory and started feeling real.”
Schroeder agrees, noting, “There’s something about doing a project extending beyond the normal classroom boundaries—especially at the student’s initiative—that helps the material sink much deeper into your mind than it does with the regular routine of lectures, homework, and exams.”
It’s also a chance for students to explore other areas of math that aren’t a part of the curriculum.
“The world of mathematics is huge; we barely scratch the surface of it in class, so extracurricular projects help expose students to topics that they won’t find in a textbook,” Schroeder said.