Algorithms and Running Time Algorithm: Well defined and finite sequence of steps to solve a well defined problem. Eg.,, Sequence of steps to multiply two.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Proof of correctness; More reductions
Limitation of Computation Power – P, NP, and NP-complete
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Montek Singh COMP Nov 15,  Two different technologies ◦ TODAY: DNA as biochemical computer  DNA molecules encode data  enzymes, probes.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
Approximation Algorithms
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
GRAPH Learning Outcomes Students should be able to:
Programming & Data Structures
MCS312: NP-completeness and Approximation Algorithms
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.
1 Computing with DNA L. Adelman, Scientific American, pp (Aug 1998) Note: This ppt file is based on a student presentation given in October, 1999.
Graph Theory Hamilton Paths and Hamilton Circuits.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSCI 2670 Introduction to Theory of Computing November 23, 2004.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
DNA computing on a chip Mitsunori Ogihara and Animesh Ray Nature, 2000 발표자 : 임예니.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
NPC.
David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions.
CSC 413/513: Intro to Algorithms
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
Chapter 9: Graphs.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Introduction to NP Instructor: Neelima Gupta 1.
1 Computability Tractable, Intractable and Non-computable functions.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
CSC 172 P, NP, Etc.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
More NP-Complete and NP-hard Problems
NP-completeness Ch.34.
Lecture 2-2 NP Class.
Part VI NP-Hardness.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Lecture 5 NP Class.
Discrete Maths 9. Graphs Objective
Chapter 2: Business Efficiency Lesson Plan
ICS 353: Design and Analysis of Algorithms
Graph Theory.
P, NP and NP-Complete Problems
The Theory of NP-Completeness
P, NP and NP-Complete Problems
Instructor: Aaron Roth
Presentation transcript:

Algorithms and Running Time Algorithm: Well defined and finite sequence of steps to solve a well defined problem. Eg.,, Sequence of steps to multiply two numbers. Algorithms are meant to solve all instances of problems for which they are designed. Proof of correctness is important for any algorithm. Another aspect is Running Time. Running time is the number of machine instructions it executes when an algorithm is run on a particular instance. Proof of correctness + Running Time = Analysis of Algorithm.

Running Time of an Algorithm Algorithms behavior to any instance of the problem Two rules are necessary Running be given for the worst instance of time. Make running time depend on the size of the instance being solved. Running time is a function. The Running time of an algorithm A is 5N 2 + 3n + 72 Where n measures the problem size RT of A becomes O(n 2 ) Big O notation is used to show we are dropping lower order terms. Algorithms whjich run on O(n) are said to be linear time, While that on O(n 2 ) are quadratic. An algotrithm running as polynomial on n is more efficient than that running as 2 n.

Classification of Problems Efficient Algorithms Exist Belong to Class P Easy to Solve Problems Efficient Algorithms do not Exist We do not know whether efficient algorithm exist or not. It is undecided i.e. Have not found an efficient algorithm nor do we know if they exist NP Complete problems: If a solution is found one can check if it runs on polynomial time. Easy to Check Problems NP Hard Problems : P and NP problems are Decision Problems. HPP is a Decision Problem.. Some are optimization Problems. The TSA is a optimization problem. The decision version of TSA is NP complete, so the optimization version of TSA is NP hard.

Graphs Described by two sets V the set of nodes or vertices E set of edges A distinct pairs of vertices Graph G is denoted by G = (V,E) vertices by u,v or w. Edges by e or pairs of vertices (u,v) V = {1, 2, 3, 4} E = { (1, 2),(2, 4),(4,2) (4,1)}

Definitions Undirected graphs: Edge is unordered pair of vertices [(u,v) = (v,u)] Directed graph: Edge is an ordered pair of vertices [(u,v) ≠ (v,u)] Path is a list of distinct vertices A cycle is a path such that it travels and no edge is repeated. Weighted Graph: We associate a real number with edge. The weight of an edge (u,v) is called it’s cost Distance between u,v. 3, 4} E

