Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsamirhn/rookpoly
Recursive tool for calculating rook polynomial
https://github.com/itsamirhn/rookpoly
combinatorics polynomial python
Last synced: about 23 hours 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 (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T22:01:45.000Z (7 months ago)
- Last Synced: 2024-10-31T06:41:57.935Z (8 days 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: 500001
01010
01100
10010
00000
```
* `0`: Rook can be placed in this place
* `1`: Rook can't be placed hereSample 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.