Re: [PHP] Algorithm Help

2013-10-20 Thread Ayush Ladia
Hi, Indeed making and maintaining the graph looks like the best approach here to tackle this problem , but what does not seem clear to me is this -- Suppose a family can host 5 children , then you need to find the set of 5 such nodes out of the total no. of nodes(assume 10) such that the total

Re: [PHP] Algorithm Help

2013-10-20 Thread German Geek
You don't need to maintain the history of which kids stay where unless you want to for other reasons. You just need to find the children that have staid the least amount of time together, which this approach would do for you. So, when 4 children stay together you say 1 together with 2 1 together

Re: [PHP] Algorithm Help

2013-10-03 Thread Floyd Resler
On Oct 2, 2013, at 6:23 PM, Tamara Temple tamouse.li...@gmail.com wrote: On Oct 2, 2013, at 9:05 AM, Marc Guay marc.g...@gmail.com wrote: If you have the technology handy, it could also just be easier to wipe the children's memories after each stay. Marc -- PHP General Mailing

Re: [PHP] Algorithm Help

2013-10-03 Thread Nickolas Whiting
Round Robin algorithm should solve this and is a fairly quick alogrithm ... http://en.wikipedia.org/wiki/Round-robin An example can be found http://forrst.com/posts/PHP_Round_Robin_Algorithm-2zm On Tue, Oct 1, 2013 at 2:51 PM, Floyd Resler fres...@adex-intl.com wrote: Here's my task: A group

Re: [PHP] Algorithm Help

2013-10-02 Thread Tamara Temple
On Oct 1, 2013, at 1:51 PM, Floyd Resler fres...@adex-intl.com wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying with a host family can range from 2 to 10. When deciding which kids should

Re: [PHP] Algorithm Help

2013-10-02 Thread Stuart Dallas
On 1 Oct 2013, at 19:51, Floyd Resler fres...@adex-intl.com wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying with a host family can range from 2 to 10. When deciding which kids should stay

Re: [PHP] Algorithm Help

2013-10-02 Thread Serge Fonville
It also depends on the amount of kids, families and stays. If the numbers are low, by hand may be a lot easier and faster Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl 2013/10/2 Tamara Temple tamouse.li...@gmail.com On Oct 1, 2013, at 1:51 PM, Floyd

Re: [PHP] Algorithm Help

2013-10-02 Thread Floyd Resler
On Oct 2, 2013, at 9:51 AM, Tamara Temple tamouse.li...@gmail.com wrote: On Oct 1, 2013, at 1:51 PM, Floyd Resler fres...@adex-intl.com wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying

Re: [PHP] Algorithm Help

2013-10-02 Thread Marc Guay
If you have the technology handy, it could also just be easier to wipe the children's memories after each stay. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Algorithm Help

2013-10-02 Thread Tamara Temple
On Oct 2, 2013, at 9:05 AM, Marc Guay marc.g...@gmail.com wrote: If you have the technology handy, it could also just be easier to wipe the children's memories after each stay. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Algorithm Help

2013-10-01 Thread John Meyer
On 10/1/2013 12:51 PM, Floyd Resler wrote: Here's my task: A group of kids is going to be staying with different host families throughout the next 8 months. The number of kids staying with a host family can range from 2 to 10. When deciding which kids should stay together at a host family,

Re: [PHP] Algorithm Help

2013-10-01 Thread Aziz Saleh
DB or flatfile? I would create a matrix of all kids crossed with every kid. Everytime a kid is put in a home with another kid, ++ that index. When dispatching kids, sort by index ASC. Aziz On Tue, Oct 1, 2013 at 3:01 PM, John Meyer johnme...@pueblocomputing.comwrote: On 10/1/2013 12:51 PM,

Re: [PHP] Algorithm Help

2013-10-01 Thread Ashley Sheridan
On Tue, 2013-10-01 at 15:09 -0400, Aziz Saleh wrote: DB or flatfile? I would create a matrix of all kids crossed with every kid. Everytime a kid is put in a home with another kid, ++ that index. When dispatching kids, sort by index ASC. Aziz On Tue, Oct 1, 2013 at 3:01 PM, John

Re: [PHP] Algorithm Help

2013-10-01 Thread Floyd Resler
m 1375 GLENDALE MILFORD RD., CINCINNATI, OH 45215 On Oct 1, 2013, at 3:14 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2013-10-01 at 15:09 -0400, Aziz Saleh wrote: DB or flatfile? I would create a matrix of all kids crossed with every kid. Everytime a kid is put in a

Re: [PHP] Algorithm Help

2013-10-01 Thread Serge Fonville
Assuming you don't have to be exact, somthing similar to this might work. Assign each kid to a host family randomly for each kid, check how frequently it has been combined with the kids in its assigned family. if it is too close, swap with a different family when all kids in that family are