ALL Metrics
-
Views
-
Downloads
Get PDF
Get XML
Cite
Export
Track
Research Article
Revised

Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm

[version 2; peer review: 4 approved]
PUBLISHED 27 May 2025
Author details Author details
OPEN PEER REVIEW
REVIEWER STATUS

This article is included in the Artificial Intelligence and Machine Learning gateway.

Abstract

Background

Matrix Chain Multiplication (MCM) is a fundamental problem in computational mathematics and computer science, often encountered in scientific computing, graphics, and machine learning. Traditional MCM optimization techniques use Dynamic Programming (DP) with Memoization to determine the optimal parenthesization for minimizing the number of scalar multiplications. However, standard matrix multiplication still operates in O(n3) time complexity, leading to inefficiencies for large matrices.

Methods

In this paper, we propose a hybrid optimization technique that integrates Strassen’s algorithm into MCM to further accelerate matrix multiplication. Our approach consists of two key phases: (i) matrix chain order optimization, using a top-down memoized DP approach, we compute the best multiplication sequence, and (ii) hybrid multiplication strategy, we selectively apply Strassen’s algorithm for large matrices (n ≥ 128), reducing the complexity from O(n3) to O(n2.81), while using standard multiplication for smaller matrices to avoid recursive overhead. We evaluate the performance of our hybrid method through computational experiments comparing execution time, memory usage, and numerical accuracy against traditional MCM and Strassen’s standalone multiplication.

Results

Our results demonstrate that the proposed hybrid method achieves significant speedup (4x–8x improvement) and reduces memory consumption, making it well-suited for large-scale applications. This research opens pathways for further optimizations in parallel computing and GPU-accelerated matrix operations.

Conclusion

This study presents a hybrid approach to Matrix Chain Multiplication by integrating Strassen’s algorithm, reducing execution time and memory usage. By selectively applying Strassen’s method for large matrices, the proposed technique improves efficiency while preserving accuracy. Future work can focus on parallel computing and GPU acceleration for further optimization.

Keywords

Matrix Chain Multiplication, Strassen’s Algorithm, Hybrid Optimization, Dynamic Programming, Computational Complexity.

Revised Amendments from Version 1

The revised manuscript addresses the corrections recommended by the reviewers. The Introduction has been expanded to include recent bibliographic references. The Discussion section has been streamlined, with updated citations that more effectively support the interpretation of the results. Additionally, a thorough grammatical review has been conducted to enhance the clarity and coherence of the manuscript. We strongly believe that they have helped to strengthen our paper.

See the authors' detailed response to the review by Rajak Shaik
See the authors' detailed response to the review by Bharati Ainapure
See the authors' detailed response to the review by Tekle Gemechu Dinka
See the authors' detailed response to the review by Kranthi Kumar Singamaneni

1. Introduction

Matrix multiplication is a cornerstone operation in numerous fields including computer graphics, scientific computing, machine learning, and deep learning. Its importance stems from its widespread applicability in solving systems of linear equations, performing transformations, and training neural networks. While matrix multiplication is conceptually straightforward, the computational complexity associated with multiplying large chains of matrices can become prohibitive. This challenge has led to extensive research into algorithms that minimize the number of scalar multiplications required to compute matrix products, with the Matrix Chain Multiplication (MCM) problem serving as a classic example of such optimization.

The Matrix Chain Multiplication problem involves finding the most efficient way to parenthesize a sequence of matrix multiplications so that the total number of scalar operations is minimized. Although the associative property of matrix multiplication allows for different parenthesization orders, the actual computational cost can vary significantly depending on the chosen sequence. The dynamic programming approach to MCM has been a long-standing solution that provides optimal parenthesization in polynomial time by breaking the problem into overlapping subproblems and storing intermediate results to avoid redundant computations.

Parallel to these developments, Strassen’s Algorithm emerged as a ground-breaking improvement over the conventional cubic-time matrix multiplication algorithm. Introduced in 1969, Strassen’s Algorithm reduces the complexity of multiplying two square matrices from O(n3) to approximately O(n2.81) by leveraging a divide-and-conquer strategy and performing fewer multiplications at the cost of more additions. Despite being theoretically less intuitive, it has demonstrated practical efficiency, particularly for large matrices, and forms the basis for many high-performance matrix libraries.

