A family of six is crossing a river with a 2-passenger boat. The family includes the following members: Dad, Mom, Maid, Boy, Girl & Dog. Only the 3 adults can row the boat and the dog counts as a passenger.
The dog will bite if the maid is not present. Mom will fight with the boy if Dad is not present. Dad will fight with the girl if Mom is not present.
How can they all get across safely?
Answer using algorithm