Graphs Flashcards

1
Q

What is a graph?

A

A data structure designed to represent the relationship between items

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

What is a node/vertex of a graph?

A

A representation of an item of data, often drawn as a circle.

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

What is an edge/arc of graph?

A

A line used to represent the relationship between two nodes

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

Describe a weighted graph

A

Each edge has a value/cost attributed to it

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

Describe a directed graph

A

A graph in which some edges can only be traversed in one direction

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

Describe a disconnected graph

A

A graph which two or more nodes are not connected to the graph

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

What are the uses of a graph data structure?

A

Route finding
Representing networks in human relationships
Computer networks
Project management
Game theory (mathematical modelling of strategic decisions)

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

What is an adjacency list?

A

A method of representing a graph by listing, for each node just the nodes that are directly connected to it directly

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

What is an adjacency matrix?

A

A method of representing a grid with values in each cell to show which nodes are connected to each other?

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

What are the advantages and disadvantages of an adjacency list?

A

+ Good for sparse graphs (few edges) or situations where edges don’t need to be tested often as it takes up less space
- Poor for dense graphs as it takes too long to process each value

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

What are the advantages and disadvantages of an adjacency matrix?

A

+ Good for dense graphs (many edges) or situations where edges need to be tested often as it’s easier to process each value
- Poor for sparse graphs as it wastes storage space

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