Click here to Skip to main content
15,889,462 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: ceiling function bitwise operation [Solved] Pin
econy20-Nov-13 9:23
econy20-Nov-13 9:23 
QuestionSpiral Function Pin
push_coder30-Oct-13 18:41
push_coder30-Oct-13 18:41 
AnswerRe: Spiral Function Pin
Bernhard Hiller31-Oct-13 1:26
Bernhard Hiller31-Oct-13 1:26 
AnswerRe: Spiral Function Pin
Alan Balkany31-Oct-13 11:22
Alan Balkany31-Oct-13 11:22 
QuestionRandom Triangular Matrix Pin
Kyudos28-Oct-13 11:50
Kyudos28-Oct-13 11:50 
AnswerRe: Random Triangular Matrix Pin
BillWoodruff29-Oct-13 5:29
professionalBillWoodruff29-Oct-13 5:29 
GeneralRe: Random Triangular Matrix Pin
Kyudos29-Oct-13 14:01
Kyudos29-Oct-13 14:01 
QuestionPicking persons in a group algorithm Pin
Eduard Keilholz27-Oct-13 21:50
Eduard Keilholz27-Oct-13 21:50 
Hey guys!
Recently I posted this question "Picking entities from a group[^]" on the codeproject. I was advised to move it to this forum because some of you clever ones may have a way to go.

My problem is that I have a group of n people (in my example I said 8 but let's say a minimum of four). I want each person in the group to point to a different person in the group. This means no person can point to himself. Also if a person points to some person in the group, no other person in the group can point to the same person. So everyone in the group must point to a person, and everyone in the group is pointed at. I also want the process to be random.

For now I've already done this by creating a generic list of 'allowed' persons, pick a random person from the list, remove that person from the list and so on.

Now here comes the difficult part..
I also want to be able to configure impossible combinations. Like Person A cannot point to Person B and Person B cannot point to Person A.

This makes the process way more difficult. I'd like to have the ability to test whether a certain configuration is possible and to only pick between these possible 'combination sets'.

My solution now, is a trial on error method. I start a large loop and start to random picking just like above. I generate a list of possibilities and pick one of the possibilities. If the list of possibilities happens to be empty, that means I ran into an impossible 'combination set' and start the entire process again. If the picking fails a certain number of times, I assume the configuration is impossible.

As you understand my solution for now isn't ideal, 'cause there's no way to check whether a configuration is possible and if my picking routine tells me the configuration is not possible you're not actually sure the config is not possible.

I think I got my problem explained well as my English is fairly good but way from perfect. Hope you guys can point me in a good direction.

Thanks! Eduard
.: I love it when a plan comes together :.

AnswerRe: Picking persons in a group algorithm Pin
Chris Losinger28-Oct-13 6:01
professionalChris Losinger28-Oct-13 6:01 
SuggestionRe: Picking persons in a group algorithm Pin
Richard Deeming28-Oct-13 12:57
mveRichard Deeming28-Oct-13 12:57 
AnswerRe: Picking persons in a group algorithm Pin
Richard Deeming29-Oct-13 2:45
mveRichard Deeming29-Oct-13 2:45 
GeneralRe: Picking persons in a group algorithm Pin
BillWoodruff29-Oct-13 5:22
professionalBillWoodruff29-Oct-13 5:22 
Questionusing genetic algorithms to improve voice commands recognition Pin
Member 997361615-Oct-13 0:24
Member 997361615-Oct-13 0:24 
QuestionHow to Remove duplicate files rapidly? Pin
happy liu7-Oct-13 22:35
professionalhappy liu7-Oct-13 22:35 
AnswerRe: How to Remove duplicate files rapidly? Pin
jschell8-Oct-13 10:28
jschell8-Oct-13 10:28 
GeneralRe: How to Remove duplicate files rapidly? Pin
happy liu8-Oct-13 14:51
professionalhappy liu8-Oct-13 14:51 
AnswerRe: How to Remove duplicate files rapidly? Pin
Manfred Rudolf Bihy9-Oct-13 0:14
professionalManfred Rudolf Bihy9-Oct-13 0:14 
GeneralRe: How to Remove duplicate files rapidly? Pin
happy liu9-Oct-13 16:44
professionalhappy liu9-Oct-13 16:44 
GeneralRe: How to Remove duplicate files rapidly? Pin
Manfred Rudolf Bihy9-Oct-13 16:51
professionalManfred Rudolf Bihy9-Oct-13 16:51 
GeneralRe: How to Remove duplicate files rapidly? Pin
happy liu9-Oct-13 16:52
professionalhappy liu9-Oct-13 16:52 
GeneralRe: How to Remove duplicate files rapidly? Pin
saephoed8-Jan-14 12:50
saephoed8-Jan-14 12:50 
AnswerRe: How to Remove duplicate files rapidly? Pin
Kornfeld Eliyahu Peter9-Oct-13 0:50
professionalKornfeld Eliyahu Peter9-Oct-13 0:50 
GeneralRe: How to Remove duplicate files rapidly? Pin
happy liu9-Oct-13 16:42
professionalhappy liu9-Oct-13 16:42 
GeneralRe: How to Remove duplicate files rapidly? Pin
Kornfeld Eliyahu Peter10-Oct-13 1:10
professionalKornfeld Eliyahu Peter10-Oct-13 1:10 
AnswerRe: How to Remove duplicate files rapidly? Pin
Chris Losinger10-Oct-13 5:05
professionalChris Losinger10-Oct-13 5:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.