Computational Optimization (Fall 2014)

This website contains class resources, homeworks, and other useful information.

To find out more about the course, read the class flyer or course syllabus.

Visit the canvas website for the course to turn in your homework assignments and discuss with classmates.

Lecture Contents

A quick summary of each lecture's contents.

  1. Class goals and introduction.  Getting an HPC account.
  2. Basic python types, loops, functions
  3. Basics of scipy, array operations, and matplotlib
  4. Matplotlib figures, axes, patches  Go over HW1.
  5. Pandas dataframes and geographic plotting
  6. Python debugger, python profiler, overview of sampling from convex sets.
  7. Go over HW 2.  Introduce HW 3.  Generating uniform random points and vectorizing.
  8. Finding the boundary of a convex region.  Generating uniformly random points in a ball, transformation.
  9. Projecting onto an affice space.  Vectorizing.
  10. Testing uniformity, chi-square test in many dimensions.
  11. Exam 1
  12. Go over Exam 1
  13. Parallel computing in Python.
  14. More parallel computing, aggregating histograms.
  15. Networkx, introduction to optimization packages.
  16. Go over HW 4.  Solving shortest path with pycpx.
  17. Solving shortest path with cplex.  Introduction to HW 5.
  18. Make up Exam 1
  19. Elementary Shortest Path with Resource Constraints
  20. Solving facility location with cplex. distances.csv openCosts.csv
  21. Extra lectures on Python:

Homework Assignments

Project Handouts:

Course Resources

  • Getting Started
    • Accounts, connecting, basic Unix commands
    • Copying files, text editors, starting a python interpreter, screen
  • Python Basics
    • Basic python data types
    • Organizing code: functions, objects, and modules
    • Searching for a module in the standard library
  • Scipy and Matplotlib Basics
  • Pandas and Matplotlib.basemap

Getting Started

  • Request an HPC account: Request Form, you can also read the wiki documentation
  • Connect:  Use ssh.  (Linux/Mac) search for an ssh tutorial (Windows) use putty
  • Basic unix commands: search for a command line tutorial or a quick cheat sheet
  • Copy files to/from: Use scp.  (Linux/Mac) search for an scp example (Windows) use winscp
  • Text editors: Pick one that works for you.  SublimeText, gedit, Emacs, Vim
  • Start python interpreter:
    • Ssh into Create a directory /scratch/your_user_name and move to it.
    • type ipython --ipython-dir=.
  • Screen:  
    • new: screen -S <sessionname> -h <num_lines>
    • re-attach: screen -r -d <sessionname>
    • list: screen -ls
    • detach: CTRL a d
    • Search for screen tutorial online

Python Basics

  • Use the Python 2.7 documentation
  • The python tutorial is a great place to look up basic and advanced syntax.  Use it to learn about functions, classes, and modules.  It should help you map other programming knowledge to Python, and learn the basic data types.
  • Use library reference to find standard library modules to help get your work done quickly.

Scipy and Matplotlib Basics

  • Read numpy for MATLAB users if you are familiar with MATLAB.
  • There are many more functions in scipy and numpy than you can remember.  For a given task, seach online and look at the scipy reference or numpy reference to find the tool you are looking for.
  • Matplotlib has many built-in plotting capabilities.  We can also use the building blocks there to create complex custom visualizations.  Usually, I use the matplotlib gallery to find something similar to what I want, and edit the code provided there.

Pandas and Matplotlib.basemap

This is a completed course

© Copyright 2004-2017 - Ned Dimitrov