Preface

This book covers using R for doing optimization, a key area of operations research, which has been applied to virtually every industry. The focus is on linear and mixed integer optimization.

Pedagogically, since the late 1990s, I had been a proponent of teaching introductory optimization using spreadsheets as a way to bridge the barrier between data and applications as well as teaching better spreadsheet practices. While this worked well, the disconnect with algebraic modeling was always a problem. Excel add-ins enabling algebraic tools were rich but not seamless. In 2018, I decided to switch to R for a variety of reasons:

  • With the rapid rise of interest in data analytics, it became important to introduce a data analytics platform.
  • Working technology and business professionals should have an awareness of the tools and language of data analysis to deal with consultants, data scientists, and others.
  • New software and extensions reduced the barrier to entry for people to start using data analytics tools.

Philosophically, the book emphasizes creating a formulations before going into implementation. This is important for the following reasons:

  • Reading the literature is based on the algebraic representation.
  • An algebraic representation allows for clear understanding and generalization of large applications.
  • Writing formulations is necessary to explain and convey the modeling decisions made.
  • Becoming proficient in the mathematical language used will be transferable to other analytical models.
  • Dividing the modeling stage from the implementation enables better debugging of models avoids what is sometimes referred to as spaghetti code in programming.
  • Separating the enables the reader to readily transition to another language for implementation in the future (ex. Python, Julia, AMPL, GAMS) with what will seem like little more than a dialect change.

Intended Audience

This book is written for people with at least a passing familiarity with R or another programming environment but Appendix A helps jumpstart the motivated reader to jump in without a background. Some familiarity with mathematics is used throughout the book at the level of subscripts and summations but refreshers are provided in Appendix B. It is assumed that the reader is willing to use R and get their hands dirty with experimenting.

Features of this Book

  • Providing and explaining code, sometimes repeated in different places so that examples are relatively clear and self-contained.
  • An emphasis on creating algebraic formulations before implementing.
  • A focus on application rather than algorithmic details.
  • Embodying the philosophy of reproducible research - the book is regularly rebuilt with all analyses automatically rerun and most tables and figures rebuilt.
  • Making use of open source tools for analysis to ensure the readers have permanent access to powerful optimization tools.
  • Contributing to the open source community - all materials are available on the author’s github repository.
  • Demonstrating common debugging practices with a troubleshooting emphasis specific to optimization modeling using R.
  • Providing code chunks liberally that readers can adapt to their own applications.

Instructor Notes

This book has been used multiple times for a ten week graduate course on operations research emphasizing optimization. It can be used for graduate and undergraduate courses for people without a background in optimization and varying levels of mathematical backgrounds. The focus is on applications (formulating, implementing, and interpreting rather than algorithms. The book could be used as a supplement in a more theoretical or algorithm-oriented class.

Acknowldegements

I would like to thank many people for their contributions, collaborations, and assistance over the years. All errors are my fault though.

  • Dirk Schumacher, author of the ompr package used throughout this book
  • Dr. Dong-Joon Lim, applications and methodological work in DEA
  • Dr. Gerry Williams, application of DEA to construction contracting
  • Dr. Janice Forrester, application of DEA to the energy industry
  • Dr. Scott Leavengood, application of DEA to wood products
  • Dr. Oliver (Lane) Inman, early work on TFDEA
  • Dr. Maoloud Dabab, many suggestions over time
  • Dr. K. Louis Luangkesorn, author of the first vignette on using glpk in R
  • Dr. Chester Ismay, contributions to the Portland and broader R community
  • Dr. Jili Hu, rich interactions during his sabbatical in Portland
  • Dr. Nina Chaichi, many suggestions over the years
  • Tom Shott, primary author of the TFDEA package
  • Aurobindh Kalathil Kumar, PhD student, many suggestions over time
  • Kevin van Blommestein, earlier DEA & R work
  • William (Ike) Eisenhauer, LaTeX formulation improvements
  • Andey Nunes, coding improvements
  • Christopher Davis, graphical example of LP
  • Thanh Thuy Nguyen, fixed charge example
  • Roland Richards, formatting assistance
  • Caroline Blackledge, contributed to appendix
  • Alexander Keller, contributed to appendix
  • Shahram Khorasanizadeh, contributed to appendix
  • Jose Banos, formatting assistance
  • Jon Syverson, frequent and thoughtful feedback on early drafts
  • Dawei Zhang, further editorial work on the book
  • Navdeep Singh, assistance with formatting and additional exercises
  • Ketsaraporn Kaewkhiaolueang, assistance with proofreading

In addition, several groups have been of tremendous help:

  • The Portland Meetup, R User’s Group
  • The Extreme Technology Analytics Research Group
  • Past ETM 540/640 Operations Research classes and in particular, the 200 students since 2019 that have used drafts of this book.
  • My advisors and mentors from Georgia Tech, Dr. Gunter Sharp and Dr. Ronald Bohlander.

Most of all, I would like to also express my appreciation for my family’s patience while working on this book with many late nights: Carrie, Trent, and Paige.

Tim Anderson
2021-12-23