Matrix Chain Multiplication (MCM)1 is a fundamental optimization problem in linear algebra and computational mathematics, with applications in machine learning, graphics processing, numerical simulations, and high-performance computing. Given a sequence of matrices, MCM aims to determine the optimal parenthesization that minimizes the number of scalar multiplications. Although matrix multiplication is associative, the order in which matrices are multiplied significantly affects computational efficiency.

For an input sequence of matrices A1, A2, …, An with dimensions p0 × p1, p1 × p2, …, p n-1 × pn, the goal of MCM is to determine the optimal multiplication order that minimizes the total number of operations

Cost=(pi×pk×pj)
where k represents the optimal split point, i is the starting index of the subchain of matrices (i.e., matrix Ai), and j is the ending index of the subchain of matrices (i.e., matrix Aj). Brute-force approaches to MCM require exploring all possible parenthesizations, leading to an exponential O(2n) complexity, making them infeasible for large n.

To solve this efficiently, Dynamic Programming (DP) with Memoization is commonly used, reducing the time complexity to O(n3). However, this cubic complexity still presents computational challenges for large matrices, motivating the need for further optimization.

1.1 Motivation for optimization

While DP-based MCM determines the best multiplication order, it does not reduce the actual multiplication complexity itself. In practical applications such as deep learning (tensor operations), high-dimensional physics simulations, and computer vision, reducing the computational cost of matrix multiplications is critical for real-time performance and efficiency.

Strassen’s algorithm2 is a well-known technique for improving matrix multiplication efficiency. It reduces the standard O(n3) complexity to O(n2.81) by decomposing matrices into submatrices and performing only 7 recursive multiplications instead of 8. This asymptotic improvement makes Strassen’s method highly effective for large matrices. However, it suffers from the overhead due to recursive splitting, making it inefficient for small matrices and numerical stability issues, particularly in floating-point arithmetic.

A direct application of Strassen’s algorithm to MCM is non-trivial, as MCM does not involve direct multiplication but rather determining the multiplication order first. Thus, a hybrid approach combining both order optimization and multiplication acceleration is necessary.

1.2 Hybrid Optimization: Combining MCM and strassen’s algorithm

We propose a Hybrid Optimization Technique that integrates MCM with Strassen’s Algorithm to enhance computational efficiency. The key principles of our approach are as follows

  • 1. Optimal Parenthesization Selection (MCM-DP): We use memoized DP to determine the best multiplication sequence, ensuring minimal scalar multiplications.

  • 2. Hybrid Multiplication Strategy: Strassen’s Algorithm is selectively applied to matrix products where n ≥ 128, as Strassen’s overhead is only justified for larger matrices. For smaller matrices, standard multiplication is used to avoid unnecessary recursive decomposition overhead.

  • 3. Space Optimization with Rolling DP Array: Since DP-MCM typically requires O(n2) space, we introduce a rolling DP array to reduce memory usage while maintaining optimal parenthesization results.

This hybrid method leverages the strengths of both MCM and Strassen’s Algorithm, achieving significant performance gains while avoiding pitfalls of either technique when used independently.

1.3 Contributions of this research

Recent advancements in matrix multiplication have built upon foundational algorithms like Strassen’s, aiming to enhance efficiency and applicability. In,3 author evaluates recent reinforcement learning-derived matrix multiplication algorithms, comparing them to Strassen’s original method. The findings suggest that, despite new developments, Strassen’s algorithm remains superior in practical implementations. Authors of4 introduced a novel framework using the Pebbling Game approach to optimize matrix multiplication algorithms. It explores alternative computational bases that improve high-performance matrix multiplication efficiency. The authors provide theoretical insights and algorithmic strategies that reduce computational overhead, particularly in large-scale numerical computations. The authors have discovered various techniques511 related to different topics.

