View Single Post
Old 8th August 2016, 11:24 AM
Brian.Samson's Avatar
Brian.Samson Brian.Samson is offline
Allowed in Sales
Join Date: Jun 2009
Member of: Pontefract, Doncaster Airgun Range
Location: Doncaster
Posts: 2,329

Originally Posted by Yorkshiretea View Post
I'm not sure if there's any truth in this but I always seem to shoot better when I'm with an AA or A Grade shooter, I seem to step up a bit more, could you put an algorithm that would spread the grades evenly Bri?

PS I've still got the face on
What does "More evenly" mean?

Do you mean that a C grade shooter should never be paired with an AA shooter? Should Piston shooters always be paired with other Piston shooters?

It's actually quite a tricky programming problem to solve - It's a bit like a giant Sudoku puzzle on a 25 x 3 grid.
The usual way of solving that type of problem is to use what they call a 'Backtracking' algorithm.. they can make your head hurt a bit when trying to code them up, especially when there's a lot of constraints to add in.

For solving Sudoku, it's a bit easier because the constraints are - no 3x3 square should contain the same number twice and no horizontal or vertical line should contain the same number twice and you always start out with some numbers that are already pre-filled. There's also always a perfect solution (actually, sometimes there's more than one solution).

But with a lane allocation problem - there are many more constraints involved and quite often there's never a perfect solution like there is in Sudoku.. so it's a matter of finding the 'best' solution if a perfect one isn't available.. and again you would need to define what that actually means - what's the 'best' wrong solution? What makes one wrong solution better than another wrong solution? You don't have that problem writing a backtracking algorithm for Sudoku.

That's quite a chunk of coding to do and not easy, especially with very woolly requirements like - can you make it a bit more even.

Last edited by Brian.Samson; 8th August 2016 at 11:30 AM.
Reply With Quote