An interesting side problem to the bridge crossing puzzle is to find and generate all the possible ways of crossing the bridge under the constraints of the puzzle.
Here's how it can be solved.