Skip to content
mathlab
0
0
0 XP
Lvl 1
KJ
Lesson 6 ~40 min Introduction to Networks · Path +90 XP

Connected Graphs and Walks

Everything from here on is about moving through a network. That needs two ideas first: whether a journey between two vertices is possible at all, and what a journey actually is once it has been written down.

Today's hook: A rail network that comes in two disconnected pieces is not one network having a bad day. It is two networks, and no timetable will ever get a passenger from one to the other.
0/5QUESTS
Think First
warm-up

Look at the diagram above. Starting at $A$, list every vertex you could reach by moving along edges. Is $E$ among them? Could any amount of cleverness get you there?

Record your answer in your workbook.
1
The Big Idea
+5 XP to read

A graph is connected when it is in one piece, so that some route along edges joins every pair of vertices. A walk is such a route written down: an alternating sequence of vertices and edges, with each edge joining the vertices either side of it.

$$A \to B \to C \to B \to D$$

A walk may revisit anything it likes. It can return to a vertex it has already been to, and it can travel along the same edge twice. Restricting those repeats is what produces the more specialised journeys in the next lesson.

A B C D E F component 1 component 2 no walk from A reaches E
$\text{walk} = \text{vertex, edge, vertex, edge, } \ldots$
Check connectedness first
Euler's formula and everything in Lessons 8 to 10 assume it. Say so when it holds.
Length counts edges
The length of a walk is the number of edges used, which is one less than the number of vertices listed.
Consecutive vertices must be joined
A written sequence is only a walk if an edge genuinely exists between each neighbouring pair.
2
What You'll Master
objectives

Know

  • that a connected graph is one in which every pair of vertices is joined by some route along edges
  • that a disconnected graph splits into components, each of which is connected
  • that a walk is an alternating sequence of vertices and edges in which consecutive vertices are joined by the edge between them

Understand

  • why connectedness must be checked before results such as Euler's formula are applied
  • why a walk is permitted to repeat both vertices and edges
  • why the length of a walk is one less than the number of vertices written down

Can Do

  • decide whether a given graph is connected, and identify its components if not
  • write down a walk between two given vertices and state its length
  • check whether a proposed sequence of vertices is actually a walk in a given graph
3
Words You Need
vocabulary
ConnectedIn one piece. A graph is connected when every pair of vertices is joined by some route along edges.
ComponentOne of the separate connected pieces of a graph.
WalkA sequence of vertices and edges in which each edge joins the vertices immediately before and after it.
LengthThe number of edges used by a walk. Repeated edges are counted each time they are used.
Closed walkA walk that finishes at the vertex it started from.
4
Connected, or in Pieces
+5 XP to read

A graph is connected if, starting from any vertex, you can reach any other by moving along edges. It is in one piece.

A graph that is not connected splits into components. Each component is itself connected, and no edge joins one component to another. The graph in the diagram has two components: $\{A, B, C, D\}$ and $\{E, F\}$.

To test connectedness, pick any vertex and explore. Mark it, mark everything reachable from it in one step, then everything reachable from those, and continue until nothing new appears. If every vertex has been marked, the graph is connected. If not, the marked vertices form one component and the argument repeats on what is left.

Starting vertex does not matter. If the graph is connected, exploring from any vertex reaches everything, so any choice settles the question.

5
Why It Is Checked First
+5 XP to read

Connectedness is a precondition for most of what follows, and questions state it for that reason rather than as decoration.

Euler's formula gives $2$ only for connected graphs; a graph in $k$ pieces gives $k + 1$, as Lesson 5 showed.

An Eulerian trail, coming in Lesson 8, uses every edge of the graph. If the graph has two components, no single journey can reach the edges of both, so the question is settled before it is asked.

A disconnected graph is not a broken graph. It is a perfectly good object that certain results simply do not apply to, and noticing which is part of using them correctly.

In applications the check is often the whole question. "Can every suburb reach the hospital?" is a connectedness question about the bus network, and the answer is yes exactly when the relevant vertices lie in one component.

6
What a Walk Is
+5 XP to read

A walk is a route through the network, written as an alternating sequence of vertices and edges. Each edge in the sequence must join the vertex before it to the vertex after it.

In practice only the vertices are written, since the edges are then implied:

$A \to B \to C \to B \to D$

