appendix-a

Appendix A. Search and Optimization Libraries in Python

 

This appendix covers

  • Setting up the Python environment
  • Mathematical programming solvers
  • Graph and mapping Libraries
  • Metaheuristics Optimization Libraries
  • Machine Learning Libraries

A.1 Setting up the Python environment

This book assumes that you already have Python 3.6 or newer installed on your system. For installation instructions specific to your operating system, see this Beginner’s Guide: https://wiki.python.org/moin/BeginnersGuide/. For Windows, you can follow these steps to install Python:

  • Step 1: Go to the official website: https://www.python.org/downloads/
  • Step 2: Select version of Python to install
  • Step 3: Download Python executable installer
  • Step 4: Run executable installer. Make sure you select the Install launcher for all users and Add Python 3.8 to PATH checkboxes.
  • Step 5: Verify Python was successfully installed by typing python –V in a command prompt
  • Step 6: Verify Pip was installed by typing pip -V in a command prompt
  • Step 7: Install virtualnv by typing pip install virtualenv in a command prompt

If you are a Linux user, in the terminal, execute the following commands:

$ sudo apt update
$ sudo apt install python3-pip

Install venv and create a python virtual environment:

$ sudo apt install python3.8-venv
$ mkdir <new directory for venv>
$ python -m venv <path to venv directory>

A.1.1 Using a Python distribution

A.1.2 Installing Jupyter Notebook and JupyterLab

A.1.3 Cloning book repository

A.2 Mathematical Programming Solvers

A.2.1 SciPy

A.2.2 PuLP

A.3 Graph and Mapping Libraries

A.3.1 networkx

A.3.2 osmnx

A.3.3 GeoPandas

A.3.4 contextily

A.3.5 folium

A.3.6 Other libraries and tools

A.4 Metaheuristics Optimization Libraries

A.4.1 PySwarms

A.4.2 Sckit-opt

A.4.3 networkx

A.4.4 Distributed Evolutionary Algorithms in Python (DEAP)

A.4.5 OR-Tools

A.4.6 Other Libraries

A.5 Machine Learning Libraries

A.5.1 Node2vec

A.5.2 DeepWalk

A.5.3 PyG

A.5.4 OpenAI Gym

A.5.5 Flow

A.5.6 Other libraries