CE 392C - Transportation Network AnalysisFall 2023Homework 4Due on Canvas at 11:59 PM, Friday, October 20. Submit two files: a PDF containing your solutions to the textbook problems, and a ZIP file containing your code for the Python problems. More details below on how to submit the Python code. Textbook questionsMake sure you are using version 0.89 of the text. Chapter 6: Exercise 9d Chapter 8: Exercises 21, 22, 24 Python questionsThe Python questions on this assignment area fill in the remaining pieces for you to have your own traffic assignment code that will solve for equilibrium on any network, using the method of successive averages (MSA) or Frank-Wolfe.
Download and unzip these files to a convenient directory. The only file you need to edit is As with previous assignments, any numerical values will be marked correct if they are within 1% of the reference answers given in the test files. Question 1: Relative gap calculation
The first step is to calculate the relative gap of a given solution, so you have a termination criterion available. Within the
Use the definition of relative gap given in Equation 6.7 of Section 6.1.3 in the text, and return this value at the end of the method. You will find it very helpful to call some of the methods implemented in earlier assignments. Question 2: Average excess cost
In this question, implement average excess cost as an alternative way to check how close a solution is to equilibrium. Use the definition given in Equation 6.10 of Section 6.1.3. After answering Question 1, you should be able to answer this question without much difficulty. Put your code in the Question 3: Flow shifting
Convex combinations algorithms, like MSA and Frank-Wolfe, shift flows by taking a weighted average of the current link flows x, and a "target" vector of link flows x*. Write code to do this in the
Your method should store the new link flows in the Question 4: Frank-Wolfe step size
The last question involves finding the step size λ which minimizes the Beckmann function, the key step of the Frank-Wolfe algorithm. Write code to do this in the
Upon completing this assignment, you have access to a complete implementation of MSA and Frank-Wolfe in the Submission instructionsYour answers to the textbook questions should be placed in a single PDF file and uploaded to Canvas. Please verify that your file uploaded correctly, that the pages are in the right order, etc. For the Python questions, submit a single ZIP file and upload to Canvas. Please follow these instructions. A small penalty may be deducted if they are not followed.
unzip hw4.zip diff -bur master/ hw4/ # master is the original version; this shows me your changes cd hw4 cat README.txt python3 grader.py cd .. rm -r hw4 hw4.zip Return to CE 392C. |