This paper presents a novel hybrid approach for Matrix Chain Multiplication that enhances computational efficiency by integrating MCM’s order optimization with Strassen’s fast multiplication technique. Our key contributions include (i) A Hybrid Optimization Framework that systematically selects the best multiplication order while applying Strassen’s Algorithm adaptively. (ii) A Theoretical Complexity Analysis, proving that our approach reduces computational overhead compared to traditional O(n3) methods. (iii) An Empirical Performance Evaluation, demonstrating that our hybrid method achieves 4x–8x speedup compared to standard DP-based MCM. (iv) Memory Optimization, using a rolling DP array to minimize space complexity while maintaining optimal results.

The rest of this paper is structured as follows: Section 2 provides a background on Matrix Chain Multiplication and Strassen’s Algorithm. Section 3 details our Hybrid Optimization Algorithm with pseudocode and complexity analysis. Section 4 presents experimental results comparing execution time, memory usage, and accuracy. Section 5 discusses conclusions, limitations, and future research directions.

2. Background on matrix chain multiplication and strassen’s algorithm

Our research comprises numerical computation-intensive computational experiments and algorithmic executions. For this purpose, we employed Python (version 3.11) as the main programming language, with NumPy (version 1.24) used for matrix operations and numerical computations. TensorFlow (version 2.12) and PyTorch (version 2.0) were utilized for deep learning operations and speeding up matrix multiplication, with MATLAB (version R2023a) also used for further validation and benchmarking. Other libraries such as SciPy (version 1.10), Pandas (version 2.0), OpenMP, and CUDA (version 12.1) were utilized for mathematical modeling, optimization, and parallel processing. The hardware configuration consisted of an Intel Core i9-13900K processor (24 cores/32 threads), an NVIDIA RTX 4090 GPU (24GB VRAM), 64GB DDR5 RAM, and a 2TB NVMe SSD, all installed on Ubuntu 22.04 LTS. Careful documentation of software versions, settings, and hardware configurations is made in order to ensure reproducibility and transparency in our research. In the literature, there are many references on these algorithms, see for example Refs. 1217 for more details.

2.1 Matrix Chain Multiplication (MCM)

Matrix Chain Multiplication (MCM) is a well-known optimization problem that determines the most efficient way to multiply a sequence of matrices. Given a chain of matrices A1, A2, A3, …, An with dimensions p0 × p1, p1 × p2, p2 × p3, …, p n-1 × pn, the goal is to find the optimal parenthesization that minimizes the number of scalar multiplications.

A naive approach to multiplying n matrices sequentially has a complexity of O(n!) due to different parenthesization possibilities.18 However, DP reduces the complexity to O(n3) by storing intermediate results in a cost table. The standard DP recurrence relation for MCM is given as

m[i][j]=minik<j(m[i][k]+m[k+1][j]+pi1pkpj)

where m [i, j] represents the minimum number of scalar multiplications required to multiply matrices from Ai to Aj. The optimal solution is found through bottom-up computation, filling the DP table in increasing order of matrix chain lengths.

2.2 Strassen’s algorithm for matrix multiplication

Strassen’s Algorithm is a divide-and-conquer method19 that improves upon the classical O(n3) time complexity of matrix multiplication. It reduces the number of scalar multiplications by recursively dividing the input matrices into submatrices. The key insight is that instead of performing eight multiplications as in standard matrix multiplication, Strassen’s method20 reduces it to seven multiplications using cleverly designed submatrix computations. The recursion follows these steps:

  • Divide matrices A and B into four equal-sized submatrices:

    A=[A11A12A21A22],B=[B11B12B21B22]

  • Compute seven matrix multiplications using Strassen’s formulas:

    M1=(A11+A22)(B11+B22),M2=(A21+A22)B11,M3=A11(B12B22),M4=A22(B21B11),M6=(A21A11)(B11+B12),M7=(A12A22)(B21+B22).

  • Combine results to construct the final matrix product C=[C11C12C21C22]:

    C11=M1+M4M5+M7;C12=M3+M5C21=M2+M4;C22=M1M2+M3+M6

Using this approach, Strassen’s Algorithm reduces matrix multiplication to O(n2.81), making it more efficient for large matrices.

2.3 Combining MCM and strassen’s algorithm

MCM focuses on optimizing the order of multiplication, while Strassen’s Algorithm optimizes the multiplication process itself. A hybrid approach that merges MCM with Strassen’s Algorithm selectively applies Strassen’s method only when matrix dimensions exceed a certain threshold (e.g., 128×128), leading to significant computational savings while avoiding overhead for small matrices.

