Graphs Flashcards

1
Q

Define a graph

A

Defined by G = (V,E)
V is a set of nodes (or vertices) in the graph
E is the set of edges where E is a subset of V x V

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

What is the degree of a node?

A

The number of edges incident on a node

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

What is a path?

A

A sequence of nodes and edges that link two nodes

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

Define the path length

A

Number of edges in a path

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

What is a sub graph?

A

Sub set of the original nodes and edges, all nodes touched by an edge are included in the sub graph

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

What does it mean for a graph to be connected?

A

A graph is connected if there is a path between every pair of nodes

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

What are the two types of connectedness in directed graphs?

A

Weakly connected

Strongly connected

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

What is a weakly connected directed graph?

A

When the graph is connected if we ignore the directions of edges

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

What is a strongly connected directed graph?

A

When the graph is connected and we respect the directions

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

What are the three choices of representation for graphs?

A

Finite state machines
Trees
Hash table

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

What are the operations we expect from graphs?

A

Add and remove nodes and edges
Get and set labels
Enumerate elements
Traverse an edge

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

What are the three ways we could represent the structure of a graph?

A

Edge list
Adjacency list
Adjacency matrix

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

How is the graph represented in an edge list?

A

Node list

Edge list

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

What information is stored on a node object in an edge list?

A

Label

Position in node list

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

What information is stored on an edge object in an edge list?

A

Label
Position in edge list
End points

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

How is a graph represented in an adjacency list?

A

Node list

17
Q

What information is stored on a node object in an adjacency list?

A

Label
Position in node list
List of adjacent edges

18
Q

What information is stored on an edge object in an adjacency list?

A

Label

End points

19
Q

Describe an adjacency matrix

A

A square matrix, n*n for a n node graph
Index nodes by a number
1 at (i,j) if there is an edge between i and j