08.10.09IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems.

Slides:



Advertisements
Similar presentations
Dynamic Programming 25-Mar-17.
Advertisements

Algorithm Design Methods Spring 2007 CSE, POSTECH.
Limitation of Computation Power – P, NP, and NP-complete
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Chapter 5 Fundamental Algorithm Design Techniques.
Great Theoretical Ideas in Computer Science for Some.
Greed is good. (Some of the time)
Chapter 4 The Greedy Approach. Minimum Spanning Tree A tree is an acyclic, connected, undirected graph. A spanning tree for a given graph G=, where E.
9.2 The Traveling Salesman Problem. Let us return to the question of finding a cheapest possible cycle through all the given towns: We have n towns (points)
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Math 308 Discrete Mathematics Discrete Mathematics deals with “Separated” or discrete sets of objects (rather than continuous sets) Processes with a sequence.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
Math443/543 Mathematical Modeling and Optimization
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
The Theory of NP-Completeness
Homework page 102 questions 1, 4, and 10 page 106 questions 4 and 5 page 111 question 1 page 119 question 9.
NP-Complete Problems (Fun part)
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
1 NP-Complete Problems (Fun part) Polynomial time vs exponential time –Polynomial O(n k ), where n is the input size (e.g., number of nodes in a graph,
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Graph Theory Topics to be covered:
Graph Theory Hamilton Paths and Hamilton Circuits.
Theory of Algorithms: Brute Force. Outline Examples Brute-Force String Matching Closest-Pair Convex-Hull Exhaustive Search brute-force strengths and weaknesses.
5-1-1 CSC401 – Analysis of Algorithms Chapter 5--1 The Greedy Method Objectives Introduce the Brute Force method and the Greedy Method Compare the solutions.
For Wednesday No reading No homework There will be homework for Friday, as well the program being due – plan ahead.
CSC 201: Design and Analysis of Algorithms Greedy Algorithms.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 3 Brute Force. A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples:
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
December 14, 2015 Design and Analysis of Computer Algorithm Pradondet Nilagupta Department of Computer Engineering.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
1 Algorithms CSCI 235, Fall 2015 Lecture 30 More Greedy Algorithms.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
CS 361 – Chapter 10 “Greedy algorithms” It’s a strategy of solving some problems –Need to make a series of choices –Each choice is made to maximize current.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1. For minimum vertex cover problem in the following graph give
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Unit 2 Hamiltonian Circuits. Hamiltonian Circuit: A tour that starts at a vertex of a graph and visits each vertex once and only once, returning to where.
Divide and Conquer. Problem Solution 4 Example.
Ch3 /Lecture #4 Brute Force and Exhaustive Search 1.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
The Theory of NP-Completeness
Limitation of Computation Power – P, NP, and NP-complete
Lecture on Design and Analysis of Computer Algorithm
Greedy Technique.
Lecture 2-2 NP Class.
Algorithm Design Methods
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Great Theoretical Ideas in Computer Science
Heuristics Definition – a heuristic is an inexact algorithm that is based on intuitive and plausible arguments which are “likely” to lead to reasonable.
Lecture 24 NP-Complete Problems
Exam 2 LZW not on syllabus. 73% / 75%.
Section 2: Multiple choice
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
3. Brute Force Selection sort Brute-Force string matching
3. Brute Force Selection sort Brute-Force string matching
Algorithm Design Methods
Algorithm Design Methods
The Theory of NP-Completeness
Algorithms CSCI 235, Spring 2019 Lecture 30 More Greedy Algorithms
Algorithm Design Methods
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

IT 60101: Lecture #201 Foundation of Computing Systems Lecture 20 Classic Optimization Problems

IT 60101: Lecture #202 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #203 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #204 Coin Changing Problem =

IT 60101: Lecture #205 Coin Changing Problem Problem Definition Given a set of denomination of the coins, say c 1, c 2, c 3, …, c n, such that c 1 > c 2 > c 3 > …> c n = 1. Given an amount A, the problem is to determine the minimum number of coins needed to make A in change. Note that The problem may assume c n =1, so that it is always possible to make change for any amount A. Any number of coins for each denomination is available.

IT 60101: Lecture #206 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #207 Optimal Retrieval Problem 

IT 60101: Lecture #208 Optimal Retrieval Problem Problem Definition Suppose, that n programs having length l 1, l 2, …, l n are stored on a tape. If the programs are stored in the order l i1, l i2, …, l in, the time to retrieve any program i k is (We assume that retrieval time starts at the beginning of the tape. The above retrieval time for a program i k results from the fact that in order to retrieve program i k, we must pass all of the programs stored before program i k ). The average retrieval time is defined as The problem is to find an ordering of the program to minimize the average retrieval time.

IT 60101: Lecture #209 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #2010 Traveling Salesman Problem

IT 60101: Lecture #2011 Traveling Salesman Problem Problem definition A salesman has a list of cities, each of which he must visit exactly once. There are direct roads between each pair of cities on the list. The problem is to find route the salesman should follow so that he travels the shortest possible distance on a round trip, starting at any one of the cities and then returning there. He should not travel a city twice except the starting city.

IT 60101: Lecture #2012 Different Versions of Traveling Salesman Problems Hamiltonian Cycle Problem This problem is to find Hamiltonian cycle with minimum weight graph in graph theory and stated as below. Given an connected weighted graph and it is required to find a tour (a cycle through all the vertices exactly once except the first ) of minimum weight. Euclidian Traveling Salesman Problem This problem is to determine the shortest path closed tour that connects a given set of n-points on a plane. Bitonic Tour Problem A tour starts at the left most point, go strictly left to right, and then go strictly right to left and finally back to the starting point. The objective function and constraint is same as in the Traveling Salesman Problem.

IT 60101: Lecture #2013 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #2014 Knapsack Problem

IT 60101: Lecture #2015 Knapsack Problem The knapsack problem can be posed as follows. –A thief robbing a store finds n items: the i-th item is worth v i and weight w i. The thief would take as valuable as possible but he can carry at most W weights in his knapsack. Which items should the thief take?

IT 60101: Lecture #2016 Knapsack Problems The knapsack problem can be generalized and formally stated as follows. Given n items and a knapsack. The knapsack has a capacity W. Any item say i, has a weight w i and a value v i per unit. If a quantity x i of the item i is placed into the knapsack, then a profit v i.x i is earned. The objective is to obtain a filling of the knapsack that maximizes the total profit earned. Since the knapsack capacity is W, we require the total weight of all chosen object to be at most W. Formally the problem may be stated as follows. Maximize Subject to

IT 60101: Lecture #2017 Different Versions Knapsack Problems Discrete Knapsack Problem Here, all v i ’s, w i ’s and W are integers and each item must be taken or left behind. This problem is also called “integer” knapsack, and “0-1” knapsack problem Continuous Knapsack Problem In this version of the knapsack problem, we can take any quantity (i.e. a fraction) of each item (rather that having to make a binary (0 or 1) choice for each item.) Note: You can think 0-1 knapsack problem as being like a gold ingot while an item in continuous problem is more like gold dust.

IT 60101: Lecture #2018 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #2019 Some Well Known Problems Some problems are well known to learn designing algorithms Sorting Searching Coin Changing Optimal Retrieval Problem Traveling Salesman Problem Knapsack Problem Bin Packing Problem Minimum Spanning Tree Problem Shortest Path Problem Huffman Tree Problem Optimal Binary Search Tree Problem

IT 60101: Lecture #2020 Bin Packing Problem

IT 60101: Lecture #2021 Bin Packing Problem Problem definition Given n items of sizes s 1, s 2, …, s n. All sizes satisfy 0<s i ≤1. The problem is to pack these items in the fewest number of bins, given that each bin has unit capacity.