Code Monkey home page Code Monkey logo

tucil03-13520079's Introduction


15-PUZZLE SOLVER

Program untuk Memecahkan 15-Puzzle dengan Menggunakan Algoritma Branch and Bound
Telusuri Dokumen>>

Table of Contents
  1. Tentang Projek
  2. Penggunaan
  3. Author

Tentang Projek

Program ini merupakan program pencarian solusi pada Permainan 15-Puzzle dengan pengaplikasian algoritma Branch and Bound. Aplikasi disediakan dalam bentuk Graphical User Interface dan Command Line Interface. GUI dibuat dengan menggunakan tools Qt Designer dan PyQt5

Algoritma Branch and Bound

  1. Sediakan list notVisited dan list visited.

  2. Input suatu Puzzle dan dijadikan sebagai root Puzzle. Masukkan root Puzzle ke dalam list notVisited

  3. Untuk setiap Puzzle pada list notVisited, hitung costnya dengan heuristik

    c(x) = f(x) + g(x)

    Keterangan :

    • c(x) = cost untuk simpul x
    • f(x) = cost untuk mencapai simpul x dari akar
    • g(x) = taksiran panjang lintasan terpendek dari P ke simpul solusi

    Pilih Puzzle dengan cost terendah sebagai currentPuzzle

  4. Periksa apakah puzzle merupakan solusi atau tidak

    • Jika ya, maka pencarian dihentikan
    • Jika tidak, lanjutkan
  5. Tentukan pergerakan selanjutnya yang memungkinkan. Syarat pergerakan yang memungkinkan :

    • Slot kosong pada puzzle bergerak ke arah kiri, kanan, atas, atau bawah.
    • Pergerakan tersebut tidak menghasilkan Puzzle yang sudah pernah dikunjungi (tidak terdapat pada list visited)
  6. Hapus currentPuzzle dari list notVisited dan 7.masukkan ke dalam listVisited

  7. Kembali ke langkah 2

Built With

Penggunaan

Menggunakan Command Line Interface

  1. Buka command line dan arahkan firectory ke folder src

  2. Jalankan dengan command

    python cliTest.py

Menggunakan Graphical User Interface

  1. Buka folder bin dan run file main.exe
  2. Masukkan input (dapat dilakukan secara manual maupun dengan mengarahkan directory menggunakan tombol file di kanan bawah)
  3. Tekan tombol search yang ada di bawah input puzzle
  4. Tunggu sampai kolom solusi menampilkan hasil
  5. Kecepatan animasi puzzle dapat diubah dengan menggunakan horizontal slider

Author

  • 13520079 Ghebyon Tohada Nainggolan

(back to top)

tucil03-13520079's People

Contributors

ghebyon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.