Re: Convert funcion
- To: mathgroup at smc.vnet.net
- Subject: [mg88332] Re: Convert funcion
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Fri, 2 May 2008 03:42:01 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fvc620$9n2$1@smc.vnet.net>
Johum wrote: > Someone could help me with this function? > > fConver[cmatrix], this function will find all subsets of rows of the rectangular matrix which have exactly one nonzero element in each column. > > For example: > > cmatrix=({{0,0,1,0,1,1,0},{1,0,0,1,0,0,1},{0,1,1,0,0,1,0}, > {1,0,0,1,0,0,0},{0,1,0,0,0,0,1},{0,0,0,1,1,0,1}}); > > > fConvert[cmatrix] > > the out put will be > {{{1,4},{3,5,6},{2,7}}} Since you seem to have taken your "example" from the documentation of the Imtek`ExactCover` function, available at http://www.imtek.de/simulation//mathematica/IMSweb/imsTOC/Game%20Theory/ExactCoverDocu.html it is not clear why you would not use it as it is? Dis you try it? Did you face any difficulty or get any erroneous results? What would you do with such a function? Perhaps solving the Latin Square Puzzle or the Height Queens Puzzle? Regards, -- Jean-Marc