Need help optimizing the loading of passengers on small airplanes I work for a small non-profit that provides transportation for people who need medical treatment. We connect volunteer private pilots who fly people in their own (small) aircraft, typically 3-5 seats.

Several times each year, we provide flights for kids to go to special needs camps. In this scenario, we have a number of kids (say 20-30) going from multiple origins to one destination, and several pilots who have expressed an interest in flying one of the routes. We'd like to create an algorithm to optimize the loading and travel of each aircraft. The number of seats is a constraint, in other words, we can't have more passengers than there are seats. Optimizing loading would mean (I think) minimizing the difference between the airplane's load capability and the total weight of the passengers. A second factor would be how far the pilot would need to go out of their way to complete the trip, based on where the plane is based. For that, we can look at a multiple of the trip distance. So, if the plane is based at either the origin or the destination of the route, the multiple would be 1 (total distance divided by trip distance), whereas the multiple will grow the more they have to go out of their way.

I'm a programmer and not a mathematician, and I would love to have any guidance anyone is willing to provide as to an approach.
This is an optimization problem.

The first step is to work out more precisely what your objective function is.  In other words, given a candidate assignment of pilots, you need a well-specified way to compute a single "goodness value" for that assignment.  That's your objective function: an objective function maps a candidate solution to a number indicating how good the candidate solution is.  Once you have defined an objective function, you then have a well-defined optimization problem.

Right now, it sounds like you haven't yet settled on a specific objective function.  You mention some possible factors, but the question isn't completely precise about how exactly those factors should be measured or how to weight the individual factors and combine them to get a single number.  Generally you can't solve the optimization problem until you formulate an objective function that gives you a single number (otherwise the notion of a "best" solution isn't well-defined).

Once you can do that, you could look at expressing this as an integer linear programming problem.  See, e.g., integer-programming.

The kind of problem you mention generally falls into the field known as "operations research".

Alternatively, with only 15-20 kids, you might even be able to write a program that exhaustively enumerates all candidate solutions and scores each one.  There will be exponentially many candidate solutions but if the number of kids is small enough it might be feasible to enumerate them all.  15-20 kids is probably on the edge of what could be computed in a reasonable amount of time, so this might fail badly, and you might need to resort to combinatorial optimization methods, such as integer linear programming.