So I have an idea for a little pet project (disclaimer - my coding skills are almost entirely self-taught), for which the above would be a key part.
So a 'naive' algorithm might look something like:
Code:
Set flop=Desired flop cards
For each hand in hero's range
For each hand in villain's range
For each board runout (i.e turn and river)
Evaluate villain's hand
Evaluate hero's hand
Chalk up winner to relevant player
Next
Next
Next
etc
What I'd welcome any advice on is where I might get some efficiencies, and whether they are actually worth pursuing (i.e.the decreased solution time justifies the more complex algorithm). Some examples might be:
1) Using isomorphisms (if I have the term correct!) to reduce the number of evaluations - e.g. on a monotone flop, then all cards (either hole or turn/river) either match the board or don't, so on a flop with three hearts, all non-heart cards (of equal rank) have the same effect
2) Evaluating each players 5 player hand, and then only looking at turn and river cards that make a material difference
3) Change the nesting order of the three main loops above - e.g. calculate each 5 card board first and then cycle through the hole-card combinations
May be more I'm not thinking of......
Also, and tips for fast/efficient ways (or do's and don'ts) of managing the data would be much appreciated!
Thanks in advance...