CMSC 150 INTRODUCTION TO COMPUTING CS 150: Mon 9 Jan 2012.

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

Lecture 15. Graph Algorithms
Networks Prim’s Algorithm
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Greed is good. (Some of the time)
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Chapter 3 The Greedy Method 3.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Network Optimization Problems: Models and Algorithms This handout: Minimum Spanning Tree Problem.
Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.
Chapter 7 Network Flow Models.
An Interval MST Procedure Rebecca Nugent w/ Werner Stuetzle November 16, 2004.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Minimum Spanning Tree Algorithms. What is A Spanning Tree? u v b a c d e f Given a connected, undirected graph G=(V,E), a spanning tree of that graph.
Computational Methods for Management and Economics Carla Gomes Module 9d Network Models Maximum Flow Problem (Slides adapted from J.Orlin’s and Hillier’s)
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Minimum Spanning Trees and Clustering By Swee-Ling Tang April 20, /20/20101.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
CS 146: Data Structures and Algorithms July 21 Class Meeting
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Graph Theory in Computer Science
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.
Minimum Spanning Trees: Chapter 6s The Modern Corp. Problem Modern Corporation has decided to have a state-of-the-art fiber-optic network installed to.
CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
Minimum Spanning Trees CS 146 Prof. Sin-Min Lee Regina Wang.
Overview of Graph Theory. Some applications of Graph Theory Models for communications and electrical networks Models for computer architectures Network.
1 Chapter 4 Minimum Spanning Trees Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
Chapter 8 Network Models to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004 Brooks/Cole,
Welcome Unit 6 Seminar MM305 Wednesday 8:00 PM ET Quantitative Analysis for Management Delfina Isaac.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 11.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
BlueJ X ICSE Syllabus. Board Pattern THEORY (100 marks) PRACTICAL (100 marks) PROJECT (50 marks) ASSIGNMENTS (50 marks)
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
1 1 Slide © 2005 Thomson/South-Western Chapter 9 Network Models n Shortest-Route Problem n Minimal Spanning Tree Problem n Maximal Flow Problem.
Network Flow Problems – Shortest Path Problem
Chapter 12 Network Models 12-1
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
Unit# 9: Computer Program Development
Shortest Path.
MATS Quantitative Methods Dr Huw Owens
Introduction to Algorithms and Programming
Algorithm and Ambiguity
Minimum Spanning Tree Optimizations
Networks Kruskal’s Algorithm
ICT Gaming Lesson 2.
Fundamental Structures of Computer Science II
Chapter 6 Network Flow Models.
CSE 373: Data Structures and Algorithms
Networks Prim’s Algorithm
Minimum spanning trees
CS105 Introduction to Computer Concepts Intro to programming
CS Problem Solving and Object Oriented Programming Spring 2019
7 The Mathematics of Networks
Presentation transcript:

CMSC 150 INTRODUCTION TO COMPUTING CS 150: Mon 9 Jan 2012

About Me  Dr. Lewis Barnett  Office: 212A Jepson Hall  Office Hours: Most anytime, but especially MT 2:30 - 3:30 pm; WR 10: :30 am;  

First: Meet Doug

He Decides Network Connections

Connections Doug Can Choose

Hours to Install Each Connection

What Doug Wants…  A set of connections so that:  a connection to each place (no place left out)  no loops  sum of all installation times is minimum three loops here one loop here no loops here

Start With A Smaller Example  Which connections should you include? 5 4

Start With A Smaller Example  Which connections should you include?  Likely the shorter ones… 5 4

Start With A Smaller Example  Which connections should you include?  Likely the shorter ones  Less likely the longer ones… 5 4

Step by Step…

loop!

Step by Step…

− each place connected − no loops − sum of times is minimum

Minimal vs. Not − each place connected − no loops − sum of times is minimum − each place connected − no loops − sum of times is NOT minimum

You Try It…

Was This Your Result ? − each place is connected − no loops − sum of times is minimum: 28 hours

Doug is a Happy Fellow!

Your Next Task  Break into pairs…  Write down the procedure you used:  think in general terms  how do you start?  how do you proceed from there?  when do you finish?

Your Algorithm  You have just written down your first algorithm  Kruskal’s algorithm for finding Minimum Spanning Tree Kruskal’s algorithm 1.Include path with min time (ties broken arbitrarily) 2.Include next shortest path if it does not introduce a loop 3.Repeat step 2 until each place has a path connected to it 1.Include path with min time (ties broken arbitrarily) 2.Include next shortest path if it does not introduce a loop 3.Repeat step 2 until each place has a path connected to it

Algorithms  Algorithm: Set of instructions for solving a problem  known starting condition  well-defined sequence of steps  terminates  Computation: applying an algorithm to an input to obtain an output (solution)  Key: different algorithms can solve same problem  Choose the “best” algorithm

Applications of MST  Network Design  computer, electrical, cable, road, …  e.g., want set of lines that connects all offices with minimum total cost  Real-time face verification  Particle interactions in fluid flows  Ethernet bridging to avoid cycles in network

About This Course  An introduction to the science of computing  You will learn:  how to think algorithmically  how to write your solutions in a program (in Java)  how to debug and test your solutions

Remember…  Computer science is not (just) programming  Computer scientists do much more than program  They develop algorithms to solve problems  using the computer (and programs)  incorporating a variety of disciplines  myriad applications and real-world benefits…

Google’s Autonomous Vehicle

But We Have To Start Simple… Java Program (Source) Java Program (Source) Compiler Java Program (Byte Code) Java Program (Byte Code) You write the source code in an IDE, e.g., BlueJ

But We Have To Start Simple… Java Program (Source) Java Program (Source) Compiler Java Program (Byte Code) Java Program (Byte Code) The compiler is a program that converts source to binary; Included in BlueJ

But We Have To Start Simple… Java Program (Source) Java Program (Source) Compiler Java Program (Byte Code) Java Program (Byte Code) Byte code version can be executed on computer

Let’s Write Our First Program !