Graphs Flashcards

1
Q

What is a graph?

A

Abstract data type that is used to represent the non linear relationships between objects

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

Name what a graph consists of :

A

Nodes (vertices)
Edges(arcs)

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

What do you call it when two nodes are connected by an edge?

A

Neighbours

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

What is a degree of a node?

A

The number of other nodes that it is connected to

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

What is a loop?

A

An edge that connects a node to itself

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

What is a path?

A

Sequence of paths connected by edges

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

What is a cycle

A

Closed path. A path that starts and ends on the same node.

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

Give 2 examples of where graphs are used to represent a lot of different relationships.

A
  1. Social networking, where each node represents individual people. An edge could represent that two people are acquaintances.
  2. The internet: nodes could represent routers and the edge could represent that that the routers are connected.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the advantage of an undirected graph?

A

Allows you to move in either direction between nodes.

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

WHAT happens in directed graphs ?

A

Directed graphs have a direction , this m,earns you have to move in a specific direction. In these diagrams arrows are used instead of lines

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

In what direction are bidirectional arrows used ?

A

Double headed arrows.

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

What happens when a graph has values associated with edges ?

A

Weighted / labelled graph .

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

Why might you want to use weights to record information relating to the edges ?

A

For eg|: weights are used to give the distance and you can then be able to tell the shortest path between nodes.

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