Lecture 6 - NP Intro Flashcards

1
Q

What is an eulerian cycle?

A

A cycle that traverses each edge exactly once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When does a graph have a eulerian cycle?

A

When each vertex has an even degree (edge to enter and edge to leave)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the complexity of eulerian cycle?

A

O(m+n) with adjacency list
O(m^2) with adjacency matrix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a hamiltonian cycle?

A

cycle that visits each vertex exactly once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is poly time?

A

O(n^c), anything better than exponentia l and factorial time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the time complexity of the brute force solution of hamiltonian cycle?

A

O(n!) as we can have n! permutations (possible paths). For permutation we also have to check whether the path is a hamiltonian cycle, this is O(n^2)

TOTAL IS O(n!n^2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Brute force approach for hamiltonian cycle is more efficient when…

A

using an adjacency matrix. It requires O(n) to check whether an edge exists. We have to check whether a value exists in the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When does the distinction between the runtime of algorithms become dramatic?

A

Between poly-time and exponential time.

O(n^c) -> O(x^n)

This applies even if we increase computing power

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What algorithms are bad in general?

A

Exponential time or worse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What algorithms are good in generaL

A

Polynomial time

These are ‘efficient’ algorithms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When is a problem poly time solvable?

A

When it has a poly-time algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does it mean when a problem is intractable?

A

There doesn’t exist a poly-time solution for the problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What can we try and prove?

A

That a problem is intractable or the problem is just as hard as a family of other difficult problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are these other difficult problems in one family?

A

Np-complete problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

State of the hamiltonian cycle problem:

A
  • no poly-time algorithm
  • no proof of intractability
  • known as a NP-COMPLETE problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What can we do about NP-Complete problems?

A
  • try and search for an exponential time algorithm that does well in practice
  • could only try and solve special cases of the algorithm
  • could search for poly time algorithm tgat only meets some of the specifications