Data Structures Lab Algorithm Animation.

Slides:



Advertisements
Similar presentations
Algorithm Design Techniques
Advertisements

Introduction to Algorithms Greedy Algorithms
Types of Algorithms.
Algorithms + L. Grewe.
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
CS333 Algorithms
1 Greedy Algorithms. 2 2 A short list of categories Algorithm types we will consider include: Simple recursive algorithms Backtracking algorithms Divide.
CS333/ Topic 11 CS333 - Introduction CS333 - Introduction General information Goals.
Chapter 10: Algorithm Design Techniques
Solution methods for Discrete Optimization Problems.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Programming & Data Structures
Lecture 23. Greedy Algorithms
MCS312: NP-completeness and Approximation Algorithms
SPANNING TREES Lecture 21 CS2110 – Spring
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.
Fundamentals of Algorithms MCS - 2 Lecture # 7
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
1 Joe Meehean.  Log: binary search in sorted array  Linear: traverse a tree  Log-Linear: insert into a heap  Quadratic (N 2 ): your sort from P1 
 Analysis Wrap-up. What is analysis?  Look at an algorithm and determine:  How much time it takes  How much space it takes  How much programming.
INTRODUCTION. What is an algorithm? What is a Problem?
For Wednesday No reading No homework There will be homework for Friday, as well the program being due – plan ahead.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
A Introduction to Computing II Lecture 16: Dijkstra’s Algorithm Fall Session 2000.
2016/3/13Page 1 Semester Review COMP3040 Dept. Computer Science and Technology United International College.
Brute Force II.
Brute-Force, Heuristic Algorithms
Design and Analysis of Algorithms (09 Credits / 5 hours per week)
Advanced Algorithms Analysis and Design
Data Structures and Algorithms
BackTracking CS255.
Major Design Strategies
Lecture 22 Complexity and Reductions
Unsolvable Problems December 4, 2017.
Spanning Trees Lecture 21 CS2110 – Fall 2016.
Data Structures and Algorithms
Types of Algorithms.
Introduction to Algorithms
Design and Analysis of Computer Algorithm (CS575-01)
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.
Types of Algorithms.
Heuristic Algorithms via VBA
Advanced Analysis of Algorithms
Chapter 11 Limitations of Algorithm Power
Artificial Intelligence
Lecture 3: Environs and Algorithms
Constraint satisfaction problems
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Types of Algorithms.
Heuristic Algorithms via VBA
Heuristic Algorithms via VBA
What is Computer Science About? Part 2: Algorithms
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Search.
Major Design Strategies
Search.
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Approximation Algorithms
Department of Computer Science & Engineering
Constraint satisfaction problems
Major Design Strategies
Lecture 22 Complexity and Reductions
Data Structures and Algorithms
Presentation transcript:

Data Structures Lab Algorithm Animation

Algorithm Categories Brute Force Greedy Heuristic Divide & Conquer Dynamic Programming Back-Tracking Genetic

Brute Force Straightforward, obvious approach to solve a problem, usually involves looking at every single data point. Useful for solving small size problems, but not for large n. Typical brute force approach will give optimal solution for small problems but never end for large problems. ExamplesL Linear Search Traveling Salesman Problem (non-optimized)

Greedy Algorithms Take what you can get now strategy (so often involves nearest neighbor type approaches, or largest first or other types of easy to do steps). Does not always generate the optimal solution. At each step, the choice is the local optimal. Examples: Coins exchange Huffman Codes (compression algorithm)

Heuristic Algorithms Following a rule of thumb, usually based on domain knowledge and some kind of insight Examples: Choosing the pivot in quicksort, can be done well, if you know the data set and you have a good heuristic for finding a decent middle value Certain TSP solutions (like go around the outside and spiral in) MinMax algorithm to find a strategy in trees of possible game moves by a player and an opponent. Look at both min and max moves at each level.

Divide & Conquer Involves splitting the data at each step, and recursively solving. Typically, split all the way down and solve as you recurse back up. Example: Binary Search

P and NP Problems P stands for polynomial, refers to a class of problems that can be solved in polynomial time (n, n2, n3, etc.) NP stands for nondeterministic polynomial time, and refers to a class of problems where it is uncertain (unlikely even?) that a polynomial time solution exists. So, if a problem has a known solution that is exponential (kn), it is considered NP, because it is unknown if there is a more efficient solution to that problem.

P and NP and how they relate to Big O: NP solutions P solutions

The P vs. NP Question If the solution to a problem is easy to check for correctness, is it easy to solve? P problems are considered easy to solve because they can be computed in polynomial time ( n, n2, n3, etc.) NP problems are those where it is easy to check whether a given solution is correct, but where we don’t know if there is a way to find a solution in polynomial time. (There may be, but we don’t know). CS people want to know if P == NP (i.e. are all problems solvable in polynomial time?)

Instructions Using the map-based, weighted graph on the following slide to animate how a particular algorithm works. To do this: Create multiple duplicates of the slide (the map is on a master slide) On each slide, change the nodes by animation, highlighting, etc. The purpose is to demonstrate visually, with the graph as your example, how your assigned algorithm work

Graph Algorithms To Choose From: Breadth First Traversal Depth First Traversal Prim’s Algorithm (minimum spanning tree) Dykstra’s shortest path NB: each pair at each table should choose a different algorithm Spend 5-10 minutes looking up the algorithm to understand how it is supposed to work Spend the rest of the time creating the animation Make sure both partners are involved in the task

Algorithm Characteristics Is the algorithm you just animated: Greedy? Heuristic? Divide & Conquer? Brute Force? P or NP?