Graphs Flashcards

1
Q

What is a decision graph?

A

A model which shows a series of points and their connectivity

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

Define arc and node

A

Node: the points which the graph connects, aka vertices
Arc: the connectors between nodes, aka edges

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

Define a simple graph

A

A graph with no loops and only one arc connecting each node to another

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

Define a connected graph

A

A graph where every node is connected to every other node, either directly or indirectly

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

Define a complete graph

A

A graph where each node is connected directly to each other node once

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

What is a trail?

A

A sequence of arcs such that one arc begins where the last ended

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

What is a path?

A

A trail within which each node is used only once

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

What is a closed trail?

A

A trail where the start and end nodes are the same

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

What is a cycle?

A

A closed trail where the only repeated node is the first/ last

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

What does the order of a node mean?

A

The number of arcs leaving the node

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

What condition must be met for a closed trail to exist?

A

The order of every node is even or there are only two odd nodes

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

What is the difference between Eulerian and Semi Eulerian graphs?

A

Eulerian has only even noes, while Semi Eulerian has two odd nodes

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

What is meant if a graph is traversable?

A

Each arc is used only once, nodes may be repeated

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

What are the steps of the route inspection algorithm?

A
  1. Find all odd order nodes
  2. for each pair of odd nodes, find the shortest connecting route between them
  3. Pair the nodes such that the weight of these connecting routes is minimised
  4. On the graph, duplicate these chosen paths
  5. Find a trail on the new Eulerian graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define a Eulerian graph

A

A connected graph where all the nodes have even orders

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

Define a Semi-Eulerian graph

A

A connected graph where only 2 nodes have an odd order

17
Q

When is the route inspection algorithm used?

A

To find the route of least weight which uses each arc at least once

18
Q

What is a tree in graph terms?

A

A version of a graph which contains no cycles, i.e. there is only one route connecting any one node to any other node

19
Q

What is a spanning tree?

A

A tree where all the nodes of the original graph are used

20
Q

What transforms a graph into a network?

A

Adding weights to the arcs

21
Q

What does the weight of an arc mean?

A

It represents a value such as distance or the number of houses on a street etc. It is used when finding a route which either minimises or maximises the total value

22
Q

What do Prim’s and Kruskal’s algorithms do?

A

Find the minimum spanning tree of a network

23
Q

How do you perform Kruskal’s algorithm for a network with n nodes?

A
  1. Choose the arc of least weight
  2. Choose, from the remaining arcs, the one of least weight which does not create a cycle
  3. Repeat until (n-1) arcs have been chosen
24
Q

How do you perform Prim’s algorithm?

A
  1. Choose a starting node (Usually given in the question)
  2. Choose the arc of least weight connecting to any nodes you have chosen which does not create a cycle and choose the node this links to the tree
  3. Repeat until all nodes have been connected
25
Q

What is Dijkstra’s algorithm used for?

A

Finding the route of minimum weight between two given nodes

26
Q

How do you perform Dijkstra’s algorithm?

A
  1. Label the starting node 1. From here, give all nodes directly connected to it a temporary label of the weight of the connecting arc.
  2. Choose the arc with the smallest temporary label, and make this label permanent. Number each node with the order you have chosen them in.
  3. Inspect all node that can now be reached. If there is a new shortest route to that node, replace the temporary label. If not, leave as is.
  4. Repeat 2 and 3 until you reach the end node
  5. Trace the route back from the end node to find the order of the nodes which were used
27
Q

What must you remember about Dijkstra’s algorithm?

A

When choosing the next node, choose the smallest temporary label on the whole graph, not just nodes connected to the last one to become permanent

28
Q

How do you perform the Lower Bound Algorithm?

A

Step 1: Choose any node, X, and find total of the two smallest weights converging at X
Step 2: Remove X and all connected arcs. Find the new minimum connection (Kruscal’s)
Step 3: The sum of these two totals is the lower bound

29
Q

How do you solve the Nearest Neighbour problem?

A

Find a minimum connector to be the upper bound. Perform the lower bound algorithm to find the lower bound. Adjust the starting nodes to find the smallest upper bound and the largest lower bound. The resulting range must contain the answer

30
Q

When is the nearest neighbour problem encountered?

A

When trying to find the route of minimum weight which visits all nodes and returns to the starting node.