Re: [PHP] Algorithm Help

2013-10-03 Thread Floyd Resler


On Oct 2, 2013, at 6:23 PM, Tamara Temple  wrote:

> 
> On Oct 2, 2013, at 9:05 AM, Marc Guay  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
>> 
> 
> Well played! (.. eying the black suit…. "What's that funny stick you're 
> hol….")
> 
> 
> 

I love it! Our director loved it too!  Too funny!

Thanks!
Floyd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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  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, the idea is for the system to put together kids
> who have stayed with each other the least on past weekends.  So, if a host
> family can keep 5 kids, then the group of 5 kids who have stayed together
> the least will be chosen.
>
> I can't think of an easy, quick way to accomplish this.  I've tried
> various approaches that have resulted in a lot of coding and being very
> slow.  My idea was to give each group of kids a score and the lowest score
> is the group that is selected.  However, this approach wound of iterating
> through several arrays several times which was really slow.  Does anyone
> have any ideas on this puzzle?
>
> Thanks!
> Floyd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Nickolas Whiting
Freelance Consultant