ECE619 Fall 2023

Reference Material, Homework Assignments and Homework Solutions 


Other Reference Material


Homework Assignments and Solutions

Homework should be submitted via Canvas.


Duality and Linear Programming

Assignment 1

Due Sept. 5th

   1. Problems 3.1, 3.2, 3.5, 3.6, 3.11, 3.14, 3.15 and 3.17 (problems are from Linear Programming by Ignizio and Cavalier - see pdf file of Chapter 3 problems. Ignore the questions about extreme directions in 3.14 -  just do part a and find the extreme points in part b.
   2. Repeat problems 3.2, 3.5 and 3.6 using the Matlab function linprog for Matlab to verify your solutions. Alternatively, you can use SciLab (freeware version of Matlab) if you don't .
   3. Show that the solutions to 3.1 and 3.2 satisfy the optimality condition (of if infeasible or unbounded show this).
   4. Formulate and solve the dual (or indicate if it is infeasible or unbounded) using Matlab for problems 3.1 (from standard form), 3.2, 3.5, 3.6 and 3.14. Compare the dual solutions to the primal, indicating the relationship between a) the binding constraints and the dual variables, and b) the optimal objective values.


Integer Programming; Optimization as Matching Observations - Estimation and Diagnostic Problems;

Assignment 2

Due Sept. 14
  1. Problems 11.2, 11.3, 11.5, 11.9 and 11.10 (see pdf file of Chapter 11  problems).
  2. Implement a Matlab routine to solve a MIP using branch and bound. Use the lp or linprog functions for solving the linear programming problems at each branch. Your solution should show the resulting search tree. Try to make your routine general. Apply your solution to 11.2 and 11.10.
  3. Solve the example state estimation problem in class using Weighted Least Absolute Value (WLAV) assuming equal weighting as done in class with z=[0.60.05 0.40] T ( z 1 = -5x 1z 2 = - 2.5x 2; z 3 = 4x 1 - 4x 2 ). Compare the solution to the Weighted Least Squares (WLS) method with equal weighting as done in class (i.e., linear regression). Now add an additional measurement of the injected flow at bus 2 ( z 4 = 9x 1 - 4x 2 ) with a value of 0.25 and repeat the analysis. Comment on the solution.
  4. This problem refers to the alarm processing problem that was discussed in class. You are to formulate and solve an LP for this problem by finding the minimal set of events to explain the alarms received. There are 11 possible alarms and 10 possible events, below are listed 10 event-alarm relationships. For this problem, you receive the following alarms:{a2,a6,a8,a9,a11}.  Also, you should state whether the solution is unique and if not, how you ensure a unique solution.  For background on this approach see Dijk.
  5. e1-> {a1 a4 a6 a7}
    e2-> {a1 a4 a6 a8}
    e3-> {a1 a4 a5 a9 a10}
    e4-> {a1 a4 a9 a10}
    e5-> {a1 a3 a4 a9 a10}
    e6-> {a1 a3 a9}
    e7-> {a9}
    e8-> {a11}
    e9-> {a1 a2}
    e10-> {a1}


Graph Searches

Assignment 3

Due Sept. 28th

This file contains a list of cities in Washington state with latitude and longitudinal information and driving distances between the cities. Perform the following to find a path between Tacoma and Pullman:

  1. Use depth-first search to find a path showing how the search proceeds. State clearly your depth-first rule.
  2. Solve for the shortest path using Dijkstra's shortest path algorithm.
  3. Formulate the search as an LP problem and solve using Matlab.
  4. Define an evaluation function based on the latitudinal and longitudinal values given. Then: (a) show for evaluation function that it satisfies the A* heuristic requirement, i.e., is conservative, (b) show whether this evaluation function is consistent , and (c) solve using A* search showing clearly how the search proceeds.
  5. Compare the search efficiencies in terms of the nodes visited for parts(1), (2) and (4). Note: It would be nice to compare these to the efficiency for LP in (3) as well. Essentially, each basic solution would be a candidate path and then you could count how many steps (pivots) till you found the optimal solution. In the older versions of Matlab, you could see the m-file and step your way through it. Unfortunately, I haven't found an easy way to do this in the newer versions of Matlab so it is tough to make a comparison. But if you can find an old version of the Matlab code (or perhaps some other open source Simplex algorithm where you can count pivots), I would be interested in your results. 
