https://github.com/itsamirhn/rookpoly
Recursive tool for calculating rook polynomial
https://github.com/itsamirhn/rookpoly
combinatorics polynomial python
Last synced: 12 months ago
JSON representation
Recursive tool for calculating rook polynomial
- Host: GitHub
- URL: https://github.com/itsamirhn/rookpoly
- Owner: itsamirhn
- Created: 2022-04-10T16:18:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T22:01:45.000Z (about 2 years ago)
- Last Synced: 2025-04-11T19:59:33.225Z (about 1 year ago)
- Topics: combinatorics, polynomial, python
- Language: Python
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RookPoly
Simple recursive tool for finding [Rook Polynomial](https://en.m.wikipedia.org/wiki/Rook_polynomial)
Be aware that recursion is not efficient enough, and it's using random choices. So maybe it gets slow for large numbers.
## Install
Just clone the project:
```shell
$ git clone https://github.com/itsamirhn/RookPoly.git
$ cd RookPoly
```
## Usage
Run the main program:
```shell
$ python3 main.py
```
For example, for a board like this:

Use the following input to find the rook polynomial:
```shell
Enter numberEnter number of rows: 5
00001
01010
01100
10010
00000
```
* `0`: Rook can be placed in this place
* `1`: Rook can't be placed here
Sample output for this example:
```
24X^5 + 164X^4 + 226X^3 + 104X^2 + 18X + 1
```
## Tests
Tests, instructions for running them and test report can be found in [tests](tests) folder.