Graph Theory, Lecture Slides - Computer Science, Slides of Introduction to Computers

Pleliminaries introduction

Typology: Slides

2010/2011

Uploaded on 09/06/2011

stifler_11
stifler_11 🇬🇧

4.6

(9)

272 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COMS21103: Summary of Lecture 1
Some of the points that we discussed in lecture one:
1 Organizational matters:
1.1 Course structure
The course has 3 parts, roughtly 4 weeks each.
Foundations (Bogdan)
Basic algorithms and techniques (Raphael)
Applications and implementation techinques (Dan)
1.2 Help available
Lectures (3 times a week)
Problem class (once a week)
Office hours (twice a week: lecturer + Jamie)
1.3 Evaluation
2 courseworks each worth 10%
3 in class quizes each worth (the first two worth 7.5%, and one worth 5%)
1 exam worth 60%
1.4 Surviving guide
Come to class
Take notes
Get the CLRS book (the library holds copies)
Do the study guide problems
Come to my office hours
Go to Ben’s problem class
Go to Jamie’s office hours
All of the above are important; from a broad perspective doing the above eases and improves
your understanding of algorithms desing related issues. From a narrower, but nonetheless impor-
tant perspective they make coursework/exam problems easier to solve, you get higher marks, and
everyone’s life better.
1
pf3
pf4

Partial preview of the text

Download Graph Theory, Lecture Slides - Computer Science and more Slides Introduction to Computers in PDF only on Docsity!

COMS21103: Summary of Lecture 1

Some of the points that we discussed in lecture one:

1 Organizational matters:

1.1 Course structure

The course has 3 parts, roughtly 4 weeks each.

  • Foundations (Bogdan)
  • Basic algorithms and techniques (Raphael)
  • Applications and implementation techinques (Dan)

1.2 Help available

  • Lectures (3 times a week)
  • Problem class (once a week)
  • Office hours (twice a week: lecturer + Jamie)

1.3 Evaluation

  • 2 courseworks each worth 10%
  • 3 in class quizes each worth (the first two worth 7.5%, and one worth 5%)
  • 1 exam worth 60%

1.4 Surviving guide

  • Come to class
  • Take notes
  • Get the CLRS book (the library holds copies)
  • Do the study guide problems
  • Come to my office hours
  • Go to Ben’s problem class
  • Go to Jamie’s office hours

All of the above are important; from a broad perspective doing the above eases and improves your understanding of algorithms desing related issues. From a narrower, but nonetheless impor- tant perspective they make coursework/exam problems easier to solve, you get higher marks, and everyone’s life better.

1.5 Brief overview of the foundations part

Why study algorithms: intrinsic part of everyday life; no iPhone, PlayStation, Google Search, MapQuest, Internet possible without algorithms (N.B. some may think that the absence of these things is not necessarely a bad thing :) ) When solving a problem (e.g. given the street map of a city find the shortest distance between point A and point B), the first step is to build an abstraction. Specifially, we construct a mathe- matical model of what the problem is and what a solution for the problem looks like. For example, the above problem on the shortest path translates to: Input: given a directed graph (V, E), a weight function ω : E → N, and two vertexes A, B ∈ V. Output: find a sequence of vertexes V 0 , V 1 ,... , Vk such that V 0 = A, Vk = B and (Vi, Vi+1) is an edge in E (so far we have expressed that we want a path from A to B), and the total sum of the weights

∑k i=0 ω((V^0 , V^1 )) should be minimal across all paths from^ A^ to^ B. Notice that building the model for the problem is usually the easy step, although sometimes it is unclear how to choose the right abstraction among several posibilities. The next step, and this is what we study in this class is to produce an algorithm which for any input (of the right form) produces the desired output. We will study several algorithm-related issues. The Algorithm design part surveys algorithms for solving problems as the one above. Here we study several techniques (e.g. greedy, divide&conquer, dynamic programming) for solving a variety of problems. Think about these techniques as a tool-box. Later, when you are faced with a problem, ideally you will know how to use one, or more tools from the tool-box to solve it. Remember: the goal is to understand the design paradigms that are used in these algorithms so that you can then apply them to create algorithms for different problems. The Algorithm analysis part covers issues that have to do with understanding how well an algorithm performs. In particular we will look at:

  • Algorithm efficiency: how do we figure out how fast an algorithm runs, what does fast even means, and how do we compare the efficiency of algorithms? Here I already hinted that we devise a machine independent measure of how fast an algorithm runs and that we will mostly look at the worst-case running time. We looked briefly at how would one define the average running time.
  • Algorithm correctness: how to argue/prove that an algorithm is correct?

2 Math preliminaries

In the first couple of lectures we will study some of the mathematical tools that you need for this course.

2.1 Induction

In the first lecture we already looked at proofs by induction. This is a crucial tool for the problems that you’ll have to solve in this class. The technique is quite simple: To show that a statement P (n) is true for all natural numbers n or, more formally, to prove

(∀n ∈ N)P (n)

we proceed as follows:

  1. Induction step: assume that P (k) is true, that is, we assume

∑^ k

i=

i^2 = k(k + 1)(2k + 1) 6

We show that P (k + 1) is true. We have that:

k∑+

i=

i^2 =

∑^ k

i=

i^2 + (k + 1)^2 (1)

k(k + 1)(2k + 1) 6

  • (k + 1)^2 (2)

= (k + 1)(2k^2 + 7k + 6) 6

(k + 1)(k + 2)(2k + 3) 6

Equation (1) is just rewritting of the left-hand side, equation (2) follows from the induction hypothesis, equations (3) and (4) are just basic symbol manipulation. We have thus shown that: ∑k+

i=

i^2 = (k + 1)(k + 2)(2k + 3) 6

(which is precisely P (k + 1)). We therefore have that (∀k)P (k) ⇒ P (k + 1).

  1. Since P (0) is true and (∀k)(P (k) ⇒ P (k + 1)) we conclude that (∀n ∈ N)P (n)

Further reading

  • Read the intro of CLRS (pages 5-10)
  • Read the chapter on induction (Chapter 6) from Albert Meyer’s lecture notes on computer science. Go through the many examples there. Ignore for the time being those related to strong induction. We will study this in the next lecture.