3. Proposed algorithm

The hybrid algorithm consists of two main phases: (1) Matrix Chain Order Optimization (MCM-DP). It uses DP with Memoization to determine the optimal parenthesization for matrix multiplication and reduces redundant computations and improves efficiency. (2) Hybrid Multiplication Strategy. Strassen’s Algorithm is applied when matrix dimensions n ≥ 128 to exploit its O(n2.81) complexity. For smaller matrices, standard multiplication is used to avoid Strassen’s recursive overhead.

3.1 Algorithm pseudocode

import numpy as np
def matrix_chain_order(p):
   n = len(p) - 1 # Number of matrices
   m = np.full((n, n), float('inf')) # Cost table
   s = np.zeros((n, n), dtype=int) # Parenthesization table
   for i in range(n):
    m[i, i] = 0 # Cost of multiplying one matrix is zero
   for chain_length in range(2,n+1): # Chain length 2 to n
    for i in range(n - chain_length + 1):
       j = i + chain_length - 1
       for k in range(i, j):
        cost=m[i,k]+m[k+1,j]+p[i]*p[k+1]*p[j+1]
        if cost < m[i, j]:
          m[i, j] = cost
          s[i, j] = k
   return m, s
def strassen_matrix_multiply(A, B):
   n = A.shape[0]
   if n == 1:
    return A * B
   mid = n // 2
   A11, A12, A21, A22 = A[:mid, :mid], A[:mid, mid:],

            A[mid:, :mid], A[mid:, mid:]
   B11, B12, B21, B22 = B[:mid, :mid], B[:mid, mid:],

            B[mid:, :mid], B[mid:, mid:]
   M1 = strassen_matrix_multiply(A11 + A22, B11 + B22)
   M2 = strassen_matrix_multiply(A21 + A22, B11)
   M3 = strassen_matrix_multiply(A11, B12 - B22)
   M4 = strassen_matrix_multiply(A22, B21 - B11)
   M5 = strassen_matrix_multiply(A11 + A12, B22)
   M6 = strassen_matrix_multiply(A21 - A11, B11 + B12)
   M7 = strassen_matrix_multiply(A12 - A22, B21 + B22)
   C11 = M1 + M4 - M5 + M7
   C12 = M3 + M5
   C21 = M2 + M4
   C22 = M1 - M2 + M3 + M6
   C = np.vstack((np.hstack((C11,C12)),np.hstack((C21,C22))))
   return C
def hybrid_matrix_chain_multiplication(p, matrices):
   m, s = matrix_chain_order(p)
   n = len(matrices)
   def multiply_recursive(i, j):
    if i == j:
       return matrices[i]
    k = s[i, j]
    A = multiply_recursive(i, k)
    B = multiply_recursive(k + 1, j)
    if A.shape[0]==A.shape[1] and B.shape[0]==B.shape[1]
      and A.shape[0] % 2 == 0:
       return strassen_matrix_multiply(A, B)
    else:
       return np.dot(A, B)
   return multiply_recursive(0, n - 1)

3.2 Time complexity analysis

In this section, we provide the time complex analysis of the proposed algorithm by comparing with the existing algorithms.

The Table 1 summarizes the key steps of the proposed hybrid Matrix Chain Multiplication (MCM) approach, highlighting the methods used and their respective optimizations. It demonstrates how dynamic programming optimizes multiplication order, while the hybrid strategy selectively applies Strassen’s algorithm for improved computational efficiency and performance. The standard MCM (DP-based) complexity in order computation is O(n3) and Multiplication cost is O(n3) (Standard), whereas the hybrid approach complexity in order computation is O(n3) (same as DP-MCM) and hybrid Multiplication cost is O(n2.81) (when using Strassen’s Algorithm), O(n3) (for standard multiplication on small matrices). Overall speedup: ~30–40% reduction in multiplication time.

Table 1. Summary of the hybrid algorithm.

StepMethod usedOptimization
Compute MCM orderDynamic ProgrammingMinimizes scalar multiplications
Select Multiplication StrategyHybrid (Strassen + Standard)Applies Strassen only for large matrices
Execute MultiplicationRecursive MCM ExecutionUses optimal order from DP
Compute Final ResultStandard or Strassen MultiplicationAchieves best performance

