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.

  • 1
    $\begingroup$ This sounds like a good problem, but it is not really research mathematics, but rather a complex programming task. $\endgroup$ – Per Alexandersson Mar 3 '17 at 21:46
  • 1
    $\begingroup$ You may have a better fit on cs.stackexchange. $\endgroup$ – AHusain Mar 3 '17 at 22:07

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., .

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.

  • $\begingroup$ Thanks for the feedback... I think a workable objective function would be (AirplaneLoadCapability - PassengersTotalWeight) * TripDistanceMultiple. I thought about enumerating all the solutions. It may work only because you could throw out a lot of possible permutations because of the primary constraint, which is the number of seats in the airplane. $\endgroup$ – Stephan Mar 4 '17 at 2:11
  • $\begingroup$ @Stephan, that gives you a number for each plane ride. But an assignment consists of many kids on many different routes and different plane rides. So, you'll need a way to combine all that to get a single number. Once you've settled on a specific objective function, why don't you post a new question asking about that particular objective function? $\endgroup$ – D.W. Mar 4 '17 at 2:22
  • 1
    $\begingroup$ (Separately: I wonder whether you really want to make AirplaneLoadCapability - PassengersTotalWeight as small as possible. It's not clear to me why anyone would care about that, as opposed to (say) total fuel cost or total distance travelled or something. Often objective functions quantify cost or time or inconvenience or something that people care about.) $\endgroup$ – D.W. Mar 4 '17 at 2:23

This is a combinatorial optimization problem which is in NP. The standard generic solution is simulated annealing: come up with ways to manipulate one solution to generate others (say by flipping two children from one plane to another, or swapping a plane for another) and a measure of optimality $\phi$. Then start with a solution, and try the ways to manipulate it. If they work better, keep them. If they don't, keep them with a probability proportional to $e^{-\phi/T}$ where $T$ is the temperature. Then slowly drop the temperature.

  • $\begingroup$ That sounds like a promising approach. I guess the question is, "How do you know when you're done?" Although, for these purposes, you could just stop as soon as you have a workable solution. $\endgroup$ – Stephan Mar 4 '17 at 2:12

It sounds like you have several objective criteria and system constraints to consider and they may change over time. A wide range of problems can be formulated and solved as Mixed Integer Programming (MIP) problems. One way to solve a MIP problem would be use to use the revised simplex method to solve linear programming problems and the branch-and-bound algorithm to find integer solutions (Bazaara; Jarvis and Sherali, 1990). If it turns out that the performance of this tandem algorithm is unacceptable using real information then at least you can use this as a basis for testing your newly designed and implemented special algorithm.

With this in mind you should gather and formulate all your criteria and constraints. Formulating MIP problems can be challenging. I found it very helpful to see and to practice on a few examples. Check out “Model Building in Mathematical Programming” (Williams, 1999).

Consider the possibility that several solutions (not necessarily optimal) are acceptable and the final solutions will be decided by a person or group of people rather than the computer. This is probably more desirable especially if stakeholders change their mind or events occur that affect the inputs to the model, thus affecting the solutions. In this case you should include in your design an interactive decision support system.

Are you considering other things such as user interfaces for entering input data and running scenarios, reports for system status, etc. If you have not decided on a platform or framework to code your software system then you should also consider your situation as a document workflow problem. Look at PDF forms using JavaScript and the Acrobat/JavaScript API as one way to satisfy your document workflow requirements (Adobe, 2012; 2007; Flanagan, 2006).


  1. Adobe Systems Incorporated. (2012). Adobe Acrobat XI [software]. San Jose, California: Adobe Systems Incorporated.
  2. Adobe Systems Incorporated. (2007). Adobe Acrobat SDK 8.1 JavaScript for Acrobat API Reference for Microsoft Windows and Mac OS. Edition 2.0, April 2007. San Jose, California: Adobe Systems Incorporated. Retrieved Aug. 3, 2010 from http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf.
  3. Bazaara, M. S., Jarvis, J. J. and Sherali, H. D. (1990). Linear Programming and Network Flows. New York: Wiley.
  4. Flanagan, D. (2006). JavaScript: The Definitive Guide, Fifth Edition. Sebastopol, CA: O’Reilly Media Inc.
  5. Williams, H.P. (1999). Model building in mathematical programming (4th ed.). New York (NY): John Wiley & Sons, Inc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.