Problems with Graphs Hamiltonian Path Problem Given a directed or undirected graph find: A cycle in the graph such that every vertex appears exactly once (except first and last vertex). If this is done we have a Hamiltonian Path. Traveling salesman problem: Some cities are modeled as vertices and roads as edges. Traveling salesman are interested in minimizing the distance when visiting the cities.

Hamiltonian Path Given a graph G, does there exist a closed path through the graph that visits each vertex once and only once? Allowed traversal

Forbidden Traversal, since the circled vertices are not visited. The horizontal and vertical mirror images of this traversal are also forbidden (first and second forbidden traversals). Forbidden Traversal, since the circled vertices are not visited. The horizontal and vertical mirror images of this traversals are also forbidden (third and fourth forbidden traversals).

List of resources Leon Adelman (The man who started it all) Links to GOOD reviews seemanlab4.chem.nyu.edu DNA nanotechnology How to solve it by Computer R. Dromley, Prentice Hall India.

Computing with DNA The Hamiltonian Path Problem Introduction Watson Crick Pairing Polymerases Ligases Gel Electrophoresis DNA Synthesis

Why DNA Computing for the Hamiltonian Problem 1 Algorithmically it is now Clear that one needs massive Parallelism to solve HPP. 2 DNA Computing Represents Massive Parallelism. 3 It has been Calculated that DNA can Hold 1bit/nm 3 while Silicon Based Computers can Hold 1bit/µm 3.

DNA Represents Massive Parallelism For a piece of DNA with a length of 20 bases. 1ml of M solution will contain molecules. Suppose we make a strands having different base sequences (100 copies of each sequence in solution) Introduction 1ml of M and among these there are strands with 1000 copies each are sequences which are complements to the earlier strands and are not. These will hybridize with the original strand in an extremely parallel fashion. We will find 10 4 different sequences with 100 copies each

The Algorithm Given a graph with n vertices Generate a set of random paths through the graph For each path in the set: Check whether it starts from start vertex and ends with end vertex; if not remove that path from the set. Check it that path through exactly n vertices, it not remove that path from the set. For each vertex, check if the path passes through the vertex. It not remove that path from the set. If the set is not empty Report a Hamiltonian path If the set is Empty Report that there is No Hamiltonian Path.

1 Generate a Pool of Random Paths Synthesize: Complementary DNA City Names (10 14 molecules) and DNA flight Numbers (10 14 molecules) Take these, put it together with ligase in about 1 second. One has the answer Randomly A--B: GCAGTCGG meets Boston Complementary DNA AGCCTGAC by design the A-B sequence ends with TCGG and sequence starts with AGCC. G CA GT CG G A GC CT GA C

G C A G T C G G Boston* Atlanta - Boston T G A A C G T C A G C C T G A C G C A G T C G G A C T G G G C T Atlanta*Boston* Boston - Chicago

T G A A C G T C A G C C T G A C C C G A T A C A G C A G T C G G A C T G G G C T A T G T C C G A Atlanta* Boston*Detroit* Atlanta - Boston - Chicago - Detroit

Paths Remaining 1. A-B 2. B-A 3. B-D 4. B-C 5. A-D 6. C-D 7. A-B-C 8. A-B-D 9. B-C-D 10. B-A-D 11. A-B-C-D 12. A-B-A-D After I Step in the Algorithm

After II Step of the Algorithm Paths Left out are: 1. A-D 2. A-B-D 3. A-B-C-D 4. A-B-A-D

After III Step Of the Algorithm Paths Left are: 1. A-B-C-D 2. A-B-A-D

After the Last Step in the Algorithm 1. A-B-C-D

Deterministic & Non-Deterministic Algorithms  Deterministic Algorithms are ones when the Next Step is Fully Defined : Is x a Multiple of y ?  Non Deterministic Algorithms have Steps that Branch out in Several Directions.  When one goes through A-B or A-D one has to Guess as Well as Split.  Computers based on Molecules Mimic both Guessing & Splitting.

 The Future of Computing