Barbie is trying to implement a branch-and-bound algorithm to determine the best sleepover schedule, but she isn't making any progress. "I just don't know how to structure the algorithm - there are so many ways I could go about it!" says Barbie. "Have you worked out your loop invariants?" asked Skipper. "Once you've determined your loop invariants, the code writes itself!"