• Complain

Serge Kruk - Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools

Here you can read online Serge Kruk - Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2018, publisher: Apress, genre: Children. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Serge Kruk Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools
  • Book:
    Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2018
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Discover the art and science of solving artificial intelligence problems with Python using optimization modeling. This book covers the practical creation and analysis of mathematical algebraic models such as linear continuous models, non-obviously linear continuous models,

and pure linear integer models. Rather than focus on theory, Practical Python AI Projects, the product of the authors decades of industry teaching and consulting, stresses the model creation aspect; contrasting alternate approaches and practical variations.

Each model is explained thoroughly and written to be executed. The source code from all examples in the book is available, written in Python using Google OR-Tools. It also includes a random problem generator, useful for industry application or study.

What You Will Learn

  • Build basic Python-based artificial intelligence (AI) applications

  • Work with mathematical optimization methods and the Google OR-Tools (Optimization Tools) suite

  • Create several types of projects using Python and Google OR-Tools

Who This Book Is For

Developers and students who already have prior experience in Python coding. Some prior mathematical experience or comfort level may be helpful as well.

Serge Kruk: author's other books


Who wrote Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools? Find out the surname, the name of the author of the book and a list of all author's works by series.

Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Serge Kruk 2018
Serge Kruk Practical Python AI Projects
1. Introduction
Serge Kruk 1
(1)
Mathematics, Oakland University Mathematics, Rochester, Michigan, USA
1.1 What Is This Book About?
Artificial intelligence is a wide field covering diverse techniques, objectives, and measures of success. One branch is concerned with finding provably optimal solutions to some well-defined problems.
This book is an introduction to the art and science of implementing mathematical models of optimization problems .
An optimization problem is almost any problem that is, or can be, formulated as a question starting with What is the best ? For instance,
  • What is the best route to get from home to work?
  • What is the best way to produce cars to maximize profit?
  • What is the best way to carry groceries home: paper or plastic?
  • Which is the best school for my kid?
  • Which is the best fuel to use in rocket boosters?
  • What is the best placement of transistors on a chip?
  • What is the best NBA schedule?
These questions are rather vague and can be interpreted in a multitude of ways. Consider the first: by best do we mean fastest, shortest, most pleasant to ride, least bumpy, or least fuel-guzzling? Besides, the question is incomplete. Are we walking, riding, driving, or snowboarding? Are we alone or accompanied by a screaming toddler?
To help us formulate solutions to optimization problems, optimizers have established a frame into which we mould the questions; its called a model . The most crucial aspect of a model is that it has an objective and it has constraints. Roughly, the objective is what we want and the constraints are the obstacles in our way. If we can reformulate the question to clearly identify both the objective and the constraints, we are closer to a model.
Lets consider in more detail the best route problem but with an eye to clarify objective and constraints. We could formulate it as
  • Given a map of the city, my home address, and the address of the daycare of my two-year-old son, what is the best route to take on my bike to bring him to daycare as fast as possible?
The goal is to find among all the solutions that satisfy the requirements (that is, paths following either streets or bike lanes, also known as the constraints) one path that minimizes the time it takes to get there (the objective).
Objectives are always quantities we want to maximize or minimize (time, distance, money, surface area, etc.), although you will see examples where we want to maximize something and minimize something else; this is easily accommodated. Sometimes there are no objectives. We say that the problem is one of feasibility (i.e. we are looking for any solution satisfying the requirements). From the point of view of the modeler, the difference is minimal. Especially since, in most practical cases, a feasibility model is usually a first step. After noticing a solution, one usually wants to optimize something and the model is modified to include an objective function.
1.2 Features of the Text
As this text is an introduction, I do not expect the reader to be already well versed in the art of modeling. I will start at the beginning, assuming only that the reader understands the definition of a variable (both in the mathematical sense and in the programming sense), an equation, an inequality, and a function . I will also assume that the reader knows some programming language, preferably Python , although knowing any other imperative language is enough to be able to read the Python code displayed in the text.
Note that the code in this book is an essential component . To get the full value, the reader must, slowly and attentively, read the code. This book is not a text of recipes described from a birds-eye view, using mathematical notation, with all the nitty-gritty details left as an exercise for the reader. This is implemented, functional, tested, optimization code that the reader can use and moreover is encouraged to modify to fully understand. The mathematics in the book has been reviewed by mathematicians, like any mathematical paper. But the code has been subjected to a much more stringent set of reviewers with names Intel, AMD, Motorola, and IBM.
The book is the fruit of decades of consulting and of years teaching both an introductory modeling class (MOR242 Intro to Operation Research Models) and a graduate class (APM568 Mathematical Modeling in Industry) at Oakland University. I start at the undergraduate level and proceed up to the graduate level in terms of modeling itself, without delving much into the attendant theory .
  • Every model is expressed in Python using Google OR- Tools ).
  • My intention is to help the reader become a proficient modeler, not a theoretician. Therefore, little of the fascinating mathematical theory related to optimization is covered. It is nevertheless used profitably to create simple yet efficient models.
  • The associated web site provides all the code presented in the book along with a random generator for many of the problems and variations. The author uses this as a personalized homework generator. It can also be used as a self-guided learning tool .
    https://github.com/sgkruk/Apress-AI
1.2.1 Running the Models
There is danger in describing in too much detail installations instructions because software tends to change more often than this text will change. For instance, when I started with Googles OR-Tools , it was hosted on the Google Code repository; now it is on GitHub. Nevertheless, here are a few pointers. All the code presented here has been tested with
  • Python 3 (currently 3.7), although the models will work on Python 2
  • OR-Tools 6.6
The page https://developers.google.com/optimization offers installation instructions for most operating systems. The fastest and most painless way is
pip install --upgrade ortools
Once OR-Tools are installed, the software of this text can be downloaded most easily by cloning the GitHub repo at
git clone https://github.com/sgkruk/Apress-AI.git
where the reader will find a Makefile testing almost all the models detailed in the text. The reader only has to issue a make to test that the installation was completed successfully.
The code of each section of the book is separated into two parts: a model proper, shown in the text, and a main driver to illustrate how to call the model with some data. For instance, the chapter corresponding to the set cover has a file named set_cover.py with the model and a file named test_set_cover.py which will create a random instance, run the model on it, and display the result. Armed with these examples, the reader should be able to modify to suit his needs. It is important to understand that the mainline is in test_set_cover.py and that file needs to be executed.
1.2.2 A Note on Notation
Throughout the book, I will describe algebraic models. These models can be represented in a number of ways. I will use two. I will sketch each model using common mathematical notation typeset with TEX in math mode. I will then express the complete, detailed model in executable Python code. The reader should have no problem seeing the equivalence between the formulations. Table illustrates some of the equivalencies.
Table 1-1
Equivalence of Expression in Math and Python Modes
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools»

Look at similar books to Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools»

Discussion, reviews of the book Practical Python AI Projects: Mathematical Models of Optimization Problems with Google OR-Tools and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.