MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Maximising a sum of matrix elements


In article <dfiv7u$p8n$1 at smc.vnet.net>,
 Colin Pratt <coke101 at blueyonder.co.uk> wrote:

> Given a n x n matrix with positive entries, find the maximum sum involving 
> one and only one entry from each row and column. 

For any square matrix mat,

  MaxSum[mat_?MatrixQ] := Max[Tr /@ Permutations[mat]]

> Is there a simple way to enumerate the n! possible sums?

Yes. 

  Permutations[mat]

does what you want.

The following links may be of interest to you:

  http://answers.google.com/answers/threadview?id=485314
  http://hydrogen.ws.binghamton.edu/~qqiu/thermal/00736189.pdf

Cheers,
Paul

_______________________________________________________________________
Paul Abbott                                      Phone:  61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    
AUSTRALIA                               http://physics.uwa.edu.au/~paul


  • Prev by Date: Re: Why this function does not return a single value
  • Next by Date: Re: Abs[ ] traditional form
  • Previous by thread: Re: Re: Maximising a sum of matrix elements
  • Next by thread: Re: Maximising a sum of matrix elements