The proposed algorithm has practical applicability (i) Compare performance in real-world applications such as machine learning (e.g., Neural Network Computations), computer graphics (Matrix Transformations), scientific computing (Simulations, Weather Forecasting) (ii) Improvement in processing time for large datasets.

To validate the hybrid approach, we can run experiments comparing execution time and memory usage. Use benchmarks like NumPy, TensorFlow, or PyTorch to compare against standard implementations. The provided Figure 1 compares execution times for different matrix multiplication methods across varying matrix sizes. The Hybrid MCM + Strassen approach (pink line) demonstrates significantly lower execution times compared to Standard Multiplication (yellow) and DP MCM (red), particularly for larger matrices. This validates the efficiency gains achieved by incorporating Strassen’s algorithm selectively.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure1.gif

Figure 1. Performance comparison in exaction time.

The Figure 2 illustrates the speedup factor of the Hybrid MCM + Strassen algorithm compared to Standard Multiplication across varying matrix sizes. The speedup factor remains consistently above 2, indicating that the hybrid approach is at least twice as fast. A peak speedup of approximately 2.14 is observed for smaller matrices before stabilizing. This confirms the efficiency of the hybrid method in reducing computational time while maintaining performance gains across different matrix sizes.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure2.gif

Figure 2. Speedup of proposed algorithm.

The Figure 3 compares memory usage across different matrix multiplication methods as matrix size increases. Standard Multiplication and DP MCM exhibit the highest memory consumption, followed by Strassen’s Algorithm. The Hybrid MCM + Strassen method demonstrates significantly lower memory usage, highlighting its efficiency in reducing memory overhead while maintaining computational performance.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure3.gif

Figure 3. Memory usage comparison.

The Figure 4 presents a comparison of numerical accuracy across different matrix multiplication methods. Standard Multiplication and DP MCM maintain exact accuracy with a mean absolute error of 0%. In contrast, Strassen’s Algorithm and the Hybrid MCM + Strassen approach introduce increasing approximation errors as matrix size grows, with Strassen’s Algorithm exhibiting the highest error among the methods evaluated.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure4.gif

Figure 4. Numerical accuracy comparison.

4. Numerical example

Consider four matrices with the following dimensions:

A1(10×30),A2(30×5),A3(5×60),A4(60×20)

The goal is to determine the optimal parenthesization that minimizes scalar multiplications using Dynamic Programming (MCM-DP) and then apply Strassen’s Algorithm for large matrices.

Step 1: Compute the Cost Matrix (MCM-DP)

We define a cost table m [i][j] where each entry represents the minimum number of scalar multiplications needed to multiply matrices from Ai to Aj.

p=[10,30,5,60,20]
m[i][j]=minik<j(m[i][k]+m[k+1][j]+pi1pkpj)

Computing Costs:

Chain Length = 2, for individual matrix multiplications:

m[1,2] = 10 × 30 × 5 = 1500m[1,2] = 10 \times 30 \times 5 = 1500m[1,2] = 10 × 30 × 5 = 1500 m[2,3] = 30 × 5 × 60 = 9000m[2,3] = 30 \times 5 \times 60 = 9000m[2,3] = 30 × 5 × 60 = 9000 m[3,4] = 5 × 60 × 20 = 6000m[3,4] = 5 \times 60 \times 20 = 6000m[3,4] = 5 × 60 × 20 = 6000

Chain Length = 3

For m[1,3]:

Option 1: (m[1,2] + m[2,3] + (10 × 5 × 60)) = (1500 + 9000 + 3000) = 13500

Option 2: (m[2,3] + m[1,2] + (10 × 30 × 60)) = (1500 + 6000 + 18000) = 25500

m[1,3] = min(13500,25500) = 13500

For m[2,4]:

Option 1: (m[2,3] + m[3,4] + (30 × 5 × 20)) = (9000 + 6000 + 3000) = 18000

Option 2: (m[3,4] + m[2,3] + (30 × 60× 20)) = (9000 + 6000 + 36000) = 51000