That is a legitimate walk provided the edges $AB$, $BC$, $CB$ and $BD$ all exist. Note that it visits $B$ twice and uses the edge between $B$ and $C$ twice, once in each direction.

A walk has no restrictions at all beyond following existing edges. Repeats of every kind are allowed, and the next lesson is entirely about what happens when they are forbidden.

Where a graph has multiple edges between the same pair of vertices, the vertex list becomes ambiguous and the edges must be named as well, since it matters which of the two was used.

7
Length, Open and Closed
+5 XP to read

The length of a walk is the number of edges it uses, counting a repeated edge each time it is used.

The walk $A \to B \to C \to B \to D$ lists five vertices and has length $4$. In general the length is one less than the number of vertices written, because each step from one vertex to the next uses one edge.

A walk is closed if it finishes where it started, and open otherwise. The walk $A \to B \to C \to A$ is closed; $A \to B \to C$ is open.

A single vertex on its own counts as a closed walk of length $0$, which sounds like a technicality and matters when a definition has to cover every case without exception.

Open and closed is the second of the two questions that the next lesson uses to classify journeys, the first being which repeats are allowed.

8
Checking a Proposed Walk
+5 XP to read

Given a graph and a sequence of vertices, deciding whether it is a walk is mechanical: take the vertices in consecutive pairs and check each pair is joined by an edge.

For the graph with edges $PQ$, $QR$, $RS$, $SP$, the sequence $P \to Q \to R \to S$ is a walk, since $PQ$, $QR$ and $RS$ all exist.

The sequence $P \to R \to S$ is not, because there is no edge $PR$. The two vertices are both in the graph and are connected by a longer route, but a walk must list every vertex it passes through, and this sequence skips $Q$ or $S$.

This is the commonest error: writing the destinations rather than the route. A walk records every step, not the interesting stops.

Watch Me Solve It · Connected or not
+15 XP per step
Q1
PROBLEM
A graph has vertices $A$ to $G$ with edges $AB$, $BC$, $AC$, $DE$, $EF$, $FD$, $FG$. Determine whether it is connected, and if not, list its components.
  1. 1
    Explore from A
    From $A$ the edges reach $B$ and $C$. From $B$ the only new neighbour would be $C$, already found. From $C$, nothing new. The exploration stops with $\{A, B, C\}$.
  2. 2
    Note that vertices remain
    $D$, $E$, $F$ and $G$ were never reached, so the graph is not connected.
  3. 3
    Explore from an unreached vertex
    From $D$ the edges reach $E$ and $F$; from $F$ they reach $G$. That gives $\{D, E, F, G\}$, and nothing remains.
  4. 4
    State the components
    Two components: $\{A, B, C\}$ and $\{D, E, F, G\}$. Each is connected within itself and no edge crosses between them.
AnswerNot connected; components $\{A, B, C\}$ and $\{D, E, F, G\}$
Watch Me Solve It · Writing a walk
+15 XP per step
Q2
PROBLEM
In the graph with edges $PQ$, $QR$, $RS$, $ST$, $QT$, write a walk from $P$ to $S$ of length $3$, and a different walk from $P$ to $S$ of length $5$.
  1. 1
    Find a short route
    $P \to Q \to R \to S$
    The edges $PQ$, $QR$ and $RS$ all exist, so this is a walk. It lists four vertices and uses three edges, so its length is $3$.
  2. 2
    Find a longer route
    $P \to Q \to T \to S \to R \to S$
    Uses $PQ$, $QT$, $TS$, $SR$, $RS$, all of which exist. Five edges, so length $5$.
  3. 3
    Note what makes the second one legal
    It visits $S$ twice and uses the edge between $R$ and $S$ twice. Both are permitted, because a walk has no restriction on repeats.
  4. 4
    Check the length rule
    The second walk lists six vertices and has length $5$, one less, as expected.
Answer$P \to Q \to R \to S$ has length $3$; $P \to Q \to T \to S \to R \to S$ has length $5$
Watch Me Solve It · Is this a walk?
+15 XP per step
Q3
PROBLEM
A graph has edges $AB$, $BC$, $CD$, $DA$, $AC$. Decide whether each of $A \to C \to D$, $A \to B \to D$ and $A \to B \to C \to A \to D$ is a walk.
  1. 1
    Check the first
    The pairs are $AC$ and $CD$. Both edges exist, so this is a walk of length $2$.
  2. 2
    Check the second
    The pairs are $AB$ and $BD$. The edge $AB$ exists but $BD$ does not, so this is not a walk. $B$ and $D$ are connected in the graph, but not directly, and a walk cannot skip the vertices in between.
  3. 3
    Check the third
    The pairs are $AB$, $BC$, $CA$ and $AD$. All four edges exist, so this is a walk of length $4$, despite visiting $A$ twice.
  4. 4
    Summarise the test
    Take consecutive pairs and check each is an edge. Nothing else is required, and repeats never disqualify a walk.
