unit 2 lesson 6 cs principles. unit 2 lesson 6 objectives students will be able to: write an...

5
UNIT 2 LESSON 6 CS PRIN CIPLES

Upload: neil-grant

Post on 18-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UNIT 2 LESSON 6 CS PRINCIPLES. UNIT 2 LESSON 6 OBJECTIVES Students will be able to: Write an algorithm for solving the minimum spanning tree (MST) problem

UNIT 2

LESSON 6

CS

PR

I NC

I PL E

S

Page 2: UNIT 2 LESSON 6 CS PRINCIPLES. UNIT 2 LESSON 6 OBJECTIVES Students will be able to: Write an algorithm for solving the minimum spanning tree (MST) problem

UNIT 2 LESSON 6 OBJECTIVES

Students will be able to:

Write an algorithm for solving the minimum spanning tree (MST) problem.

Identify the minimum spanning tree on a given graph.

Use the terms algorithm, graph, node, edge correctly.

Explain the benefits of developing an algorithm for solving a problem versus solving an instance of a problem.

Page 3: UNIT 2 LESSON 6 CS PRINCIPLES. UNIT 2 LESSON 6 OBJECTIVES Students will be able to: Write an algorithm for solving the minimum spanning tree (MST) problem

GRAPH THEORY

The MST is a problem in a field of study known as Graph Theory in mathematics and computer science.

Problems involving graphs come up a lot in computer science, not only related to networking problems, but also in describing more sophisticated or interconnected relationships between data and information, for example, complicated scheduling problems, logistics, or even sociology problems, or interactions between molecules.  

Many real-world problems can be expressed or visualized as graphs.

The MST problem is interesting because it has an optimal best solution, and the algorithm for finding the MST on a graph is relatively straightforward to understand.  

A graph might have multiple “best” solutions, and there are several different algorithms for finding them.

Page 4: UNIT 2 LESSON 6 CS PRINCIPLES. UNIT 2 LESSON 6 OBJECTIVES Students will be able to: Write an algorithm for solving the minimum spanning tree (MST) problem

MST

How much do you think the Internet costs to build and maintain?

Let’s say that you are in charge of not one router, but several, and your job is to connect them so that a) any packet can get from any router to any other router in your system, and b) you want to build these connections as cheaply as possible.    

Say you are in charge of 4 routers placed at various locations in a region. The diagram shows the possible connections that could be made between any pair of routers and the associated cost of building a connection between them (in millions of dollars).

Journal #8: Copy this graph into your journal and indicate the MST. What is the cost of the MST?

 

Page 5: UNIT 2 LESSON 6 CS PRINCIPLES. UNIT 2 LESSON 6 OBJECTIVES Students will be able to: Write an algorithm for solving the minimum spanning tree (MST) problem

POSSIBLE STRATEGIES

How do you know when to stop? i.e. How do you know you’ve found the minimum?

Which edge should you start with?  

Can you define a strategy for considering an edge, then either keeping it or discarding it?