build_balancing_problem function

Build the elements of balancing problems.