Questions tagged [matrix]
39 questions
8
votes
3 answers
Strassen algorithm for matrix multiplication complexity analysis
I see everywhere that the recursive equation for the complexity of Strassen alg is:
$$T(n) = 7T(\tfrac{n}{2})+O(n^2).$$ This is not so clear to me.
The parameter $n$ is supposed to be the size of the input, but it seems that here it is one dimension…
dafnahaktana
- 189
- 3
4
votes
1 answer
Go from source to destination in 2d matrix with min steps collecting all candies. How to do it?
If we have a 2d matrix of max dimension, 95x95 and we have at max 12 candies placed in some cells. We always start from top left corner(0,0) and we need to reach some given destination (x,y) after having collected ALL the candies. There are some…
user3760100
- 163
- 4
3
votes
1 answer
Strassen's matrix multiplication algorithm when $n$ is not a power of 2
The above image, describing Strassen's matrix multiplication algorithm, is from the book Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein.
The algorithm multiplies two square matrices of order $n$, where $n$ is a power of $2$,…
Sc00by_d00
- 33
- 1
- 3
3
votes
1 answer
Applying SVD compression to integral point images
Suppose that we have an $m\times n$ matrix $A$ of rank $n$, whose entries are 8-bit unsigned integers obtained from a grayscale image. Now we want to apply SVD to $A$ and to use the first $k$ singular values to construct the the best rank-$k$…
Peradventure
- 131
- 2
3
votes
1 answer
Calculate boolean matrix multiplication (BMM) using transitive closure
Let us say I am given an algorithm that calculates the transitive closure of a given graph $G = \{ V, E \}$.
How can I use this algorithm in order to perform the Boolean Matrix Multiplication of two matrices $X$ and $Y$?
I know that in order to…
ga as
- 31
- 1
3
votes
1 answer
Matrix chain multiplication: Greedy approach
some suggested a thread in which the algorithm multiplies the 2 matrices with lowest values first. Mine is different: it divides by parenthesis the 2 matrices. And continues to the next section.
The problem is: finding the most efficient way to…
John Appleboim
- 33
- 4
2
votes
0 answers
approximate line segments from array of unsorted points
The polygon above is actually a collection of a lot of black points closely packed together. I want to approximate these black points as straight line segments. The black points are not sorted in any order.
What I'm doing right now is sort these…
digest
- 21
- 1
2
votes
0 answers
Is minimising the total number of one entries in binary matrices $CA$ and $C^TB$ NP-HARD?
Given a two rectangular binary matrices $A$ and $B$ with dimensions $c\times a$
and $c \times b$ respectively, does there exist an invertible binary
matrix C with dimensions $c \times c$ such that the total number of 1
entries in $CA$ and $C^TB$ is…
Richie Yeung
- 121
- 5
2
votes
0 answers
Find sub-matrix containing the maximum number of elements consisting only of 1's
I am trying to get help on it here, originally posted first at:
https://stackoverflow.com/questions/59446920/find-sub-matrix-containing-the-maximum-number-of-elements-consisting-only-of-1s
Basically trying to get the max sub matrix that contains…
Hemal
- 21
- 1
2
votes
1 answer
Numerical issues in solving linear systems
There was an exam in the class. The course is "High Performance Scientific Computing". One of the question in the exam is as follows:
Consider the linear system
$$ \begin{bmatrix} a & b \\ b & a \end{bmatrix} \times \begin{bmatrix} x \\ y…
tahasozgen
- 143
- 4
2
votes
1 answer
Select K columns from matrix and one element from each row that has maximum sum
Given matrix of size N x M (N- rows, M - columns), given integer value K(K < N and K < M). Select arbitrary K columns and create new matrix of size N x K after that select max element from each row and calculate sum - S. Task is to find such K…
user107098
2
votes
1 answer
Determine image of hypercube under linear map
Let $A$ be an $3\times N$ matrix (where $N$ is large) with nonnegative real entries. I'd like an algorithm for determining when a vector $v\in\Bbb R^3$ can be written as $Aw$ for some vector $w\in\Bbb R^N$ with each entry of $w$ in the range…
Oscar Cunningham
- 131
- 5
2
votes
1 answer
Lexicographically smallest down-right path in matrix
Here is the problem which I thought was simple dynamic programming, which is however not the case.
Given an $N \times M$ matrix of numbers from 1 to $NM$ (each number occurs only once), find a path from top left to right bottom while moving right…
user99043
2
votes
1 answer
What's the connection between the two "Fast Walsh Transform"?
First Let's take a look at the convolution $\displaystyle C _ { i } = \sum _ { j \oplus k = i } A _ { j } * B _ { k }$, and the $\oplus$represents any boolean operation. And we are able to evaluate $C$ in $O(n \log n)$ time, using an algorithm…
FFjet
- 229
- 1
- 5
1
vote
2 answers
Matrix multiplication randomised verification - error probability
Let s say we have an algorithm that takes as input 3 matrix A,B and C
$$ \text{Input} :A,B,C \in Mat(n\times n)$$
$$\text{Question} :\text{is } A\cdot B=C$$
the algorith works as follow ;
$$ \text{if }(A\cdot B)_{ij}=C_{ij} \Rightarrow A\cdot…
Mohbenay
- 319
- 2
- 10