This document discusses NP-complete problems and nondeterministic algorithms. It begins by introducing NP-completeness as evidence that many important problems cannot be solved quickly. It then defines different complexity classes like P, NP, NP-hard, and NP-complete. It provides examples of NP-complete problems like maximum clique and 0/1 knapsack. It also discusses how to show that a problem is NP-complete using polynomial-time reductions from another known NP-complete problem. In particular, it shows that the clique decision problem is NP-complete by reducing SAT to it.
Here are the answers to your questions:
Q.1) There are two main classes of NP problems:
- NP-Complete problems: Problems that are in NP and are at least as hard as any other problem in NP. This means if you can efficiently solve one NP-Complete problem, then you can efficiently solve any problem in NP.
- NP-Hard problems: Problems at least as hard as the hardest problems in NP. NP-Hard problems may not necessarily be in NP.
Q.2) A nondeterministic algorithm is one that, at some step, can choose from multiple possible choices without a clear deterministic rule for how to pick the choice. It is modeled as having the ability to "guess" the right
1) Complexity classes categorize problems based on the time and space complexity of their solutions. P represents problems solvable in polynomial time, while NP includes problems verifiable in polynomial time.
2) NP-hard problems are at least as hard as any problem in NP, and NP-complete problems are both in NP and NP-hard - they are the most difficult problems in NP.
3) Reducibility is used to prove problems are NP-complete - if problem A can be reduced to problem B in polynomial time, and B is NP-complete, then A is also NP-complete. 3-SAT is reduced to the clique problem by creating graph vertices for each literal.
This document discusses NP-hard and NP-complete problems. It begins by defining the classes P, NP, NP-hard, and NP-complete. It then provides examples of NP-hard problems like the traveling salesperson problem, satisfiability problem, and chromatic number problem. It explains that to show a problem is NP-hard, one shows it is at least as hard as another known NP-hard problem. The document concludes by discussing how restricting NP-hard problems can result in problems that are solvable in polynomial time.
This document discusses dynamic programming algorithms and NP-completeness. It begins by outlining 12 steps for proving that a new problem Pnew is NP-complete. It then provides examples of reducing the clique problem to the independent set problem to show they are equivalent. The document explains the concepts of instances, solutions, validity and reductions. It shows how to reduce any NP problem to the circuit satisfiability problem by building a circuit VI(S) that is equivalent to checking if a solution S is valid for a given instance I.
This document discusses NP-complete problems and their properties. Some key points:
- NP-complete problems have an exponential upper bound on runtime but only a polynomial lower bound, making them appear intractable. However, their intractability cannot be proven.
- NP-complete problems are reducible to each other in polynomial time. Solving one would solve all NP-complete problems.
- NP refers to problems that can be verified in polynomial time. P refers to problems that can be solved in polynomial time.
- A problem is NP-complete if it is in NP and all other NP problems can be reduced to it in polynomial time. Proving a problem is NP-complete involves showing
This document discusses NP-completeness and NP-hard problems. It begins by reviewing P vs NP problem classes and introduces the concepts of NP-hard and NP-complete problems. It provides examples of well-known NP-complete problems and discusses techniques for proving that a problem is NP-complete, such as reducing it to the SAT, CLIQUE, or vertex cover problems. The document aims to define key complexity classes like P, NP, NP-hard and NP-complete and explain the relationships between them.
NP-completeness means that many important computational problems cannot be solved quickly in polynomial time. NP-complete problems are a class of problems for which no efficient solution algorithms have been found. Many significant problems in computer science, such as the traveling salesman problem, satisfiability problems, and graph covering problems belong to this class. A problem is considered NP-complete if it can be solved by a non-deterministic algorithm in polynomial time and every problem in NP can be reduced to it in polynomial time. Showing that a problem is NP-complete involves proving that it is in NP and that a known NP-complete problem can be reduced to it in polynomial time. If any NP-complete problem could be solved in polynomial time
This document discusses the complexity classes P, NP, and NP-completeness. It begins by explaining why determining if P=NP is important, as it has implications for many practical problems. It then defines the classes P and NP formally and provides examples of problems in each class. It establishes that P is a subset of NP and that NP is a subset of EXP. The document concludes by introducing the concept of NP-completeness and stating the Cook-Levin theorem, which shows that the satisfiability problem (SAT) is NP-complete.
Here are the answers to your questions:
Q.1) There are two main classes of NP problems:
- NP-Complete problems: Problems that are in NP and are at least as hard as any other problem in NP. This means if you can efficiently solve one NP-Complete problem, then you can efficiently solve any problem in NP.
- NP-Hard problems: Problems at least as hard as the hardest problems in NP. NP-Hard problems may not necessarily be in NP.
Q.2) A nondeterministic algorithm is one that, at some step, can choose from multiple possible choices without a clear deterministic rule for how to pick the choice. It is modeled as having the ability to "guess" the right
1) Complexity classes categorize problems based on the time and space complexity of their solutions. P represents problems solvable in polynomial time, while NP includes problems verifiable in polynomial time.
2) NP-hard problems are at least as hard as any problem in NP, and NP-complete problems are both in NP and NP-hard - they are the most difficult problems in NP.
3) Reducibility is used to prove problems are NP-complete - if problem A can be reduced to problem B in polynomial time, and B is NP-complete, then A is also NP-complete. 3-SAT is reduced to the clique problem by creating graph vertices for each literal.
This document discusses NP-hard and NP-complete problems. It begins by defining the classes P, NP, NP-hard, and NP-complete. It then provides examples of NP-hard problems like the traveling salesperson problem, satisfiability problem, and chromatic number problem. It explains that to show a problem is NP-hard, one shows it is at least as hard as another known NP-hard problem. The document concludes by discussing how restricting NP-hard problems can result in problems that are solvable in polynomial time.
This document discusses dynamic programming algorithms and NP-completeness. It begins by outlining 12 steps for proving that a new problem Pnew is NP-complete. It then provides examples of reducing the clique problem to the independent set problem to show they are equivalent. The document explains the concepts of instances, solutions, validity and reductions. It shows how to reduce any NP problem to the circuit satisfiability problem by building a circuit VI(S) that is equivalent to checking if a solution S is valid for a given instance I.
This document discusses NP-complete problems and their properties. Some key points:
- NP-complete problems have an exponential upper bound on runtime but only a polynomial lower bound, making them appear intractable. However, their intractability cannot be proven.
- NP-complete problems are reducible to each other in polynomial time. Solving one would solve all NP-complete problems.
- NP refers to problems that can be verified in polynomial time. P refers to problems that can be solved in polynomial time.
- A problem is NP-complete if it is in NP and all other NP problems can be reduced to it in polynomial time. Proving a problem is NP-complete involves showing
This document discusses NP-completeness and NP-hard problems. It begins by reviewing P vs NP problem classes and introduces the concepts of NP-hard and NP-complete problems. It provides examples of well-known NP-complete problems and discusses techniques for proving that a problem is NP-complete, such as reducing it to the SAT, CLIQUE, or vertex cover problems. The document aims to define key complexity classes like P, NP, NP-hard and NP-complete and explain the relationships between them.
NP-completeness means that many important computational problems cannot be solved quickly in polynomial time. NP-complete problems are a class of problems for which no efficient solution algorithms have been found. Many significant problems in computer science, such as the traveling salesman problem, satisfiability problems, and graph covering problems belong to this class. A problem is considered NP-complete if it can be solved by a non-deterministic algorithm in polynomial time and every problem in NP can be reduced to it in polynomial time. Showing that a problem is NP-complete involves proving that it is in NP and that a known NP-complete problem can be reduced to it in polynomial time. If any NP-complete problem could be solved in polynomial time
This document discusses the complexity classes P, NP, and NP-completeness. It begins by explaining why determining if P=NP is important, as it has implications for many practical problems. It then defines the classes P and NP formally and provides examples of problems in each class. It establishes that P is a subset of NP and that NP is a subset of EXP. The document concludes by introducing the concept of NP-completeness and stating the Cook-Levin theorem, which shows that the satisfiability problem (SAT) is NP-complete.
This document discusses the complexity classes P, NP, and NP-Complete.
P is the class of problems solvable in polynomial time. NP is the class of problems verifiable in polynomial time. NP-Complete problems are the hardest problems in NP, such that any NP problem can be reduced to an NP-Complete problem in polynomial time. Some examples of problems in each class are given, such as fractional knapsack in P and NP, and SAT and the traveling salesman problem in NP-Complete. It is still an open question whether P equals NP.
This document provides an overview of complexity theory, including:
- Asymptotic notation like Big-O, Big-Omega, and Big-Theta for analyzing algorithm runtime.
- Deterministic algorithms that always produce the same output for a given input.
- Non-deterministic algorithms that may produce different outputs for the same input.
- The classes P and NP, where P contains problems solvable in polynomial time and NP contains problems verifiable in polynomial time.
- NP-complete problems, the hardest problems in NP, like 3-Satisfiability and the Hamiltonian Cycle problem.
This document provides an overview of complexity theory concepts including:
- Asymptotic notation like Big-O, Big-Omega, and Big-Theta for analyzing algorithm runtime.
- The difference between deterministic and non-deterministic algorithms, with deterministic algorithms always providing the same output for a given input, and non-deterministic algorithms possibly providing different outputs.
- The classes P and NP, with P containing problems solvable in polynomial time by a deterministic algorithm, and NP containing problems verifiable in polynomial time by a non-deterministic algorithm.
- NP-complete problems being the hardest problems in NP, with examples like the knapsack problem, Hamiltonian path problem, and Boolean satisfiability problem.
1) The document discusses the complexity classes P, NP, NP-hard and NP-complete. P refers to problems that can be solved in polynomial time, while NP includes problems that can be verified in polynomial time.
2) NP-hard problems are at least as hard as the hardest problems in NP. NP-complete problems are the hardest problems in NP. If any NP-complete problem could be solved in polynomial time, then P would be equal to NP.
3) Common NP-complete problems discussed include the traveling salesman problem and integer knapsack problem. Reductions are used to show that one problem is at least as hard as another.
This document provides information about an upcoming midterm exam and lecture topics related to complexity theory. It discusses:
- The HW and midterm being due next week, with the HW preparing students for the exam.
- Topics from recent and upcoming lectures that will be covered on the midterm, including definitions of P, NP, NP-hard, and NP-complete problems.
- Complexity classes like P and NP and examples of problems in each, such as the complexity of primality testing. Reducibility between problems is also covered.
- Upcoming lecture topics on complexity examples and analyzing exponential time complexity through examples like computing Fibonacci numbers.
This document provides information about an upcoming midterm exam and lecture topics related to complexity theory. It notes that the homework is due next week and is important preparation for the midterm on Tuesday. Today's and parts of Thursday's lecture will be covered in the midterm. Upcoming lectures will focus on definitions of P, NP, NP-hard and NP-complete problems, and examples of complexity classes like polynomial time. The document concludes with examples of reducing problems like 3-SAT to CLIQUE to show NP-completeness.
This document describes the CSE 215 Algorithms course. It provides an overview of the course purpose, textbook, instructor, grading policy, prerequisites, and topics to be covered including proof by induction, asymptotic notation, and analysis of algorithms. The analysis will focus on determining the asymptotic performance of algorithms as the problem size increases. Proof techniques like induction will be used to analyze algorithms precisely.
The document discusses NP-completeness and algorithms. It introduces dynamic programming and greedy algorithms. It then discusses the activity selection problem and shows it can be solved greedily by choosing the activity with the earliest finish time at each step. Finally, it defines the classes P and NP, introduces the concept of reductions to show problems are NP-complete, and states that if any NP-complete problem can be solved in polynomial time, then P=NP.
This document discusses P, NP and NP-complete problems. It begins by introducing tractable and intractable problems, and defines problems that can be solved in polynomial time as tractable, while problems that cannot are intractable. It then discusses the classes P and NP, with P containing problems that can be solved deterministically in polynomial time, and NP containing problems that can be solved non-deterministically in polynomial time. The document concludes by defining NP-complete problems as those in NP that are as hard as any other problem in the class, in that any NP problem can be reduced to an NP-complete problem in polynomial time.
The document discusses time and space complexity analysis of algorithms. Time complexity measures the number of steps to solve a problem based on input size, with common orders being O(log n), O(n), O(n log n), O(n^2). Space complexity measures memory usage, which can be reused unlike time. Big O notation describes asymptotic growth rates to compare algorithm efficiencies, with constant O(1) being best and exponential O(c^n) being worst.
This document discusses P, NP, NP-hard and NP-complete problems. It begins by defining tractable problems that can be solved in polynomial time as class P problems. Intractable problems that cannot be solved in reasonable time with increasing input size are also introduced. NP is the class of problems that can be solved by a non-deterministic machine in polynomial time. NP-hard problems are those that are at least as hard as the hardest problems in NP, and NP-complete problems are NP-hard problems that are also in NP. Common NP-complete problems like 3-SAT and the clique problem are reduced to each other to demonstrate their equivalence. Prior questions related to complexity classes are also addressed.
This document discusses P, NP, NP-hard and NP-complete problems. It begins by defining tractable problems that can be solved in polynomial time as class P problems. Intractable problems that cannot be solved in reasonable time with increasing input size are also introduced. NP is the class of problems that can be solved by a non-deterministic machine in polynomial time. NP-hard problems are those that are at least as hard as the hardest problems in NP, and NP-complete problems are NP-hard problems that are also in NP. Common NP-complete problems like 3-SAT and the clique problem are reduced to each other to demonstrate their equivalence. Prior questions related to complexity classes are also addressed.
1) NP-Completeness refers to problems that are in NP (can be verified in polynomial time) and are as hard as any problem in NP.
2) The first problem proven to be NP-Complete was the Circuit Satisfiability problem, which asks whether there exists an input assignment that makes a Boolean circuit output 1.
3) To prove a problem P is NP-Complete, it must be shown that P is in NP and that any problem in NP can be reduced to P in polynomial time. This establishes P as at least as hard as any problem in NP.
P, NP, NP-Complete, and NP-Hard
Reductionism in Algorithms
NP-Completeness and Cooks Theorem
NP-Complete and NP-Hard Problems
Travelling Salesman Problem (TSP)
Travelling Salesman Problem (TSP) - Approximation Algorithms
PRIMES is in P - (A hope for NP problems in P)
Millennium Problems
Conclusions
This document discusses algorithms and their analysis. It begins by defining an algorithm and its key characteristics like being finite, definite, and terminating after a finite number of steps. It then discusses designing algorithms to minimize cost and analyzing algorithms to predict their performance. Various algorithm design techniques are covered like divide and conquer, binary search, and its recursive implementation. Asymptotic notations like Big-O, Omega, and Theta are introduced to analyze time and space complexity. Specific algorithms like merge sort, quicksort, and their recursive implementations are explained in detail.
This document provides an overview of NP-completeness and polynomial time reductions. It defines the classes P and NP, and explains that the core question is whether P=NP. NP-complete problems are the hardest problems in NP, and to prove a problem is NP-complete it must be shown to be in NP and there must be a polynomial time reduction from a known NP-complete problem like 3-SAT. Examples of NP-complete problems discussed include Clique, Independent Set, and Minesweeper. The document outlines the method for proving a problem is NP-complete using a reduction from 3-SAT.
The document discusses the theory of NP-completeness. It begins by classifying problems as solvable, unsolvable, tractable, or intractable. It then defines deterministic and nondeterministic algorithms, and how nondeterministic algorithms can be expressed. The document introduces the complexity classes P and NP. It discusses reducing one problem to another to prove NP-completeness via transitivity. Several classic NP-complete problems are proven to be NP-complete, such as 3SAT, 3-coloring, and subset sum. The document also discusses how to cope with NP-complete problems in practice by sacrificing optimality, generality, or efficiency.
1) NP refers to problems that can be solved by a non-deterministic Turing machine in polynomial time. This includes problems where a potential solution can be verified in polynomial time.
2) Examples of NP-complete problems include the Hamiltonian cycle problem and the traveling salesman problem. These problems are among the hardest problems in NP.
3) It is a major open question whether P=NP, which would mean that NP-complete problems could be solved in polynomial time by a deterministic machine. Most experts believe P≠NP but there is no proof.
This document discusses lower bounds and limitations of algorithms. It begins by defining lower bounds and providing examples of problems where tight lower bounds have been established, such as sorting requiring Ω(nlogn) comparisons. It then discusses methods for establishing lower bounds, including trivial bounds, decision trees, adversary arguments, and problem reduction. The document covers several examples to illustrate these techniques. It also discusses the complexity classes P, NP, and NP-complete problems. Finally, it discusses approaches for tackling difficult combinatorial problems that are NP-hard, including exact and approximation algorithms.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
This document discusses the complexity classes P, NP, and NP-Complete.
P is the class of problems solvable in polynomial time. NP is the class of problems verifiable in polynomial time. NP-Complete problems are the hardest problems in NP, such that any NP problem can be reduced to an NP-Complete problem in polynomial time. Some examples of problems in each class are given, such as fractional knapsack in P and NP, and SAT and the traveling salesman problem in NP-Complete. It is still an open question whether P equals NP.
This document provides an overview of complexity theory, including:
- Asymptotic notation like Big-O, Big-Omega, and Big-Theta for analyzing algorithm runtime.
- Deterministic algorithms that always produce the same output for a given input.
- Non-deterministic algorithms that may produce different outputs for the same input.
- The classes P and NP, where P contains problems solvable in polynomial time and NP contains problems verifiable in polynomial time.
- NP-complete problems, the hardest problems in NP, like 3-Satisfiability and the Hamiltonian Cycle problem.
This document provides an overview of complexity theory concepts including:
- Asymptotic notation like Big-O, Big-Omega, and Big-Theta for analyzing algorithm runtime.
- The difference between deterministic and non-deterministic algorithms, with deterministic algorithms always providing the same output for a given input, and non-deterministic algorithms possibly providing different outputs.
- The classes P and NP, with P containing problems solvable in polynomial time by a deterministic algorithm, and NP containing problems verifiable in polynomial time by a non-deterministic algorithm.
- NP-complete problems being the hardest problems in NP, with examples like the knapsack problem, Hamiltonian path problem, and Boolean satisfiability problem.
1) The document discusses the complexity classes P, NP, NP-hard and NP-complete. P refers to problems that can be solved in polynomial time, while NP includes problems that can be verified in polynomial time.
2) NP-hard problems are at least as hard as the hardest problems in NP. NP-complete problems are the hardest problems in NP. If any NP-complete problem could be solved in polynomial time, then P would be equal to NP.
3) Common NP-complete problems discussed include the traveling salesman problem and integer knapsack problem. Reductions are used to show that one problem is at least as hard as another.
This document provides information about an upcoming midterm exam and lecture topics related to complexity theory. It discusses:
- The HW and midterm being due next week, with the HW preparing students for the exam.
- Topics from recent and upcoming lectures that will be covered on the midterm, including definitions of P, NP, NP-hard, and NP-complete problems.
- Complexity classes like P and NP and examples of problems in each, such as the complexity of primality testing. Reducibility between problems is also covered.
- Upcoming lecture topics on complexity examples and analyzing exponential time complexity through examples like computing Fibonacci numbers.
This document provides information about an upcoming midterm exam and lecture topics related to complexity theory. It notes that the homework is due next week and is important preparation for the midterm on Tuesday. Today's and parts of Thursday's lecture will be covered in the midterm. Upcoming lectures will focus on definitions of P, NP, NP-hard and NP-complete problems, and examples of complexity classes like polynomial time. The document concludes with examples of reducing problems like 3-SAT to CLIQUE to show NP-completeness.
This document describes the CSE 215 Algorithms course. It provides an overview of the course purpose, textbook, instructor, grading policy, prerequisites, and topics to be covered including proof by induction, asymptotic notation, and analysis of algorithms. The analysis will focus on determining the asymptotic performance of algorithms as the problem size increases. Proof techniques like induction will be used to analyze algorithms precisely.
The document discusses NP-completeness and algorithms. It introduces dynamic programming and greedy algorithms. It then discusses the activity selection problem and shows it can be solved greedily by choosing the activity with the earliest finish time at each step. Finally, it defines the classes P and NP, introduces the concept of reductions to show problems are NP-complete, and states that if any NP-complete problem can be solved in polynomial time, then P=NP.
This document discusses P, NP and NP-complete problems. It begins by introducing tractable and intractable problems, and defines problems that can be solved in polynomial time as tractable, while problems that cannot are intractable. It then discusses the classes P and NP, with P containing problems that can be solved deterministically in polynomial time, and NP containing problems that can be solved non-deterministically in polynomial time. The document concludes by defining NP-complete problems as those in NP that are as hard as any other problem in the class, in that any NP problem can be reduced to an NP-complete problem in polynomial time.
The document discusses time and space complexity analysis of algorithms. Time complexity measures the number of steps to solve a problem based on input size, with common orders being O(log n), O(n), O(n log n), O(n^2). Space complexity measures memory usage, which can be reused unlike time. Big O notation describes asymptotic growth rates to compare algorithm efficiencies, with constant O(1) being best and exponential O(c^n) being worst.
This document discusses P, NP, NP-hard and NP-complete problems. It begins by defining tractable problems that can be solved in polynomial time as class P problems. Intractable problems that cannot be solved in reasonable time with increasing input size are also introduced. NP is the class of problems that can be solved by a non-deterministic machine in polynomial time. NP-hard problems are those that are at least as hard as the hardest problems in NP, and NP-complete problems are NP-hard problems that are also in NP. Common NP-complete problems like 3-SAT and the clique problem are reduced to each other to demonstrate their equivalence. Prior questions related to complexity classes are also addressed.
This document discusses P, NP, NP-hard and NP-complete problems. It begins by defining tractable problems that can be solved in polynomial time as class P problems. Intractable problems that cannot be solved in reasonable time with increasing input size are also introduced. NP is the class of problems that can be solved by a non-deterministic machine in polynomial time. NP-hard problems are those that are at least as hard as the hardest problems in NP, and NP-complete problems are NP-hard problems that are also in NP. Common NP-complete problems like 3-SAT and the clique problem are reduced to each other to demonstrate their equivalence. Prior questions related to complexity classes are also addressed.
1) NP-Completeness refers to problems that are in NP (can be verified in polynomial time) and are as hard as any problem in NP.
2) The first problem proven to be NP-Complete was the Circuit Satisfiability problem, which asks whether there exists an input assignment that makes a Boolean circuit output 1.
3) To prove a problem P is NP-Complete, it must be shown that P is in NP and that any problem in NP can be reduced to P in polynomial time. This establishes P as at least as hard as any problem in NP.
P, NP, NP-Complete, and NP-Hard
Reductionism in Algorithms
NP-Completeness and Cooks Theorem
NP-Complete and NP-Hard Problems
Travelling Salesman Problem (TSP)
Travelling Salesman Problem (TSP) - Approximation Algorithms
PRIMES is in P - (A hope for NP problems in P)
Millennium Problems
Conclusions
This document discusses algorithms and their analysis. It begins by defining an algorithm and its key characteristics like being finite, definite, and terminating after a finite number of steps. It then discusses designing algorithms to minimize cost and analyzing algorithms to predict their performance. Various algorithm design techniques are covered like divide and conquer, binary search, and its recursive implementation. Asymptotic notations like Big-O, Omega, and Theta are introduced to analyze time and space complexity. Specific algorithms like merge sort, quicksort, and their recursive implementations are explained in detail.
This document provides an overview of NP-completeness and polynomial time reductions. It defines the classes P and NP, and explains that the core question is whether P=NP. NP-complete problems are the hardest problems in NP, and to prove a problem is NP-complete it must be shown to be in NP and there must be a polynomial time reduction from a known NP-complete problem like 3-SAT. Examples of NP-complete problems discussed include Clique, Independent Set, and Minesweeper. The document outlines the method for proving a problem is NP-complete using a reduction from 3-SAT.
The document discusses the theory of NP-completeness. It begins by classifying problems as solvable, unsolvable, tractable, or intractable. It then defines deterministic and nondeterministic algorithms, and how nondeterministic algorithms can be expressed. The document introduces the complexity classes P and NP. It discusses reducing one problem to another to prove NP-completeness via transitivity. Several classic NP-complete problems are proven to be NP-complete, such as 3SAT, 3-coloring, and subset sum. The document also discusses how to cope with NP-complete problems in practice by sacrificing optimality, generality, or efficiency.
1) NP refers to problems that can be solved by a non-deterministic Turing machine in polynomial time. This includes problems where a potential solution can be verified in polynomial time.
2) Examples of NP-complete problems include the Hamiltonian cycle problem and the traveling salesman problem. These problems are among the hardest problems in NP.
3) It is a major open question whether P=NP, which would mean that NP-complete problems could be solved in polynomial time by a deterministic machine. Most experts believe P≠NP but there is no proof.
This document discusses lower bounds and limitations of algorithms. It begins by defining lower bounds and providing examples of problems where tight lower bounds have been established, such as sorting requiring Ω(nlogn) comparisons. It then discusses methods for establishing lower bounds, including trivial bounds, decision trees, adversary arguments, and problem reduction. The document covers several examples to illustrate these techniques. It also discusses the complexity classes P, NP, and NP-complete problems. Finally, it discusses approaches for tackling difficult combinatorial problems that are NP-hard, including exact and approximation algorithms.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
2. Introduction
• NP-completeness is a form of bad news!
▫ Evidence that many important problems can not
be solved quickly.
• Knowing that they are hard lets you stop beating
your head against a wall trying to solve them…
▫ Use a heuristic: come up with a method for
solving a reasonable fraction of the common cases.
▫ Solve approximately: come up with a solution
that you can prove that is close to right.
▫ Use an exponential time solution: if you
really have to solve the problem exactly and stop
worrying about finding a better solution.
3. Introduction
• Problems
▫ Tractable: have polynomial time algorithms, i.e.,
O(nk) for some k.
▫ Intractable: have no polynomial time algorithm,
such as O(2n).
• NP-complete problems
▫ Whose status is unknown.
▫ No polynomial-time algorithm has yet been
discovered for an NP-complete problem, nor has
anyone yet been able to prove that no polynomial-
time algorithm can exist for any one of them.
4. Nondeterministic Algorithms
• Deterministic Algorithm
▫ The result of every operation is uniquely defined.
• Nondeterministic Algorithms
▫ Contain operations whose outcomes are not
uniquely defined but limited to specified sets of
possibilities.
▫ The machine executing such operations is allowed
to choose any one of these outcomes subject to a
termination condition.
5. Nondeterministic Algorithms
• Nondeterministic algorithms uses three
functions:
▫ Choice(S): arbitrarily chooses one of the elements
of set S.
▫ Failure(): signals an unsuccessful completion.
▫ Success(): signals a successful completion.
• All of these functions are O(1).
• x = Choice(1,n) could result in x being assigned
any one of the integers in the range [1,n].
• A nondeterministic algorithm terminates
unsuccessfully if and only if there exists no set of
choices leading to a success signal.
6. Example: nondeterministic search
1. j := Choice(1,n);
2. if A[j] = x then {write (j); Success();}
3. write (0); Failure();
• Time Complexity is O(1)
7. Example: nondeterministic sort
1. Algorithm NSort(A, n)
2. {
3. for i:=1 to n do B[i]:= 0;
4. for i:=1 to n do
5. {
6. j:=Choice(1,n);
7. if B[j] <> 0 then Failure();
8. B[j] = A[i];
9. }
10. for i:=1 to n-1 do
11. if B[i] > B[i+1] then Failure();
12. write (B[1:n]);
13. success();
14. }
8. Nondeterministic Machine
• Whenever successful termination is possible, a
nondeterministic machine makes a sequence of
choices that is a shortest sequence leading to a
successful termination.
• In case there is no sequence of choices leading to
a successful termination, we assume that the
algorithm terminates in one unit of time with
output "unsuccessful computation."
• Since, the machine is fictitious, it is not necessary
for us to concern ourselves with how the machine
can make a correct choice at each step.
9. Decision vs. Optimization Problems
• Decision Problems
▫ Any problem for which the answer is either zero or
one is called a decision problem.
▫ An algorithm for a decision problem is termed a
decision algorithm.
• Optimization Problems
▫ Any problem that involves the identification of an
optimal (either minimum or maximum) value of a
given cost function is known as an optimization
problem.
▫ An optimization algorithm is used to solve an
optimization problem.
10. Decision vs. Optimization Problems
• Many optimization problems can be recast into
decision problems with the property that the
decision problem can be solved in polynomial
time if and only if the corresponding
optimization problem can.
• In other cases, we can at least make the
statement that if the decision problem cannot be
solved in polynomial time, then the optimization
problem cannot either.
11. Example: Maximum Clique
• A maximal complete sub-graph of a graph G =
(V,E) is a clique.
• The size of the clique is the number of vertices in
it.
• The max clique problem is an optimization
problem that has to determine the size of a largest
clique in G.
• The corresponding decision problem is to
determine whether G has a clique of size at least k
for some given k.
12. Example: Maximum Clique
• Let DClique(G, k) be a deterministic decision
algorithm for the clique decision problem.
• If the number of vertices in G is n, the size of a
max clique in G can be found by making several
applications of DClique.
• DClique is used once for each k, k = n, n-1, n-2,...,
until the output from DClique is 1.
• If the time complexity of DClique is f(n), then the
size of a max clique can be found in time less than
or equal to n*f(n).
13. Example: Maximum Clique
• Also, if the size of a max clique can be
determined in time g(n), then the decision
problem can be solved in time g(n).
• Hence, the max clique problem can be solved in
polynomial time if and only if the clique decision
problem can be solved in polynomial time.
14. Example: 0/1 Knapsack
• The knapsack decision problem is to determine
whether there is a 0/1 assignment of values to xi,
1 < i < n, such that pi xi r and wi xi m. The
r is a given number.
• If the knapsack decision problem cannot be
solved in deterministic polynomial time, then
the optimization problem cannot either.
15. Time Complexity of Nondeterministic
Machines
• Definition
▫ The time required by a nondeterministic
algorithm performing on any given input is
the minimum number of steps needed to reach a
successful completion if there exists a sequence of
choices leading to such a completion.
O(1) if successful completion is not possible
▫ A nondeterministic algorithm is of complexity
O(f(n)) if for all inputs of size n, n > no, that result
in a successful completion, the time required is at
most cf(n) for some constants c and no
16. Nondeterministic Knapsack Alg.
1. Algorithm DKP(p, w, n, m, r, x)
2. {
3. W := 0; P := 0;
4. for i := 1 to n do
5. {
6. x[i] := Choice(0,1);
7. W := W + x[i] * w[i]; P := P + x[i] * p[i]
8. }
9. if ((W > m) or (P < r)) then Failure();
10. else Success();
11. }
Time Complexity = O(n)
17. Nondeterministic Clique Alg.
1. Algorithm DCP(G, n, k)
2. {
3. S :=;
4. for i := 1 to k do
5. {
6. t := Choice(1,n);
7. if t S then Failure();
8. S := S {t}
9. }
10. for all pairs (i,j) such that iS, j S, and i j do
11. if (i, j) is not an edge of G then Failure();
12. Success();
13. }
18. Classes P and NP
• P is the set of all decision problems solvable by
deterministic algorithms in polynomial time.
• NP is the set of all decision problems solvable by
nondeterministic algorithms in polynomial time.
• Since deterministic algorithms are just a special
case of nondeterministic ones P NP.
• Perhaps the most famous unsolved problem in
computer science, is whether P = NP or PNP.
• Most computer scientists believe that PNP, but
we do not have a proof.
19. Another Definition for NP
• Nondeterministic algorithms are two stage
procedures:
▫ Guessing stage (nondeterministic):
Generate randomly an arbitrary string that can be
thought of as a candidate solution (certificate)
▫ Verification stage (deterministic)
Take the certificate and the instance to the problem and
returns YES if the certificate represents a solution.
• The class NP consists of those problems that are
verifiable in polynomial time.
▫ we were somehow given a certificate of a solution, then
we could verify that the certificate is correct in time
polynomial in the size of the input to the problem.
20. NP-complete Problems
• Why theoretical computer scientists believe that
P NP?
▫ The class of NP-complete problems.
▫ The NP-complete Problems are the hardest
problems in NP.
▫ if any NP-complete problem can be solved in
polynomial time, then every problem in NP has a
polynomial-time solution, that is, P = NP.
• How to prove a problem is NP-complete?
▫ Reduction
▫ Cook theorem: Satisfiability is NP-complete.
21. Reduction
• Reduction is a way of saying that one problem is
easier than another.
• Definition: Let L1 and L2 be problems. Problem
L1 reduces to L2 (also written L1 L2) if and only
if there is a way to solve L1 by a deterministic
polynomial time algorithm using a deterministic
algorithm that solves L2 in polynomial time.
• Idea: transform the inputs of L1 to inputs of L2
f Problem L2
yes
no
yes
no
Problem L1
22. Polynomial Reductions
• Given two problems L1 and L2, we say that L1 is
polynomially reducible to L2 (L1 p L2) if:
1. There exists a function f that converts the input
of L1 to inputs of L2 in polynomial time
2. L1(i) = YES L2(f(i)) = YES
23. Polynomial Reductions
• We use polynomial-time reductions in the
opposite way to show that a problem has no
polynomial time algorithm.
▫ Suppose we have a decision problem A for which
we already know that no polynomial-time
algorithm can exist.
▫ Suppose further that we have a polynomial-time
reduction transforming instances of A to instances
of B.
▫ Now we can use a simple proof by contradiction to
show that no polynomial time algorithm can exist
for B.
24. Classes NP-hard and NP-complete
• Satisfiability Problem: Let x1, x2 … denote
boolean variables. A literal is either a variable or
its negation. A formula in the propositional
calculus is an expression that can be constructed
using literals and the operations and and or.
▫ Example: (x1 x2) (x3 x4)
• The satisfiability problem is to determine
whether a formula is true for some assignment
of truth values to the variables.
• Cook Theorem: Satisfiability is in P if and only if
P = NP. (See Horowitz for a proof)
25. Classes NP-hard and NP-complete
• A problem L is NP-hard if and only if
satisfiability reduces to L (satisfiability L).
• A problem L is NP-complete if and only if L is
NP-hard and L NP.
• Another Definition:
▫ A problem B is NP-complete if:
• B NP
• A p B for all A NP
27. Classes NP-hard and NP-complete
• To show that a problem L2 is NP-hard, it is
adequate to show L1 L2, where L1 is some
problem already known to be NP-hard.
▫ Since is a transitive relation, it follows that if
satisfiability L1 and L1 L2, then satisfiability L2.
• To show that an NP-hard decision problem is NP-
complete, we have just to exhibit a polynomial
time nondeterministic algorithm for it.
• Theorem: If any NP-Complete problem can be
solved in polynomial time then P = NP.
28. How to show a problem is NP-hard
• The strategy we adopt to show that a problem L2
is NP-hard is:
1. Pick a problem L1 already known to be NP-hard.
2. Show how to obtain (in polynomial deterministic
time) an instance I of L2 from any instance I of L1
such that from the solution of I we can determine
(in polynomial deterministic time) the solution to
instance I of L1.
3. Conclude from step (2) that L1 L2
4. Conclude from steps (1) and (3) and the
transitivity of that L2 is NP-hard.
29. Clique Decision Problem(CDP)
• CNF-satisfiability
▫ CNF is a special case of SAT
• is in “Conjuctive Normal Form” (CNF)
▫ “AND” of expressions (i.e., clauses)
▫ Each clause contains only “OR”s of the variables
and their complements
▫ E.g.: = (x1 x2) (x1 x2) ( x1 x2)
• satidfiability CNF-satidfiability
▫ See sec. 11.2 (Horowitz)
30. Clique Decision Problem(CDP)
• Clique Problem:
▫ Undirected graph G = (V, E)
▫ Clique: a subset of vertices in V all connected to each
other by edges in E (i.e., forming a complete graph)
▫ Size of a clique: number of vertices it contains
• Optimization problem:
▫ Find a clique of maximum size
• Decision problem:
▫ Does G have a clique of size k?
Clique(G, 2) = YES
Clique(G, 3) = NO
Clique(G, 3) = YES
Clique(G, 4) = NO
31. Clique Decision Problem(CDP)
• Theorem: CNF-satidfiability CDP
• Proof: Let be a propositional formula
in CNF. Let xi, 1 i n, be the variables in F.
▫ We show how to construct from F a graph G = (V,
E) such that G has a clique of size at least k if and
only if F is satisfiable.
▫ If the length of F is m, then G is obtainable from F
in 0(m) time.
▫ Hence, if we have a polynomial time algorithm for
CDP, then we can obtain a polynomial time
algorithm for CNF-satisfiability using this
construction.
i
k
i C
F
1
32. Clique Decision Problem(CDP)
• For any F, G = {V,E) is defined as follows:
▫ V = {<, i> | is a literal in clause Ci}
▫ E = {(<,i>, <,j>) | ij and (bar)}.
3
2
1
3
2
1 x
x
x
x
x
x
F
33. Clique Decision Problem(CDP)
• Claim: F is satisfiable if and only if G has a clique of
size k.
• Proof:
▫ If F is satisfiable, then there is a set of truth values for
xi, 1 i n, such that each clause is true with this
assignment.
▫ Thus, with this assignment there is at least one literal
in each Ci such that is true.
▫ Let S = {<,i> | is true in Ci} be a set containing
exactly one <,i> for each i.
▫ Between any two nodes <,i> and <,j> in S there is
an edge in G, since i j and both and have the
value true. Thus, S forms a clique in G of size k.
34. Clique Decision Problem(CDP)
• Proof (continued):
▫ Similarly, if G has a clique K = (V',E') of size at
least k, then let S = {<,i> | <,i> V'}.
|S| = k as G has no clique of size more than k.
If S' = { | <,i> S for some i}, then S' cannot
contain both a literal and its complement, as there
is no edge connecting them in G.
Hence by setting xi=true if xiS' and xi=false if
xiS' and choosing arbitrary truth values for
variables not in S' we can satisfy all clauses in F.
▫ Hence, F is satisfiable iff G has a clique of size at
least k.
35. Node Cover Decision Problem (NCDP)
• Node Cover Decision Problem (NCDP)
▫ A set S V is a node cover for a graph G = (V, E) if
and only if all edges in E are incident to at least
one vertex in S. The size |S| of the cover is the
number of vertices in S.
• Example:
▫ S={2,4} is a node cover of size 2, and S={1,3,5} is a
node cover of size 3.
36. Node Cover Decision Problem (NCDP)
• Theorem:
▫ The clique decision problem the node cover
decision problem.
• Proof:
▫ Let G = (V,E) and k define an instance of CDP.
Assume that |V| = n. We construct a graph G such
that G has a node cover of size at most n — k if
and only if G has a clique of size at least k.
▫ Graph G is the complement of G.
37. Node Cover Decision Problem (NCDP)
• Proof:
▫ Let K be any clique in G.
▫ Since there are no edges in connecting vertices in
K, the remaining n — |K| vertices in G' must cover
all edges in .
▫ Similarly, if S is a node cover of G', then V-S must
form a complete subgraph in G.
• Since G' can be obtained from G in polynomial
time, CDP can be solved in polynomial
deterministic time if we have a polynomial time
deterministic algorithm for NCDP.
E
E
39. Directed Hamiltonian Cycle (DHC)
• A directed Hamiltonian cycle in a directed graph
G = (V, E) is a directed cycle of length n = |V|.
So, the cycle goes through every vertex exactly
once and then returns to the starting vertex.
• The DHC problem is to determine whether G has
a directed Hamiltonian cycle.
• Example:
▫ 1-2-3-4-5-1
40. Directed Hamiltonian Cycle (DHC)
• Theorem :
▫ CNF-satisfiability directed Hamiltonian cycle.
• Proof:
▫ Let F be a propositional formula in CNF.
▫ We show how to construct a directed graph G
such that F is satisfiable if and only if G has a
directed Hamiltonian cycle.
▫ Example: 4
3
2
1 C
C
C
C
F
43. Directed Hamiltonian Cycle (DHC)
• Proof (Continued):
▫ If F is satisfiable, then let S be an assignment of
truth values for which F is true.
▫ A Hamiltonian cycle for G can start at v1 and go to
u1, then to v2 then to u2, … and then to un.
▫ In going from vi to ui, this cycle uses the column
corresponding to xi if xi is true in S. Otherwise it
goes up the column corresponding to xi.
▫ From un this cycle goes to A1 and then through
R1,1, R1,2, R1,3, … R1,ji, and B1 to A2 to … v1 .
44. Directed Hamiltonian Cycle (DHC)
• Proof (Continued):
• In going from Ri,a to Ri,a+1 in any subgraph, a
diversion is made to a subgraph in row i if and
only if the vertices of that subgraph are not
already on the path from vi to Ri,a
• Note that if Ci has ij literals, then it allows a
diversion to at most ij -1 subgraphs.
• At least one subgraph must already have been
traversed in Ci
• So, if F is satisfiable, then G has a directed
Hamiltonian cycle.
45. Directed Hamiltonian Cycle (DHC)
• Proof (continued):
▫ If G has a directed Hamiltonian cycle, start at
vertex v1 on that cycle.
▫ Such a cycle must proceed by going up exactly one
column of each pair (xi, xi).
▫ In addition, this part of the cycle must traverse at
least one subgraph in each row.
▫ Hence the columns used in going from vi to ui,
define a truth assignment for which F is true.
• See Coremen Book
▫ Node Cover Decision Problem DHC
46. Traveling Salesperson Decision Problem (TSP)
• Problem
▫ Whether a complete directed graph G=(V,E) with
edge costs c(u,v) has a tour of cost at most M.
• Theorem :
▫ Directed Hamiltonian cycle TSP
• Proof:
▫ From the directed graph G = (V, E) construct the
complete directed graph G' = (V,E'):
E' = {<i,j> | ij}
c(i,j)=1 if <i,j>E and c(i,j)=2 if ij and <i,j> E.
▫ Clearly, G' has a tour of cost at most n iff G has a
directed Hamiltonian cycle.