D1 Flashcards

1
Q

How do you solve a problem containing Kruskals Algorithm?

A
  • List all arcs in size order
  • Fill in in order
  • Do not form loops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you solve a problem containing Prims Algorithm?

A
  • Select a node
  • Find smallest connecting
  • Keep going until all nodes have been joined
  • No loops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you solve a problem containing Dijkstras Algorithm?

A
  • Pick a node
  • Give nodes connecting a temporary label
  • Make smallest permanent
  • Repeat
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you solve a problem containing Chinese Postman Algorithm?

A
  • Find all odd nodes
  • Connect two smallest connections and connect if Eularian
  • If semi-eulerian is required leave two odd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When would you need to use the Chinese Postman algorithm?

A

When you need to go along every arc

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

How do you solve a problem containing Travelling Salesperson Algorithm?

A
  • Find upper bound by nearest neighbour
  • Find lower bound
  • Put in an inequality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you find the upper bound for travelling salesperson?

A

Use nearest neighbour:

  • Pick node
  • Find smallest connecter
  • Join all smallest until back to first node
  • Algorithm fails if cannot return to first
  • To find best do for all nodes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you find the lower bound for travelling salesperson?

A
  • Choose a node
  • Find MST
  • Add node back in by drawing back the two connecting arcs with the lowest weights
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 8 rules of graphs?

A
  • Total order of nodes is twice the number of arcs (so total order must be even)
  • There cannot be an odd number of odd nodes
  • For a connected graph, the order of each node must be at least 1
  • For a simple graph with n nodes, the order of each node must not be bigger than n-1
  • An Eulerian graph has all even nodes
  • A semi-Eulerian graph has exactly 2 odd nodes
  • Any tree with n nodes must have exactly n-1 arcs
  • Kn with n nodes will have a total of 1/2n(n-1) arcs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you solve a problem containing the first fit Algorithm?

A
  • Put into first available bin in order given
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you solve a problem containing the first fit decreasing Algorithm?

A
  • Sort into decreasing order

- Apply first fit

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

How do you solve a problem containing the shuttle sort Algorithm?

A
  • Compare first 2 numbers and swap is necessary
  • Underline first number
  • Compare first two numbers not underlined
  • Swap with underlined if necessary
  • Repeat 2-3
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you solve a problem containing the bubble sort Algorithm?

A
  • Compare first 2 numbers
  • Take top number to end swapping if necessary
  • Highest number now in place
  • Underline last number
  • Repeat 1-3
  • Do not compare underlined numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you solve order of algorithm questions if the algorithm is of quadratic order?

A
  • Write info given
  • Work out scaling factor
  • x unknown link by scaling factor squared
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you solve order of algorithm questions if the algorithm is of cubic order?

A
  • Write info given
  • Work out scaling factor
  • x unknown link by scaling factor cubed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you solve order of algorithm questions if the algorithm is of exponential order?

A
  • T directly proportional to exponential given
  • T = K x exponential given
  • Work out K
  • Put K into unknown equation
17
Q

When would you need travelling salesperson algorithm?

A

When you need to visit every town but not every arc

18
Q

Define graph

A

A set of vertices, or nodes which may or may not be connected by arcs or edges

19
Q

Define connected graph

A

One in which it is possible to get from any node to any other node either directly or indirectly

20
Q

Define simple graph

A

There is never more than one arc joining a pair of nodes and no loops joining a node to itself

21
Q

Define a simply connected graph

A

A graph that is both simple and connected

22
Q

Define a planar graph

A

One the can be drawn so that no arcs cross over (except for at nodes)

23
Q

Define a complete graph

A

A simply connected graph in which every pair is connected. It has 1/2n (n-1) arcs.

24
Q

What is the order of a node?

A

The number of arcs that are connected to the node

25
Q

What is the total order always equal to?

A

Twice the number or arcs

26
Q

What is a trail?

A

A sequence of arcs such that the end node of one arc is the start node of the next

27
Q

What is a path?

A

A trail with the restriction that no node is passed through more than once

28
Q

What is a closed trail?

A

A trail in which the start an finish nodes are the same

29
Q

What is a cycle?

A

A closed trail where only the start and end nodes are the same

30
Q

What is a tree?

A

A connected graph with no cycles. A tree connecting n nodes has n-1 arcs

31
Q

What is an Eulerian graph?

A

A graph which is connected and has a closed trail containing every arc once and only once

32
Q

What is a semi-eulerian graph?

A

A connected graph that has a trail that is not closed but contains every arc once and only once.

33
Q

What is a network?

A

A graph in which every arc is assigned a numerical value, its weight

34
Q

What is Kn?

A

A complete graph