Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiagocavalcante/k-bounded
Rust implementation for computing the number of k-bounded functions from [n] to [n]
https://github.com/tiagocavalcante/k-bounded
graph-theory mathematics
Last synced: about 1 month ago
JSON representation
Rust implementation for computing the number of k-bounded functions from [n] to [n]
- Host: GitHub
- URL: https://github.com/tiagocavalcante/k-bounded
- Owner: TiagoCavalcante
- License: mit
- Created: 2024-09-07T23:20:30.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-07T23:20:42.000Z (4 months ago)
- Last Synced: 2024-11-26T16:43:59.644Z (about 2 months ago)
- Topics: graph-theory, mathematics
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k-bounded functions count
This repository contains the Rust implementation for computing the number of k-bounded functions from [n] to [n]. The computation is based on matrix operations over big integers to handle the large numbers that occur in calculations for larger values of n and k.
## Description
The main logic of this program is to compute the number of k-bounded functions using a matrix representation of the problem. It constructs a matrix where each entry is determined by a sigma function which checks if the absolute difference between indices is within the k threshold. The program then raises this matrix to the power of n-1 and multiplies it by a vector of ones to get the final result.
## Requirements
To run this code, you will need Rust installed on your machine. You can download and install Rust from [the official Rust website](https://www.rust-lang.org/tools/install).
## Usage
1. Clone this repository:
```sh
git clone https://github.com/TiagoCavalcante/k-bounded
```
2. Navigate into the repository directory:
```sh
cd k-bounded
```
3. Build and run the program:
```sh
cargo build --release
```