AnswerThe first and third are walks; the second is not, since there is no edge $BD$
D
Brain Trainer · Reach it, or write it down
5 problems

Five items on connectedness and walks. For each proposed walk, check consecutive pairs against the edge list.

  1. 1 A graph has edges $AB$, $BC$, $DE$. Is it connected?

    Explore from $A$: you reach $B$ and $C$ but never $D$ or $E$.No; two components
  2. 2 How many components does a graph with edges $PQ$, $QR$, $ST$, $UV$ have?

    $\{P, Q, R\}$, $\{S, T\}$ and $\{U, V\}$.$3$
  3. 3 A walk lists $7$ vertices. What is its length?

    Each step between consecutive vertices uses one edge.$6$
  4. 4 In a graph with edges $AB$, $BC$, $CD$, is $A \to B \to A \to B \to C$ a walk?

    Every consecutive pair must be an edge; repeats are allowed.Yes, of length $4$
  5. 5 In a graph with edges $AB$, $BC$, $CD$, is $A \to C$ a walk?

    Check whether $AC$ is an edge.No
Complete in your workbook.
MC1
What connected means
+10 XP

A graph is connected when:

MC2
Counting components
+10 XP

A graph has vertices $A$ to $F$ with edges $AB$, $BC$, $DE$. The number of components is:

MC3
The length of a walk
+10 XP

The walk $A \to B \to C \to B \to D \to E$ has length:

MC4
Is it a walk?
+10 XP

In a graph with edges $PQ$, $QR$, $RS$, $SP$, which sequence is NOT a walk?

MC5
Why connectedness is stated
+10 XP

A question says "a connected planar graph". The word connected is there because:

Q6
Components and consequences
+15 XP
Q6
SHORT ANSWER
A network has vertices $A$ to $H$ with edges $AB$, $BC$, $CA$, $CD$, $EF$, $FG$, $GE$. Determine whether it is connected, list the components, and explain what this means for whether Euler's formula in the form $v - e + f = 2$ can be applied.
Write your working in your book.
Q7
Write and justify walks
+15 XP
Q7
SHORT ANSWER
A graph has vertices $V$, $W$, $X$, $Y$, $Z$ with edges $VW$, $WX$, $XY$, $YZ$, $ZV$, $WY$. Write a closed walk of length $3$ starting at $W$, an open walk of length $5$ from $V$ to $X$, and explain why the sequence $V \to X$ is not a walk.
Write your working in your book.
Q8
Explain the exploration test
+15 XP
Q8
SHORT ANSWER
Describe a systematic method for deciding whether a graph is connected, explain why the choice of starting vertex does not affect the outcome, and state how the method also produces the components when the graph is disconnected.
Write your working in your book.
S
Stretch Challenge · How long can a shortest route be?
+25 XP
S
CHALLENGE
In a connected graph with $n$ vertices, consider the shortest walk between two vertices. Explain why such a shortest walk can never repeat a vertex, and use that to find the greatest possible length of a shortest walk in terms of $n$. Give a graph on $n$ vertices that achieves it.
R
Quick Review
recap

Connected means reachable, not adjacent

Every pair of vertices must be joined by some route, however long. A graph that is not connected splits into components, each connected within itself.

Check it before applying results

Euler's formula gives $2$ only when the graph is connected, and an Eulerian trail is impossible across two components.

A walk allows every repeat

It is an alternating sequence of vertices and edges with each edge joining its neighbours. Vertices and edges may be revisited freely.

Length counts edges

One less than the number of vertices listed, counting a repeated edge each time it is used. A closed walk finishes where it started.

Your Badges

0 of 6
First Steps
3-Day Streak
3 in a Row
Lesson Ace
Stretch Seeker
Daily Warrior

Mark lesson as complete

Tick when you've finished Learn, Practice and the Stretch. Earns +90 XP and +25 coins.