YEAR 2 WEEK 9 GRAPHS Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are graphs?

A

Graphs are for modelling connections and relationships between data items

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

What are connected items or nodes called?

A

They are called vertex (plural:vertices)

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

What are the lines that connect vertices?

A

This is called edge.
-Each vertex has a degree which describes how many connections that vertex has.

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

What is a cycle?

A

A vertex connecting to itself to form a cycle / loop
- a path where the first and last nodes are the same

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

Why do we use graphs?

A

They are used to visualise a problem in this way they benefit humans by presenting info about a complex situation in a way that is simpler to under stand
They can be used for;
-Network connections-as used in a router whose paths change by the second
-Social connections-Define friends on social media platforms
etc
-GPS- to decide the most effective journey

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

What is an Undirected graph?

A

This is the most simplest kind of graphs where edges have no particular direction or flow associated with them
There is no format for how the nodes are set out.

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

What is a Labelled or weighted Graph?

A

In weighted graphs, movement from one vertex to another has a cost (labelled as a number) This type of graph is used along side programs written to maximise efficiency.

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

What are directed Graphs?

A

Movement between vertices is restricted and we have to follows the arrows which will be edge which show the flow of the Graph indicating where you can or cant go.

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

What is Breadth first Graph traversal?

A

-Designated one vertex as the root
-Visit each vertex connected to the root
-Once all directly connected vertices are visited,visit vertexes one step farther away

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

How do we do Breadth first Traversal (for Graphs) using queues?

A

-Place the first vertex into the queue,
-Mark it as explored (eg change its colour)
-Repeat
-Visit every vertex it is connected to.
-Add each vertex to the queue
Until all its vertices have been visited
-Repeat
-Pop front vertex from queue
-Mark the new front vertex as explored
-Repeat
-Visit every vertex the new front vertex is connected to
-Add each vertex to the queue
-Until every vertex has been visited
-Until queue is empty

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

What is Depth first Graph traversal?

POST ORDER

A

Picks one path and follows it to the end
Then backtracks and flows the next path to the end and then will continue until or vertices have been visited.

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

How do we do Depth first Traversal (for Graphs) using Stacks?

A

-Repeat
-PUSH the vertex onto the stack ,Mark the vertex as explored
-PUSH a child vertex onto the stack
-IF there is no child vertex
-POP vertex off the stack
-UNTIL the stack is empty

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