Question: The matrix alignment problem ( MA ) accepts two square matrices A ( size m m and size n n containing positive integers, where m

The matrix alignment problem (MA) accepts two square matrices A(size
mm and size nn containing positive integers, where mn, and
it outputs a row and column i and j so that positioning A[0,0] over B[i,j],
multiplying the overlapped numbers, and adding the products gives the
largest possible sum. For example, if we consider the problem where
A=[1221], and ,B=[314225613],
The four most likely solutions are (i,j)=(0,0),(0,1),(1,0), and (1,1),
which yield product-sums of:
Note that it is possible to choose "misalignments" like (i,j)=(0,-1) or
(0,2); however, all values of B that are out of bounds are considered to
be 0. For this problem, the optimum alignment is i=1 and j=0, with
a value of 19.
Give pseudocode for a greedy algorithm to solve MA. Your algorithm must
be greedy, though it does not need to be correct.
 The matrix alignment problem (MA) accepts two square matrices A(size mm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!