Skip to content

This code generates magic squares when the size of the square, initial integer in the sequence and the solver are specified

Notifications You must be signed in to change notification settings

kulkarnipreetam/magic_square_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Magic Squares Solver

Introduction

A Magic Square is an n x n grid filled with distinct integers in such a way that the sum of the numbers in each row, column, and diagonal is the same. This repository contains code that allows you to generate and solve magic squares using different two solvers. (Your PC needs to have cplex to use it this option)

Features

  • Customizable Size (n): Specify the size (n x n) of the magic square.
  • Initial Integer (i): Choose the initial integer to start the series of consecutive integers.
  • Solver Selection (s): Select a solver to solve the linear programming problem to generate the magic square.

Usage example

To use the magic square solver, you need to provide:

  1. The size of the magic square.
  2. The initial integer in the series of consecutive integers.
  3. The solver to be used for solving the linear program (1 or 2 - Please make sure you have cplex to use option 2).

Magic_Square_M(4,2,1)

Magic Square

Important Notice

The code in this repository is proprietary and protected by copyright law. Unauthorized copying, distribution, or use of this code is strictly prohibited. By accessing this repository, you agree to the following terms:

  • Do Not Copy: You are not permitted to copy any part of this code for any purpose.
  • Do Not Distribute: You are not permitted to distribute this code, in whole or in part, to any third party.
  • Do Not Use: You are not permitted to use this code, in whole or in part, for any purpose without explicit permission from the owner.

Any violation of these terms will be subject to legal action. If you have any questions or require permission, please contact the repository owner.

Thank you for your cooperation.

About

This code generates magic squares when the size of the square, initial integer in the sequence and the solver are specified

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages