ebook img

Optimization Modelling Using R PDF

299 Pages·2022·9.079 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Optimization Modelling Using R

Optimization Modeling Using R Chapman & Hall/CRC Series in Operations Research Series Editors: Malgorzata Sterna, Bo Chen, Michel Gendreau, and Edmund Burke Rational Queueing Refael Hassin Introduction to Theory of Optimization in Euclidean Space Samia Challal Handbook of The Shapley Value Encarnación Algaba, Vito Fragnelli and Joaquín Sánchez-Soriano Advanced Studies in Multi-Criteria Decision Making Sarah Ben Amor, João Luís de Miranda, Emel Aktas, and Adiel Teixeira de Almeida Handbook of Military and Defense Operations Research Natalie Scala, and James P. Howard II Understanding Analytic Hierarchy Process Konrad Kulakowski Introduction to Optimization-Based Decision Making João Luís de Miranda Applied Mathematics with Open-source Software Operational Research Problems with Python and R Vince Knight, Geraint Palmer Optimization Modeling Using R Timothy R. Anderson For more information about this series please visit: https://www.routledge.com/ Chapman--HallCRC-Series-in-Operations-Research/book-series/CRCOPSRES Optimization Modeling Using R Timothy R. Anderson First edition published 2023 by CRC Press 6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742 and by CRC Press 4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN © 2023 CRC Press CRC Press is an imprint of Taylor & Francis Group, LLC Reasonable efforts have been made to publish reliable data and information, but the author and pub- lisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, access www.copyright. com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact mpkbookspermis- [email protected] Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for identification and explanation without intent to infringe. ISBN: 978-0-367-50789-3 (hbk) ISBN: 978-1-032-29076-8 (pbk) ISBN: 978-1-003-05125-1 (ebk) DOI: 10.1201/9781003051251 Typeset in LM Roman by KnowledgeWorks Global Ltd. Publisher’s note: This book has been prepared from camera-ready copy provided by the authors To Carrie, Trent, and Paige for their constant support and patience while Dad worked late nights on this book. Contents List of Figures xiii List of Tables xv Preface xix Author xxiii 1 Introduction 1 1.1 What is Operations Research . . . . . . . . . . . . . . . . . . . 1 1.2 Purpose of this Book . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Range of Operations Research Techniques . . . . . . . . . . . . 2 1.4 Relationship between Operations Research and Analytics . . . 3 1.5 Importance of Optimization . . . . . . . . . . . . . . . . . . . . 3 1.6 Why R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.7 Conventions Used in this Book . . . . . . . . . . . . . . . . . . 6 2 Introduction to Linear Programming 7 2.1 What Is Linear Programming . . . . . . . . . . . . . . . . . . . 7 2.2 Two Variable Base Case . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Graphically Solving a Linear Program . . . . . . . . . . . . . . 9 2.4 Implementing and Solving with ompr . . . . . . . . . . . . . . . 14 2.4.1 Preparing to Implement the Linear Program . . . . . . 14 2.4.2 Implementing the Base Case with Piping . . . . . . . . 20 2.5 Adding a Third Product (Variable) . . . . . . . . . . . . . . . . 22 2.5.1 Three Variable Base Case Formulation . . . . . . . . . . 22 2.5.2 Three Variable Base Case Implementation . . . . . . . . 23 2.5.3 Three Variable Case Results and Interpretation . . . . . 24 2.6 Linear Programming Special Cases . . . . . . . . . . . . . . . . 24 2.6.1 Case 1: No Feasible Solution . . . . . . . . . . . . . . . 25 2.6.2 Case 2: Multiple Optima. . . . . . . . . . . . . . . . . . 26 2.6.3 Case 3: Redundant Constraint . . . . . . . . . . . . . . 30 2.6.4 Case 4: Unbounded Solution . . . . . . . . . . . . . . . 31 2.7 Abstracting the Production Planning Model . . . . . . . . . . . 33 2.8 Methods of Solving Linear Programs . . . . . . . . . . . . . . . 34 2.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 vii viii Contents 3 More Linear Programming Models 39 3.1 Types of LP Models . . . . . . . . . . . . . . . . . . . . . . . . 39 3.2 The Algebraic Model . . . . . . . . . . . . . . . . . . . . . . . . 39 3.2.1 Tips and Conventions for Algebraic Models . . . . . . . 40 3.2.2 Building the Generalized Model in R . . . . . . . . . . . 41 3.2.3 Examining the Results . . . . . . . . . . . . . . . . . . . 44 3.2.4 Changing the Model . . . . . . . . . . . . . . . . . . . . 46 3.3 Common Linear Programming Applications . . . . . . . . . . . 47 3.3.1 Blending Problems . . . . . . . . . . . . . . . . . . . . . 47 3.4 Allocation Models . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.4.1 Covering Models . . . . . . . . . . . . . . . . . . . . . . 51 3.4.2 Transportation Models . . . . . . . . . . . . . . . . . . . 53 3.4.3 Transshipment Models . . . . . . . . . . . . . . . . . . . 57 3.4.4 Production and Inventory Planning . . . . . . . . . . . 59 3.4.5 Standard Form . . . . . . . . . . . . . . . . . . . . . . . 60 3.5 Vector and Matrix Forms of LPs . . . . . . . . . . . . . . . . . 63 3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4 Sensitivity Analysis 71 4.1 Base Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.2 Shadow Prices . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.2.1 Extraction and Interpretation . . . . . . . . . . . . . . . 72 4.2.2 Example of Adding an Hour to Assembly . . . . . . . . 74 4.2.3 Shadow Prices of Underutilized Resources . . . . . . . . 75 4.3 Reduced Costs of Variables . . . . . . . . . . . . . . . . . . . . 76 4.3.1 Reduced Cost of Ants . . . . . . . . . . . . . . . . . . . 77 4.3.2 Reduced Price of Bats . . . . . . . . . . . . . . . . . . . 79 4.4 Using Sensitivity Analysis to Evaluate a New Product . . . . . 81 4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 5 Data Envelopment Analysis 85 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5.2 Creating the Data . . . . . . . . . . . . . . . . . . . . . . . . . 86 5.3 Graphical Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.4 The Linear Programs for DEA . . . . . . . . . . . . . . . . . . 90 5.4.1 An Explicit Linear Program for DEA . . . . . . . . . . 90 5.4.2 A Generalized Linear Program for DEA . . . . . . . . . 91 5.5 Creating the LP – The Algebraic Approach . . . . . . . . . . . 93 5.6 Returns to Scale . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5.7 Multiple Inputs and Multiple Outputs . . . . . . . . . . . . . . 105 5.8 Extracting Multiplier Weights from Sensitivity Analysis . . . . 113 5.9 Slack Maximization. . . . . . . . . . . . . . . . . . . . . . . . . 116 5.10 DEA Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 5.11 DEA Model Building . . . . . . . . . . . . . . . . . . . . . . . . 119 5.11.1 Selection of Inputs and Outputs . . . . . . . . . . . . . 120 Contents ix 5.11.2 Model Choices . . . . . . . . . . . . . . . . . . . . . . . 121 5.11.3 Application Area Expertise . . . . . . . . . . . . . . . . 121 5.12 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.13 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 6 Mixed Integer Optimization 125 6.1 Example of Minor Integrality Impact . . . . . . . . . . . . . . . 125 6.2 Example of Major Integality Impact . . . . . . . . . . . . . . . 128 6.3 The Branch and Bound Algorithm . . . . . . . . . . . . . . . . 130 6.3.1 The LP Relaxation . . . . . . . . . . . . . . . . . . . . . 131 6.3.2 Subproblem I . . . . . . . . . . . . . . . . . . . . . . . . 132 6.3.3 Subproblem III . . . . . . . . . . . . . . . . . . . . . . . 133 6.3.4 Subproblem IV . . . . . . . . . . . . . . . . . . . . . . . 135 6.3.5 Subproblem V . . . . . . . . . . . . . . . . . . . . . . . 136 6.3.6 Subproblem VI . . . . . . . . . . . . . . . . . . . . . . . 136 6.3.7 Subproblem VII . . . . . . . . . . . . . . . . . . . . . . 138 6.3.8 Subproblem VIII . . . . . . . . . . . . . . . . . . . . . . 139 6.3.9 Subproblem II . . . . . . . . . . . . . . . . . . . . . . . 139 6.4 Computational Complexity . . . . . . . . . . . . . . . . . . . . 141 6.4.1 Full Enumeration . . . . . . . . . . . . . . . . . . . . . . 142 6.5 Binary Variables and Logical Relations . . . . . . . . . . . . . . 143 6.6 Fixed Charge Models . . . . . . . . . . . . . . . . . . . . . . . . 146 6.6.1 Fixed Charge Example-Introduction . . . . . . . . . . . 147 6.6.2 Linking Constraints with “Big M” . . . . . . . . . . . . 151 6.6.3 Fixed Charge Implementation . . . . . . . . . . . . . . . 154 6.7 Model Results and Interpretation . . . . . . . . . . . . . . . . . 155 7 More Integer Programming Models 157 7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 7.2 Revisiting the Warehouse Location Problem . . . . . . . . . . . 157 7.2.1 Implementing the Warehouse Model . . . . . . . . . . . 159 7.2.2 Solving the Warehouse Location Problem . . . . . . . . 165 7.2.3 Warehouse Discussion . . . . . . . . . . . . . . . . . . . 172 7.3 Solving MIPs with Different Solvers . . . . . . . . . . . . . . . 173 7.3.1 Performance of glpk . . . . . . . . . . . . . . . . . . . . 173 7.3.2 Performance of symphony . . . . . . . . . . . . . . . . . . 174 7.3.3 Performance of lpsolve . . . . . . . . . . . . . . . . . . 177 7.3.4 Performance of gurobi . . . . . . . . . . . . . . . . . . . 178 7.3.5 Comparing Results across Solvers . . . . . . . . . . . . . 179 7.3.6 Popularity of LP Solvers . . . . . . . . . . . . . . . . . . 181 7.4 Solving Sudoku Puzzles using Optimization . . . . . . . . . . . 184 7.4.1 Introduction to Sudoku and Optimization . . . . . . . . 184 7.4.2 Formulating the Sudoku Problem . . . . . . . . . . . . . 185 7.4.3 Implementing Sudoku in ompr . . . . . . . . . . . . . . 187 7.4.4 Sudoku Discussion . . . . . . . . . . . . . . . . . . . . . 192

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.