Added Strassen's Matrix Multiplication in divide and conquer #958
+52
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for PyVerse 💡
Requesting to submit a pull request to the PyVerse repository.
Issue Title
Please enter the title of the issue related to your pull request.
Strassen's Matrix Multiplication
Info about the Related Issue
What's the goal of the project?
We are given with 2 matrix, our goal is to multiply them such that the time complexity of the calculation is O(n^2.81). We have used divide and conque approach to achieve the time complexity.
Name
Please mention your name.
Shuvojit Samanta
GitHub ID
Please mention your GitHub ID.
shuvojitss
Email ID
Please mention your email ID for further communication.
shuvojitsamanta15@gmail.com
Identify Yourself
Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
GSSOC
Closes
Enter the issue number that will be closed through this PR.
Closes: #943
Describe the Add-ons or Changes You've Made
Give a clear description of what you have added or modified.
Algorithm Steps
Input Matrices: Given two
n x n
matrices,A
andB
.Base Case:
n = 1
, return the productA[0][0] x B[0][0]
.Divide:
Compute Products:
Combine Results:
Combine Submatrices:
C
from the submatrices.Output: Return the resulting matrix
C
.Type of Change
Select the type of change:
How Has This Been Tested?
Describe how your changes have been tested.
I have tetsted it in all python editors and its working. I am providing a sample input output to describe it.
Sample Input:
Sample Output:
Checklist
Please confirm the following: