Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Maximum sum dynamic programming technique for a n x n integer matrix
Maximum sum dynamic programming technique for a n x n integer matrix [message #1856566] Thu, 15 December 2022 13:18 Go to next message
Soham Mukherjee is currently offline Soham MukherjeeFriend
Messages: 7
Registered: June 2022
Junior Member
I'm having trouble comprehending the following question; if you could kindly assist me in understanding it, I'd be thankful. The query is:
Implement a dynamic programming algorithm for solving the following
problem. The input is an n × n matrix of integers. For the output: 
compute the largest sum of adjacent entries in horizontal, vertical,
diagonal, and anti-diagonal directions. Return as output the sum 
h + v + d + c (in suggestive notation) of those four auxiliary results.
The largest (or maximal) sum of an array consisting of only negative  
integers are 0; that is, in that case, we select the empty subarray.
A (small) example input matrix with solution 45:
|-2 5 3 2|
|9 -6 5 3|
|1 -8 2 -3|
|-1 2 -5 2|

I read on this page that for the greatest amount of vertical entries, I should add up each item in a row and get the sum of them. For horizontal, add up the items in each column and seek for the maximum of those four.
Is that right? I mean, if someone could kindly point me in the correct way, I would be eternally thankful!!! Thanks
Re: Maximum sum dynamic programming technique for a n x n integer matrix [message #1856569 is a reply to message #1856566] Thu, 15 December 2022 17:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is not a question about the usage of Eclipse's Java Development Tools.

It looks just like this question:

https://stackoverflow.com/questions/39987016/dynamic-programming-algorithm-for-n-x-n-matrix-of-integers-to-find-maximum-sum

Coincidence? Not likely. Copy and paste? Most likely...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Usage Incremental Compiler
Next Topic:Configure Java 17 in Eclipse IDE
Goto Forum:
  


Current Time: Thu Apr 25 05:46:11 GMT 2024

Powered by FUDForum. Page generated in 0.02423 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top