Finding Max Product in NxM Matrix Without Duplicate Rows/Cols

  • Context: Undergrad 
  • Thread starter Thread starter Chuck37
  • Start date Start date
  • Tags Tags
    Matrix Max Product
Click For Summary

Discussion Overview

The discussion revolves around finding an algorithm to determine the maximum product of M entries from an NxM matrix, ensuring that no two entries share the same row or column. The context includes algorithmic approaches and considerations regarding the nature of the matrix entries.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks a simple algorithm for finding M entries with the maximum product from an NxM matrix without sharing rows or columns.
  • Another participant asks for clarification on what "maximum product" refers to in this context.
  • A participant suggests that the maximum product could be the result of multiplying the greatest non-intersecting entries in the matrix, providing an example for clarity.
  • One contributor proposes starting with a brute force approach, especially if N and M are not too large, while also considering the potential for a more efficient algorithm.
  • Another participant expresses concern that the problem becomes significantly harder if the matrix contains both positive and negative values, suggesting that brute force may be the only solution in such cases.
  • A later reply clarifies that the matrix entries are probabilities, which are always positive, and mentions the current implementation of brute force while highlighting the need for a faster solution due to the large number of combinations.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best approach to solve the problem, and multiple viewpoints regarding the complexity and nature of the algorithm remain. There is uncertainty about the implications of having both positive and negative values in the matrix.

Contextual Notes

The discussion does not resolve the mathematical complexities involved in finding the maximum product, particularly regarding the handling of different types of matrix entries and the efficiency of proposed methods.

Chuck37
Messages
51
Reaction score
0
I'd like to find a simple algorithm to do the following.

If I have an NxM matrix, with N≥M, find the M entries with the maximum product that do not share a row or column.

It doesn't seem hard, but I'm not seeing it right off.
 
Mathematics news on Phys.org
Hey Chuck37.

I've never heard of the maximum product: can you outline what this corresponds to?
 
Wait, do you mean the maximum product as simply the result of multiplying the greatest non-intersecting plots of a MN matrix? Just to clarify

For example, in the 6-schematized matrix:

(1) (2)
(3) (4)
(5) (6)

the maximum product would be (5)(4) = 20 etc.
 
I'm not sure what it physically corresponds to, but it sounds like an interesting problem. :smile:

Well let's start with brute force. If N,M are not too large you could try all [itex]\frac{n!}{(n-m)!}[/itex] combinations.

There might be a nice neat algorithm that does this really cleanly, but if that "ideal" algorithm can't be found then modifying brute force to add heuristics might work out ok.
 
This sems a very hard problem if the matrix entries can be either positive or negative, because a positive maximum value might involve some negative elements of the matrix. It's hard to see how to solve that except by brute force.

If you want to think about more efficient searching strategies, it would probably be better to restruct the problem to positive numbers.
 
Sorry I'm just getting back to this after the weekend. The values inside are probabilities and thus always positive. I have brute force currently implemented, but when the matrix gets big, there are a lot of combinations and since I have to do it a lot, it adds up.

Maximum product was intended just how it sounds, the N entries that when multiplied together give the biggest values - with no entries sharing a row or column (the example from Alcatrace IV is right). At this point I'd be happy with something that is close most of the time since I need speed.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K