Graphs Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Definition

A

Data structure used to represent complex relationships between items within datasets.

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

Can be used to represent

A

Networks, such as transport networks, IT networks and the Internet.

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

Graphs consist of

A

Nodes (aka vertices) joined by edges (aka arcs).

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

Weighted graph definition

A

Edges are assigned a value - such as representing time , distance or cost.

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

Unweighted graph definition

A

Edges have no values.

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

Two ways to represent a graph

A

Adjacency matrices

Adjacency lists

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

Adjacency matrices definition

A

Tabular representation of a graph. Each node in the graph is assigned a row and column.

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

Adjacency matrices table cheat sheet.

A
1 = an edge between those two nodes (TRUE)
0 = no edge between those two nodes (FALSE)

Should have a diagonal line of 0s to show where the row and column represent the same node.

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

Adjacency matrices table should have

A

Diagonal symmetry.

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

What do adjacency matrices use instead of Boolean values to represent a connection within weighted graphs?

A

The weight of a edge between two nodes

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

If there is no weighting between two nodes in an adjacency matrices, what is used?

A

An arbitrarily large value such as (∞) (infinity when written down).

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

Why is an arbitrarily large value used in adjacency matrices (Weighted)?

A

To prevent any shortest path algorithm from using any non existent edges.

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

Adjacency list definition.

A

Create a list of adjacent nodes for each node in the graph.

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

Adjacency lists only record

A

Only record existing connections in a graph, unlike adjacency matrix which stores even those edges that don’t exist.

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

Are adjacency matrices or lists more efficient?

A

Adjacency lists are more efficient as they only store edges that exist in the graph, whereas half of the matrix is repeated data due to non existent edges.

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

Are adjacency matrices or lists more time efficient?

A

Adjacency matrices as they can be queried quicker due to their rows and columns whereas lists must be searched sequentially until the desired edge is found.

17
Q

Are adjacency matrices more suited to dense or sparse graphs?

A

Dense, where there are a larger number of edges.

18
Q

Are adjacency lists better suited to dense or sparse graphs?

A

Sparse, where there are fewer edges.

19
Q

What is a node?```

A

A point in a network.

20
Q

What is a directed graph

A

All edges are directed (normally with arrows at the end of the edge).