Yes this could actually work thanks, I only need to iterate over all
the possible permutations of the first partition and combine it, still
certainly a lot less stuff to compute.

2015-10-05 12:08 GMT+01:00 Franklin M. Siler <m...@franksiler.com>:
> On Oct 5, 2015, at 0545, andrea crotti <andrea.crott...@gmail.com> wrote:
>
>> Any idea how to make this faster?
>> Other advices on the code are welcome as well..
>
> Why not generate the the possible left-hand teams and then cartesian product 
> with the leftover players?  E.g., if you want to match 2 on 2 and have 
> players A B C D E:
>
> (A,B) cartesian product with (combinations #{C D E})
> (B,C) cartesian product with (combinations #{A D E})
> and so on with
> (C,D)
> (D,E)
>
> I think this will generate each possible match exactly twice- mirror images 
> of each other, but proof is left as an exercise for the reader.
>
> I would imagine there is a better algorithm for this than mine.
>
> Cheers,
>
> Frank Siler
> Siler Industrial Analytics
> 314.799.9405
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to