Matrix Multiplication Shortest Path Calculator
Compute the product of two matrices and find the shortest path in a weighted graph using matrix multiplication method (min-plus matrix multiplication).
Was this calculator helpful?
How to use this tool?
This calculator performs matrix multiplication in two modes: standard and min-plus (shortest path).
- Set matrix dimensions – Enter the number of rows and columns for Matrix A and Matrix B (1–4).
- Enter values – Type comma-separated numbers in row-major order (e.g.,
1,2,3,4for a 2×2 matrix). - Choose multiplication type – Check "Use min-plus multiplication" for shortest path calculation; leave unchecked for standard multiplication.
- Calculate – Click Calculate. The result matrix and an explanation appear below.
- Clear – Click Clear to reset to default values.
Important: Matrix A's columns must equal Matrix B's rows. All values must be numbers. Min-plus multiplication computes each cell as the minimum sum of corresponding row/column entries, useful for shortest path problems.
Previous Results
| Result | Inputs | Date |
|---|
Frequently Asked Questions
Min-plus multiplication replaces addition with minimum and multiplication with addition. It is used to compute shortest paths in weighted graphs.
Enter values as comma-separated numbers in row-major order. For example, a 2x2 matrix with values 1,2,3,4 means first row: 1,2; second row: 3,4.
Matrices can be up to 4x4. Ensure that the number of columns in Matrix A equals the number of rows in Matrix B.