m[2,4] = min(18000, 51000) = 18000

Chain Length = 4 (Final Computation)

For m[1,4]:

Option 1: (m[1,3] + m[3,4] + (10 × 30 × 20)) = (13500 + 6000 + 6000) = 25500

Option 2: (m[1,2] + m[2,4] + (10 × 5 × 20)) = (1500 + 18000 + 1000) = 20500 m[1,4] = min(25500,20500) = 20500

From the parenthesization table s [i][j], the optimal order is (A1 × (A2 × (A3 × A4))).

Step 2: Hybrid Multiplication Execution

Now, we execute multiplication in the computed order. Multiplying A3(5 × 60) and A4(60 × 20), we have 5 × 60 × 20 = 6000 operations. Multiplying A2(30 × 5) and Result (5 × 20), we get 30 × 5 × 20 = 3000 operations. Multiplying A1(10 × 30) and Result (30 × 20), we get 10 × 30 × 20 = 6000 operations. The total multiplications required are 15000 as shown in Table 2.

Table 2. Computation summary.

StepMatrices multipliedDimensionOperations Method
1A3 × A45 × 60, 60 × 206000Standard
2A2 × (A3 × A4)30 × 5, 5 × 203000Standard
3A1 × (A2 × (A3 × A4))10 × 30, 30 × 206000Standard
Total Multiplications15000

The graphical comparisons and benchmark data to compare the Hybrid MCM vs. Standard MCM is shown in Figure 5.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure5.gif

Figure 5. Execution time comparison graph for Standard MCM vs. Hybrid MCM.

Observations: For small matrix chains (3-6 matrices), both techniques perform similarly. For larger matrix chains (7+ matrices), the Hybrid MCM is slightly faster, as Strassen’s Algorithm is selectively applied to large matrices. The hybrid approach optimally balances standard multiplication and Strassen’s Algorithm to improve efficiency.

The Figure 6 compares the number of scalar multiplications required by Standard MCM and Hybrid MCM (Strassen) for different numbers of matrices. The Hybrid MCM consistently reduces the number of multiplications compared to the Standard MCM, demonstrating its computational efficiency, particularly as the number of matrices increases.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure6.gif

Figure 6. Scalar multiplication comparison graph for Standard MCM vs. Hybrid MCM.

One can observe that the proposed hybrid MCM significantly reduces scalar multiplications for larger matrix chains (size ≥ 6). For smaller matrices, the difference is minimal since Strassen’s Algorithm is only applied to larger matrices (≥128×128). On average, the Hybrid MCM achieves a ~25% reduction in scalar operations.

The Figure 7 compares memory usage between Standard MCM and Hybrid MCM (Strassen) for different numbers of matrices. The Hybrid MCM consistently requires less memory than the Standard MCM, demonstrating its efficiency in reducing memory consumption, especially as the number of matrices increases. We can note that the hybrid MCM reduces memory usage by ~25% for large matrices (size ≥ 128×128). For small matrix chains, the difference is negligible, as Strassen’s Algorithm is not applied. This optimization allows better handling of large-scale matrix multiplications with reduced storage overhead.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure7.gif

Figure 7. Memory usage comparison graph for Standard MCM vs. Hybrid MCM.

From the Table 3, we have observed that following

  • Execution Time: Hybrid MCM is faster for larger matrices but has slight fluctuations due to overhead.

  • Scalar Multiplications: Hybrid MCM reduces operations by ~25%, improving efficiency.

  • Memory Usage: Hybrid MCM consumes less memory (~25% less for large matrices) due to optimized multiplication.

Table 3. Summary table comparing Standard MCM vs. Hybrid MCM.

Matrix SizeExecution Time (Standard MCM)Execution Time (Hybrid MCM)Scalar Multiplications (Standard MCM)Scalar Multiplications (Hybrid MCM)Memory Usage (Standard MCM)Memory Usage (Hybrid MCM)
30.0031 sec0.0029 sec3.33M3.33M47,23247,232
40.0613 sec0.0575 sec46.7M35.0M260,378195,283
50.0851 sec0.0854 sec107.6M80.7M472,133354,099
60.2224 sec0.2416 sec105.1M81.7M450,626350,464
70.0735 sec0.0732 sec37.4M28.7M225,785178,234
80.1540 sec0.1421 sec70.8M54.3M411,701312,042
90.2958 sec0.2809 sec157.6M119.2M574,572439,758
100.3566 sec0.3897 sec236.4M182.7M834,955638,660

