Category Archives: Handouts

Exam PreReading

Here’s the promised pre-reading for your exam. Two of the problem domains will be familiar to you, but the third is a template designed to illustrate a new type of exercise we’ll most likely be asking on the exam. Feel free to discuss the solution to the sample question we posed!

Here’s a sample solution to the problem given there (corrected 2017/12/08 to have the right work per node/level). BUT, try to solve it yourself first! The sample solution is really there mainly to make sure you understand how we intend to format the answer.

NOTE that we will expect you to be very familiar with the domains already given in our assignments (including assignment #6) are actively developing exciting new questions that explore those domains in different ways from what you’ve already seen.

Notes: Longest Increasing Subsequence Handout and Solution

You can find the longest increasing subsequence classroom handout and solution here:

Handout

Solution

Sample Solutions to Pipe-Laying/NP-completeness for the Steiner Tree Problem

Here are sample solutions to the three parts of the Steiner Tree Problem worksheets:

  1. part 1 on understanding the problem and showing it is in NP
  2. part 2 on developing a reduction showing the problem is NP-hard
  3. part 3 on proving the reduction correct

NP-completeness tutorial worksheet and notes

Here is the worksheet and sample solution from our NP-completeness tutorials this week.

And here’s a summary sheet on NP-completeness.

Futility of Laying Pipe, Part 3

We’ve now analysed the original Steiner Tree Problem, turned it into a decision problem (SP), shown that SP is in NP (by finding a polynomial-time verifiable certificate), and laid out a polynomial-time reduction from 3-SAT to SP. Now, we need to prove our reduction correct in order to show SP is NP-hard. Together SP being in NP and NP-hard shows SP is NP-complete.

Sample Solution to Understanding Reduction in a New Light

Here is a sample solution to the notes on using reduction for NP-completeness proofs.

Futility of Laying Pipe, Part 2

Here’s the second in a series of worksheets on NP-completeness in association with a problem in laying pipe that UBC solved a couple years back: Pipe, part 2

NP-Completeness and the Futility of Laying Pipe

Here’s the first in a series of worksheets on NP-completeness in association with a problem in laying pipe that UBC solved a couple years back.

Understanding Reductions in a New Light

We’re going back to reductions again! Here is a worksheet on a new way to think about and use reductions.

LCS Live Coding Sample Solutions

For sample solutions to the live-coding of LCS in various formats, check out: