Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Tucil1_13524081

a. Program Description

This program implements a pure Brute Force algorithm to solve the LinkedIn Queens puzzle. The program reads a .txt file containing the initial board configuration with colored cells, validates whether the board is a valid square matrix (N x N), and then systematically generates and evaluates all possible queen placements without using any heuristics or optimization techniques. A solution is considered valid if no two queens are placed in the same column, no two queens share the same color, and no two queens are adjacent to each other, including diagonally adjacent cells.

During execution, the program can optionally display a live visualization of the brute force search process. After the search completes, it displays the final solution board, the total number of configurations examined, and the execution time in milliseconds (measured only for the brute force search process). The user is also given the option to save the resulting solution to an output file.


b. Requirements

  • Python 3.x
  • Uses only built-in libraries: time, os, sys
  • A test/ folder must exist for storing input files (or you can change it on the code)

c. How To Run

Run the program from the terminal:

python queens-solver.py

or

python3 queens-solver.py

Steps:

  1. Enter the name of the .txt input file.
  2. Choose whether to enable live visualization (optional).
  3. The program will display the solution, execution time (ms), and number of iterations examined.
  4. Choose whether to save the solution to a file.

e. Author

13524081/Alya Nur Rahmah


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages