Solving the ‘8-puzzle’ using a basic AI algorithm

📰 Medium · Machine Learning

Learn to solve the 8-puzzle problem using a basic AI algorithm and understand the rules of the puzzle and heuristic search techniques.

intermediate Published 1 May 2026
Action Steps
  1. Define the 8-puzzle problem and its rules
  2. Understand the concept of heuristic search and its types (informed and uninformed)
  3. Implement a basic AI algorithm to solve the 8-puzzle problem using heuristic search
  4. Evaluate the performance of the algorithm and optimize it if necessary
  5. Apply the learned concepts to other problem-solving scenarios
Who Needs to Know This

This lesson is beneficial for machine learning engineers, AI researchers, and software developers who want to understand the basics of AI algorithms and problem-solving techniques.

Key Insight

💡 Heuristic search is a powerful technique for solving complex problems, and understanding its basics is essential for building efficient AI algorithms.

Share This
Solve the 8-puzzle problem using a basic AI algorithm! Learn about heuristic search and its applications in AI. #AI #MachineLearning #ProblemSolving

Key Takeaways

Learn to solve the 8-puzzle problem using a basic AI algorithm and understand the rules of the puzzle and heuristic search techniques.

Full Article

Title: Solving the ‘8-puzzle’ using a basic AI algorithm

URL Source: https://medium.com/@grigalashvili.r1999/solving-the-8-puzzle-using-a-basic-ai-algorithm-94eb3cb3826a?source=rss------machine_learning-5

Published Time: 2026-05-01T12:45:00Z

Markdown Content:
# Solving the ‘8-puzzle’ using a basic AI algorithm | by Roma Grigalashvili | May, 2026 | Medium

[Sitemap](https://medium.com/sitemap/sitemap.xml)

[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40grigalashvili.r1999%2Fsolving-the-8-puzzle-using-a-basic-ai-algorithm-94eb3cb3826a&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)

Get app

[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)

[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40grigalashvili.r1999%2Fsolving-the-8-puzzle-using-a-basic-ai-algorithm-94eb3cb3826a&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

![Image 1](https://miro.medium.com/v2/resize:fill:32:32/1*dmbNkD5D-u45r44go_cf0g.png)

# Solving the ‘8-puzzle’ using a basic AI algorithm

[![Image 2: Roma Grigalashvili](https://miro.medium.com/v2/resize:fill:32:32/1*lgthpUh7tp-jKJ6oRnb1EA.jpeg)](https://medium.com/@grigalashvili.r1999?source=post_page---byline--94eb3cb3826a---------------------------------------)

[Roma Grigalashvili](https://medium.com/@grigalashvili.r1999?source=post_page---byline--94eb3cb3826a---------------------------------------)

Follow

8 min read

·

Just now

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2F94eb3cb3826a&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40grigalashvili.r1999%2Fsolving-the-8-puzzle-using-a-basic-ai-algorithm-94eb3cb3826a&user=Roma+Grigalashvili&userId=307366939ab7&source=---header_actions--94eb3cb3826a---------------------clap_footer------------------)

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2F94eb3cb3826a&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40grigalashvili.r1999%2Fsolving-the-8-puzzle-using-a-basic-ai-algorithm-94eb3cb3826a&source=---header_actions--94eb3cb3826a---------------------bookmark_footer------------------)

Share

**რას გულისხმობს “8-puzzle” პრობლემა.**

საწყის მდგომარეობაში(Initial State) მყოფი ფილები შეიძლება გადაადგილდეს ცარიელ სივრცეში კონკრეტული თანმიმდევრობით და ამით მიაღწიოს მიზნის მდგომარეობას(Goal State).

![Image 3](https://miro.medium.com/v2/1*SZzolLb25W9jrdN_Sjp9Yg.png)

### “8-puzzle” ამოხსნის წესები.

ცარიელ სივრცეში ფილების გადაადგილების ნაცვლად, ჩვენ შეგვიძლია ვიზუალურად წარმოვიდგინოთ ცარიელი სივრცის გადაადგილება შევსებული ფილის ადგილზე. ცარიელ სივრცეს შეუძლია გადაადგილება მხოლოდ ოთხი მიმართულებით, ანუ,

* **_ზევით_**
* **_ქვემოთ_**
* **_მარჯვნივ ან_**
* **_მარცხნივ_**

ცარიელი სივრცე ვერ მოძრაობს დიაგონალურად და შეუძლია გადადგას მხოლოდ ერთი ნაბიჯი (ანუ ცარიელი სივრცის გადაადგილება თითო პოზიციაზე).

![Image 4](https://miro.medium.com/v2/1*f_fzPB5InNDwdPloGKY6fw.png)

**განვიხილოთ ევრისტიკული ძიება.**

ძირითადად, არსებობს ორი სახის ძიების ტექნიკა:

* **არაინფორმირებული ძიება**
* **ინფორმირებული ძიება**

შესაძლოა გსმენიათ წრფივი ძებნის, ორობითი ძებნის, სიღრმეში ძიების ან სიგანეში პირველი ძიების შესახებ. ეს ძიების ალგორითმები მიეკუთვნება **არაინფორმირებული ძიების** ტექნიკის კატეგორიას, ანუ ამ ალგორითმებმა არაფერი იციან იმის შესახებ,
Read full article → ← Back to Reads