Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bgmp/matrixmultiplier
Matrix multiplication program written in Python, with asymptotic visualization in R
https://github.com/bgmp/matrixmultiplier
divide-and-conquer latex learn matrix-multiplication python r strassen
Last synced: 24 days ago
JSON representation
Matrix multiplication program written in Python, with asymptotic visualization in R
- Host: GitHub
- URL: https://github.com/bgmp/matrixmultiplier
- Owner: BGMP
- License: mit
- Created: 2024-05-21T17:02:10.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-05-27T04:33:58.000Z (7 months ago)
- Last Synced: 2024-11-27T06:59:27.029Z (about 1 month ago)
- Topics: divide-and-conquer, latex, learn, matrix-multiplication, python, r, strassen
- Language: R
- Homepage:
- Size: 639 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MatrixMultiplier
===
This project aims to compare three different algorithms for matrix multiplication by running them on different sizes of
matrices and comparing their execution times. The three algorithms are:* Naive (Traditional).
* Divide and conquer.
* Strassen's algorithm.The project is written in Python and uses the `numpy` library for matrix operations.
## Running
At the top of `main.py`, you will find the following:
```python
MATRIX_SIZE = [32, 64, 128, 256, 512, 1024] # n
```You may modify the *n* values to change the size of the matrices to be multiplied. The program will generate two random
matrices of size *n* x *n* for each of the values you provide, and then multiply them using the three algorithms
mentioned above.To run the program, first install the dependencies:
```bash
pip install -r requirements.txt
```Then run the main script:
```bash
python main.py
```The results are saved to a CSV file in the `data/` directory, which are then used to generate graphs with R. If you
want to generate the graphs, simply open `MatrixMultiplier.Rproj` with RStudio and run the script. The generated graphs
will look as follows:![image](img/TRADITIONAL_DR1_DR2_PLOT.png)
## Dependencies
### Python
- [Python 3.8 or above](https://www.python.org/downloads/)
- Python modules:
- numpy
- I suggest using venv & pip for development & dependency management. (In case of Apple Silicon use conda)### R
- [R 4.0 or above](https://cran.r-project.org/)## Notes
This project was written as part of the Masters in Computer Science course "Advanced Data Structures and Algorithms" at
the University of the Bío-Bío.Some of the TeX/PDF files are in Spanish, as the course was taught in Spanish, but I've made an effort to translate the
relevant parts to english.