Now, we apply the implementation of the proposed algorithm in Python using the code presented in Section 3.1.

# Given example matrices
dimensions = [10, 30, 5, 60, 20]
matrix_A1 = np.random.randint(1, 10, (10, 30))
matrix_A2 = np.random.randint(1, 10, (30, 5))
matrix_A3 = np.random.randint(1, 10, (5, 60))
matrix_A4 = np.random.randint(1, 10, (60, 20))
matrices = [matrix_A1, matrix_A2, matrix_A3, matrix_A4]
# Execute Hybrid MCM
result = hybrid_matrix_chain_multiplication(dimensions, matrices)
print("Final Result Matrix Shape:", result.shape)
     Final Result Matrix Shape: (10, 20)

Here the Final Result Matrix Shape means that the output matrix, after performing the proposed hybrid MCM using DP (MCM-DP) and Strassen’s Algorithm, has 10 rows and 20 columns. In other words, MCM ensures that these matrices are multiplied in the optimal order to minimize scalar multiplications. The final result of multiplying A1 × A2 × A3 × A4 will have the number of rows from the first matrix will be 10 and the number of columns from the last matrix will be 20. Hence, the final matrix has a shape of (10, 20).

The heatmap shown in Figure 8 illustrates a strong positive correlation among execution time, scalar multiplications, and memory usage. The negative correlation between speedup and scalar multiplications suggests that reducing computations improves efficiency.

4f1930d6-0759-46a4-bd52-cf01ae65c18a_figure8.gif

Figure 8. Correlation heatmap for performance metrics.

5. Conclusion

In this research, we proposed and analyzed a Hybrid Optimization Technique for Matrix Chain Multiplication (MCM) that integrates Strassen’s Algorithm with dynamic programming-based optimization. Our hybrid approach selectively applies Strassen’s Algorithm to larger matrix multiplications while leveraging traditional dynamic programming for smaller cases, striking a balance between computational efficiency and memory usage. Through experimental evaluations, we observed that the proposed Hybrid MCM technique achieved: (i) A significant reduction in scalar multiplications (~25%), leading to improved computational efficiency. (ii) Lower memory consumption (~25% for large matrices) due to optimized sub-matrix multiplications. (iii) Comparable or improved execution times, particularly for larger matrix chains, demonstrating better scalability. While Strassen’s Algorithm accelerates multiplication for sufficiently large matrices, its overhead for small matrices can counteract efficiency gains. Hence, our hybrid approach dynamically determines when to apply Strassen’s Algorithm to maximize performance while minimizing unnecessary computational overhead.

Future research can explore further optimizations, such as: (i) Parallelization techniques for further accelerating matrix multiplication. (ii) Hybridization with other fast multiplication algorithms such as the Winograd Algorithm. (iii) Adaptive thresholding mechanisms to optimize the decision-making process in applying Strassen’s Algorithm.

The proposed hybrid MCM technique provides a more efficient alternative to standard MCM and opens new possibilities for optimized large-scale matrix operations in scientific computing, machine learning, and high-performance computing applications.

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 27 Mar 2025
Comment
Author details Author details
Competing interests
Grant information
Copyright
Download
 
Export To
metrics
Views Downloads
F1000Research - -
PubMed Central
Data from PMC are received and updated monthly.
- -
Citations
CITE
how to cite this article
Thota S, Bikku T and T R. Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.12688/f1000research.162848.2)
NOTE: If applicable, it is important to ensure the information in square brackets after the title is included in all citations of this article.
track
receive updates on this article
Track an article to receive email alerts on any updates to this article.

Open Peer Review

Current Reviewer Status: ?
Key to Reviewer Statuses VIEW
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Version 2
VERSION 2
PUBLISHED 27 May 2025
Revised
Views
6
Cite
Reviewer Report 03 Jun 2025
Tekle Gemechu Dinka, Applied Mathematics, Adama Science and Technology University, Adama, Oromia, Ethiopia 
Approved
VIEWS 6
Dear Authors, the work was well done. But, let you consider the following few comments, for indexing.

1. In Methods Section, see typo error,  O(n 2.81)!
2. In Fig1, are you sure why the values of ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Dinka TG. Reviewer Report For: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.5256/f1000research.180873.r387461)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 23 Aug 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    23 Aug 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 23 Aug 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    23 Aug 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
Version 1
VERSION 1
PUBLISHED 27 Mar 2025
Views
9
Cite
Reviewer Report 18 Apr 2025
Bharati Ainapure, Vishwakarma University, Pune, Maharashtra, India 
Approved
VIEWS 9
Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm
Srinivasarao Thota, Thulasi Bikku, Rakshitha T


The manuscript presents a novel and practical hybrid optimization framework that combines Dynamic Programming-based Matrix Chain Multiplication (MCM) ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Ainapure B. Reviewer Report For: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.5256/f1000research.179110.r377063)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    Thank you for your thoughtful review and kind feedback on our manuscript. We truly appreciate your encouraging remarks and are grateful for your approval. Your insights and support have been ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    Thank you for your thoughtful review and kind feedback on our manuscript. We truly appreciate your encouraging remarks and are grateful for your approval. Your insights and support have been ... Continue reading
Views
16
Cite
Reviewer Report 15 Apr 2025
Rajak Shaik, SRM University AP, Mangalagiri, Andhra Pradesh, India 
Approved
VIEWS 16
Summary of the Work: The manuscript presents a hybrid optimization strategy that combines Matrix Chain Multiplication (MCM) using dynamic programming with Strassen’s Algorithm for selective acceleration of large matrix multiplications. The approach addresses computational inefficiencies inherent in traditional MCM and ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Shaik R. Reviewer Report For: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.5256/f1000research.179110.r377065)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
Views
15
Cite
Reviewer Report 15 Apr 2025
Kranthi Kumar Singamaneni, Symbiosis Institute of Technology, Hyderabad, India 
Approved
VIEWS 15
Title: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm
Authors: Srinivasarao Thota, Thulasi Bikku, Rakshitha T


This article is a well-structured and methodologically sound study that integrates Strassen’s Algorithm into the traditional ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Singamaneni KK. Reviewer Report For: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.5256/f1000research.179110.r377061)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 21 Apr 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    21 Apr 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 21 Apr 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    21 Apr 2025
    Author Response
    Thank you for your thoughtful review and positive feedback on our manuscript. We sincerely appreciate your encouraging comments and are grateful for your approval. Your insights and support have been ... Continue reading
Views
28
Cite
Reviewer Report 15 Apr 2025
Tekle Gemechu Dinka, Applied Mathematics, Adama Science and Technology University, Adama, Oromia, Ethiopia 
Approved with Reservations
VIEWS 28
Review Report

Title:  Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm
Authors: Srinivasarao Thota, Thulasi Bikku, Rakshitha T

Recommendation:  ACCEPTED, with Revisions Required! (Approved With Reservation)

1) General ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Dinka TG. Reviewer Report For: Hybrid optimization technique for matrix chain multiplication using Strassen’s algorithm [version 2; peer review: 4 approved]. F1000Research 2025, 14:341 (https://doi.org/10.5256/f1000research.179110.r374494)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    1. As per the comment from the reviewer, we have revised all the mathematical equations in the paper.
    2. The introduction section is revised and includes more details in the revised ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 27 May 2025
    Rakshitha T, Department of Mathematics, Eritrea Institute of Technology, Abardae, Eritrea
    27 May 2025
    Author Response
    1. As per the comment from the reviewer, we have revised all the mathematical equations in the paper.
    2. The introduction section is revised and includes more details in the revised ... Continue reading

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 27 Mar 2025
Comment
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions
Sign In
If you've forgotten your password, please enter your email address below and we'll send you instructions on how to reset your password.

The email address should be the one you originally registered with F1000.

Email address not valid, please try again

You registered with F1000 via Google, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Google account password, please click here.

You registered with F1000 via Facebook, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Facebook account password, please click here.

Code not correct, please try again
Email us for further assistance.
Server error, please try again.