Also, I am NOT asking for software to do parts (1), (2) and (4) but solutions by hand. It would be nice for grading if you do this in away that is easy to see what you are doing. You could sketch the search process on the maps being sure to identify each step.
 
  • Solutions in zip file with Matlab which calls on Astar solution in Matlab but setup to show Olympia to Pullman instead of Tacoma to Pullman. And solutions showing detailed steps for Tacoma to Pullman.
  • General Duality and Lagrangian Relaxation

    Assignment 4

    Due October 17th
    1. Solve the following optimization problem using general duality (form the dual and find the maximum of the dual).
    2. min f(x)=x21+3x22
      such that
      3x1+2x2<-4
    3. Consider the following optimization problem:
    4.                    min f(x)=10-3x1-2x2-x3
                         such that
                              2x1+3x2+4x3<4
                              0<xi<1
             (a) Solve using the general duality principle.
             (b) Now assume that x i is binary and solve both the primal and dual. Find the duality gap.
    5. Modify the search problem from Assignment 3 so that is has a maximum allowable transit time (i.e., so it now becomes a constrained shortest path). Assume there are freeways for the paths listed below where one can travel at 75 MPH and smaller roads for all the remaining paths where one can travel at 40 MPH. Given a maximum allowable time of 8 hours. Use Lagrangian Relaxation to find a solution.
    6. Use Matlab to implement a Lagrangian relaxation approach to solving the scheduling problem below. (For those in power systems, this is a unit commitment problem modified from Wood and Wollenberg.)
    7.        Costs if unit scheduled (no cost otherwise): 
                         f1 (x)=500+10P1 +0.002P 2 1
                          f2(x)=300+8P 2 +0.004P 22
                         f3(x)=100+6P3 +0.006P 23
              Unit limits:
                              100 < P1 < 400
                               50 < P2 < 500
                             100 < P3 < 300
              Loads at (i.e., quantity needed at each hour, P1(t)+P2(t)+P3(t)=Load(t) ):
                             Hour 1    250
                             Hour 2  1050
                             Hour 3    350
                             Hour 4    150
  • Solutions.

  • Midterm practice and here practice solutions

    Midterm solutions


    Final Project

    Project progress report due Nov. 14th. Final Project report due TBD. Presentations TBD.

    Note last day of class is Dec. 5th so let's schedule presentations tentatively in class on Nov. 30th and Dec. 5th but we can change as needed. Also, if your project is not fully complete, then you can still present preliminaries and send in your full report later.

    For the project in this course, you are to solve a problem of your choice using optimization techniques developed in class. While I want you to choose your application problem, I don't want any two projects to be the same so I must approve your problem area. The project must satisfy the following:
    You might want to read Chapter 3 in Baldick or Chapters 12-13 in Ignacio for some ideas on transforming problems.

    Progress report - short description of your proposed project, including overall problem definition, approaches you will consider (if known yet) and where you will obtain needed data and parameters. This report should detail:

    This will not be graded but it is in your best interest to show me you have a good problem progress as otherwise, I may re-define the problem for you (and that will definitely be more work). Also, you will have to include some of these elements in your final report in any case. Specifically, the progress report should specify:

    Gradient Methods, Downhill Simplex and Stochastic Optimization

    Assignment 5

    Due Nov. 14th
    1. Problem 7.3 (pg. 327) parts i-v in Baldick (scanned copy).
    2. Consider the peaks function defined as: z =f(x,y)= 3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) - 10*(x/5 - x.^3 -y.^5).*exp(-x.^2-y.^2) - 1/3*exp(-(x+1).^2 - y.^2) (see Matlab file below), where one wishes to find the maximum. Using a steepest ascent gradient method (the peak functions and derivatives are given in this file) with a randomly generated initial solution.
    3. For the following three problems, you are to use the price and load data contained in this Excel file. It should be self-explanatory but the data represents MW load at fours of each day for one year (2002) and the associated prices for each of those data points.

    4. Solve a linear regression model of the form Price = a0a1·Load  +a2·Load2 for each of the four hours and for two different splits of training and testing data: a) using the first 6 months for training and using the last 6 months for testing and b)  a random separation of the data into two equal sized sets. Thus, you will have 8 models. Compare the approaches using the RMSE on the test sets. 
    5. Repeat above using an ANN model using this Matlab function that implements a steepest descent training for a hyperbolic tangent activation function. The syntax of for this routine is [W1, W2, RMSE] = tanmlp(trn_data, mlp_config, train_opt), where: 
      - W1 is the first layer set of weights, W2 is the second layer and RMSE is the error
      - trn_data is the training data
      - mlp_config is the number of inputs, nodes in hidden layer and outputs, e.g., mlp_config = [2 5 1];
      - trn_config is error goal, learning rate, momentum term, max training cycles, normalization (use 0), debugging flag, e.g., train_opt = [0.01 0.01 0.01 2000 0 0];
      - to get the output simply use tanh function, e.g., hidden layer X1 = tanh([test_data ones(n,1)]*W1) and then the output y = tanh([X1 ones(n,1)]*W2) .
    6. Compare your solutions in 4 and 5.
    Notes: 1) You need to normalize your data between [-1,1] for the tanmlp routine, 2) tanmlp also needs this subroutine adjeta.m, 3) There are some outliers in this load data and other unknown inputs that would affect the price so don't expect great performance.
  • Solutions.


  • Data Driven Problem and Simple Game Theory

    Mini Assignment 6

    Due Nov. 28th
    1. Given the data below of previously classified events with three attributes thay can take on integers between [0 2], give the classification for a new point x=[1 1 2] using: (a) Decision trees to optimize entropy (each decision rule should branch on a single variable - you can decide the depth); (b) Bayesian analysis. Compare solutions.
      Sample X1 X2 X3 Class
      1 1 2 1 1
      2 0 0 1 1
      3 2 1 2 2
      4 1 2 1 2
      5 0 1 2 1
      6 2 2 2 2
      7 1 0 1 1
      8 2 2 0 2
      9 2 1 1 2
      10 1 1 1 1
    2. Consider a two player zero sum game, where each player has two options: A or B. For the payoff matrix below (payoff(x,y)) with rows showing x decision and columns showing y decision, find the Nash equilibrium (both mixed and pure strategy if they both exist) with expected payoffs for each player. 
      Decision A B
      A -1, 1 10,-10
      B 5,-5 -1,1
    3. Consider a two player non-zero sum game, where each player has two options: A or B. For the payoff matrix below(payoff(x,y)), find the Nash equilibrium (both mixed and pure strategy if they both exist) with expected payoffs for each player. Suggest other solutions (i.e., where collusion is allowed).
      Decision
      A B
      A
      -1,3
      6,4
      B
      5,6
      -1,1