Week 1: Combinatorial Optimisation Flashcards

1
Q

MAX-3-SAT

A

For a given Conjunctive Normal Form with clause length 3, find a \phi that maximises the number of satisfied clauses.

Clauses are in (x1 U x2 U x3) form, with each variable being boolean

The chance of a n-length clause not being satisfied is (1/2)^n. This case, the chance is 1/8.

This is an NP-Complete problem, with a O(2^n) runtime.

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

Polynomial-time

A

O(n^k)

Examples: Dijkstra’s Algorithm, Christofides’ Algorithm, Insertion Sort

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

Exponential-time

A

O(2^{dn})

Examples: Brute-force search, Travelling Salesman Problem (TSP) using Dynamic Programming

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

Constant-time

A

O(1)

The run time is independent of the input size.

Examples: finding the median value in a sorted array of numbers, retrieving items in an array by index.

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

Logarithmic-time

A

O(log n)

Example: Binary Search

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

Linearithmic-time

A

O(n log n)

Examples: Divide-and-Conquer Algorithms (i.e. Merge Sort, Quicksort)

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

P

A

It’s a complexity class where problems are solvable in polynomial time or better.

These are computationally easy problems.

Examples include single-source shortest-path proglem, which can be solved in polynomial time using Dijkstra’s Algorithm

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

NP

A

It’s a complexity class where all problems can be verified in polynomial time. It’s inclusive of P, but not all NP problems can be solved in polynomial time.

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

NP-Complete

A

It’s a complexity class where all problems can be verified in polynomial time. However, no problems in NP-Complete can be solved in polynomial time. It’s the intersection of NP and NP-Hard.

All NP-Complete problems can be simplified into the MAX-SAT problem. If the MAX-SAT problem or any other NP-Complete problem is solved, all NP-Complete problems are solved.

Note that solving all NP-Complete problems doesn’t mean that all NP problems are solved.

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

NP-Hard

A

This is a complexity class where problems are at least as difficult as the hardest problems in NP. NP-Hard problems don’t have to be in NP. Some of these problems might not even be decidable.

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

Generic Shortest-distance Path

A

This is a problem where the shortest path from the origin to the destination must be computed. Depending on the constraints, the generic shortest path problem can be P (positive weights, Dijkstra’s Algorithm works in polynomial time), NP, NP-Complete (finding the shortest path while keeping another metric below a specific threshold), and NP-Hard (the graph have negative weights and negative cycles).

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

Tree Graphs

A

These have n vertices, with n-1 edges. There’s exactly one path between any pair of vertices. Breaking any edge disconnects the graph. There are no cycles.

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

Complete Graphs

A

All vertices are connect to all other vertices.

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

Spanning Trees

A

These are subgraphs of a main graph that contain all the edges and is also a tree graph.

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

Depth First Search (DFS)

A

Start from the source node and go as far as you can until all nodes are marked. Only include edges that lead to yet unmarked nodes for the next step.

If searching for a specific node, terminate the search upon reaching the destination.

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

Breadth First Search (BFS)

A

Start from the source node and systematically spread out by marking all the neighbours of the current node, then the next set of neighbours, until all nodes are marked.

If searching for a specific node, terminate the search upon reaching the destination.

17
Q

Prim’s Algorithm

A

This method finds a minimum cost spanning tree (MST) in a graph by starting at the source node and taking on the node of minimum cost at each iteration, assuming this node isn’t part of the tree yet.

18
Q

Krustal’s Algorithm

A

This method finds a MST in a graph by ranking the edges in ascending order and linking up edges with the least cost, assuming that they aren’t part of the same tree yet.