Glencora Borradaile

         Associate Professor & College of Engineering Dean's Professor, School of Electrical Engineering and Computer Science, Oregon State University

December 12, 2012

Classroom competition, TSP style

I changed up a few things in my undergraduate algorithms course this year.  I probably wouldn’t have if I wasn’t charged with designing an online version of the same course, one that would be static for at least three years, so far as I understand it.

One major thing that I changed was the assignment component.  This course has always (officially, by way of ABET-geared course learning objectives) included programming assignments.  Something that I abhored.  There was a post by Michael Mitzenmacher that changed my opinion (a bit) on this front. But mostly the thought that non-students would be looking closely at the various components of my course convinced me to take things a bit more seriously.

In previous iterations, I would completely separate “programming” assignments from “non-programming” assignments which is really terrible I know.  So this year I took a 180 and had 4 projects, each geared toward a major topic of the course with design, analysis and implementation/experimental analysis components.  Much better.  (Except for group unfairness woes as mentioned in my previous post.)

For the final project, I left things very open ended.  Design an algorithm to solve (2D Euclidean instances of) TSP.  In class, this allowed me to talk about verifiers (how else would I trust their solutions?), NP, give them a taste of a difficult problem, etc.  The assignment would culminate with a two-step competition. One to solve instances over a period of 24 hours and one to solve instances — live in class — in 4 minutes.  Before the assignment was even released I realized how competitive the students would get, requiring me (a.k.a. our amazing IT guy, Todd Shechter) to set up virtual machines for the competition to ensure fairness.  It was definitely convenient that DIMACS has a large set of instances available with optimal tour lengths listed.  Thank you, experimental algorithms community!

I have to say, I was impressed.  In a stroke of genius, I enforced a 2-page report limit so that I was actually able to easily discern their main techniques.  There were several equivalence classes of algorithms.  Two groups implemented Christofides’ algorithm, and, true to form, it got within 50% of optimal.  I tried hard to keep my impartiality in reading the reports on algorithms by biological metaphor and was pleased to see that my abhorrence played out in algorithms that didn’t do so well.  Several groups that did very well started with some sort of greedily generated tour and then made local changes that improved the tour.  I’d like to highlight the algorithm by Francis Vo and Soo Hyun Yoo, who were the only team to take advantage of the 2D Euclidean-ess of the problem and had an algorithm that outperformed all the others (almost all of the time), solved one of the 4-minute instances to optimality and added fuel to my “take advantage of the domain” banner I love to wave.  They started with a(n almost) convex hull of the points, iteratively added the remaining points to this tour greedily, and cleaned up with local search.  They even animated their algorithm to aid in design:

I will definitely make improvements (the in class competition was a little chaotic and not super interesting for the students who didn’t make into later rounds) but I enjoyed it and I think many of the students did.

Print Friendly

1 Comment

  1.   Michael Mitzenmacher — December 13, 2012 @ 4:50 pm    

    > There was a post by Michael Mitzenmacher that changed my opinion (a bit) on this front.

    Only a bit? 🙂 (I guess if the bit was previously 0 and now it’s a 1, that a big change.)

    More seriously, it sounds like you’ve found your (well-designed) programming exercise useful, in that students learned by doing, you got some good insight into what lessons the students were actually learning, and different but interesting issues come up when you start thinking in terms of implementation rather than only theory. An important question is what was the opportunity cost — what did you not get to teach by having the students do this. In the end, do you feel students learned more by this approach?

    Finally, I like the way this assignment brings out connections between theory and practice. Ideally, programming assignments in theory classes should reinforce that theory and implementation are not opposite sides of the CS playing field, but go hand in hand to solve problems. It seems to me like this assignment has that property.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

© 2017 Glencora Borradaile   Powered by WordPress MU    Hosted by