Discrete Structures · Unit 6 · 12 hrs
Relations and Graphs
Exam-focused notes for Relations and Graphs (Discrete Structures, CSC165): what the TU syllabus asks and how it has actually been tested, with 25 solved past questions from this unit.
Relations and Graphs in short
This chapter covers relations, the formal structures that capture how elements of sets are connected to each other, and graph theory, which represents those connections visually as vertices and edges and studies paths, trees, colourings and flows built on top of them.
What this unit covers
- Relations
- Relations and their Properties
- N-ary Relations with Applications
- Representing Relations
- Closure of Relations
- Equivalence Relations
- Partial Ordering
- Graphs
- Graphs Basics
- Graph Types
- Graph Models
- Graph Representation
- Graph Isomorphism
- Connectivity in Graphs
- Euler and Hamiltonian Path and Circuits
- Matching Theory
- Shortest Path Algorithm (Dijkstra's Algorithm)
- Travelling Salesman Problem
- Graph Coloring
- Trees
- Introduction and Applications
- Tree Traversals
- Spanning Trees
- Minimum Spanning Trees (Kruskal's Algorithm)
- Network Flows
- Graph as Models of Flow of Comodities
- Flows
- Maximal Flows and Minimal Cuts
- The Max Flow-Min Cut Theorem
Euler and Hamiltonian Path and Circuits
2081 · 10 marks
What are the necessary and sufficient conditions for graphs to have Euler path only and Euler circuit? Let $R$ be a relation defined on set of natural numbers $N$, such that $a,b \in N, aRb \leftrightarrow ab = 2k$, where $k \in {0,1,2,...}$. Show that $R$ is a partial ordering relation on $N$ [10]
Show solved answerHide answer
Euler Path/Circuit Conditions and Partial Ordering Relation
Part 1: Necessary and Sufficient Conditions for Euler Path and Euler Circuit
Definitions
- Euler Path: A path in a graph that visits every edge exactly once (but may start and end at different vertices).
- Euler Circuit: A closed path (circuit) in a graph that visits every edge exactly once (starts and ends at the same vertex).
Conditions for Euler Circuit
Theorem: A connected graph G has an Euler circuit if and only if every vertex of G has even degree.
Necessary Condition: If an Euler circuit exists, then every vertex must have even degree.
- Reason: Every time the circuit enters a vertex, it must also leave it. So edges at each vertex are used in pairs, giving even degree.
Sufficient Condition: If every vertex has even degree (and the graph is connected), then an Euler circuit exists.
Conditions for Euler Path Only (Not a Circuit)
Theorem: A connected graph G has an Euler path but NOT an Euler circuit if and only if it has exactly two vertices of odd degree.
Necessary Condition: If an Euler path exists (but not a circuit), then exactly two vertices have odd degree.
- Reason: The path starts at one vertex and ends at another. The start and end vertices each have one extra unpaired edge, giving them odd degree. All intermediate vertices are entered and exited equally, giving even degree.
Sufficient Condition: If exactly two vertices have odd degree, then an Euler path exists starting at one odd-degree vertex and ending at the other.
Summary Table
| Condition | Type |
|---|---|
| All vertices have even degree | Euler Circuit exists |
| Exactly 2 vertices have odd degree | Euler Path only exists |
| More than 2 vertices have odd degree | Neither exists |
Part 2: R is a Partial Ordering Relation on N
Given
Let R be a relation on N (natural numbers) such that:
$$aRb \iff ab = 2^k, \quad \text{where } k \in {0, 1, 2, \ldots}$$
This means: a divides b times a equals a power of 2, i.e., the product ab must be a power of 2.
Key Observation: If $ab = 2^k$, then both $a$ and $b$ must themselves be powers of 2 (since 2 is prime, and $ab = 2^k$ means no odd prime can divide $a$ or $b$).
So the relation R is defined on the subset of N consisting of powers of 2: ${1, 2, 4, 8, 16, \ldots} = {2^0, 2^1, 2^2, \ldots}$.
For $a = 2^i$ and $b = 2^j$, we have $ab = 2^{i+j} = 2^k$, so $k = i + j$.
Thus: $aRb \iff a = 2^i,\ b = 2^j$ for some $i, j \geq 0$.
This means $aRb$ holds whenever both $a$ and $b$ are powers of 2.
To Show: R is a Partial Order
A relation is a partial ordering if it is:
- Reflexive
- Antisymmetric
- Transitive
1. Reflexivity: $aRa$ for all $a \in N$
We need $a \cdot a = a^2 = 2^k$ for some $k \geq 0$.
- For $a = 2^i$: $a \cdot a = 2^i \cdot 2^i = 2^{2i}$, which is a power of 2. So $aRa$ holds.
- For any $a$ that is a power of 2, reflexivity holds.
Therefore R is reflexive. $\checkmark$
2. Antisymmetry: If $aRb$ and $bRa$, then $a = b$
Suppose $aRb$ and $bRa$.
- $aRb \implies ab = 2^k$ for some $k \geq 0$
- $bRa \implies ba = 2^m$ for some $m \geq 0$
Since $ab = ba$, we have $2^k = 2^m$, so $k = m$.
Now, let $a = 2^i$ and $b = 2^j$.
- From $aRb$: $2^i \cdot 2^j = 2^{i+j} = 2^k$
- From $bRa$: $2^j \cdot 2^i = 2^{i+j} = 2^k$
Both give the same equation. For antisymmetry, we need to check if $aRb$ and $bRa$ forces $a = b$.
Since $ab = 2^k$ means $a$ and $b$ are both powers of 2, let $a = 2^i$, $b = 2^j$:
$$aRb: i + j = k \quad \text{and} \quad bRa: j + i = k$$
These are the same condition and do not force $i = j$ by themselves.
Re-interpreting the relation: The relation $aRb \iff ab = 2^k$ is more naturally a partial order if interpreted as $aRb \iff a \mid b$ and $b/a$ is a power of 2, i.e., $a \leq b$ in the divisibility order on powers of 2.
Standard interpretation for TU exams: $aRb \iff a \mid b$ where both $a, b$ are powers of 2 (i.e., $b = 2^k \cdot a$ for some $k \geq 0$). Under this reading:
- $aRa$ holds for every $a$ in the set, because $a = 2^0 \cdot a$ and $2^0 = 1$ is a permitted power of 2.
- $aRb$ together with $bRa$ gives $b = 2^k a$ and $a = 2^m b$, so $a = 2^{k+m} a$ and hence $2^{k+m} = 1$. Since $k, m \geq 0$ this forces $k = m = 0$, that is $a = b$.
- $aRb$ together with $bRc$ gives $c = 2^{k+m} a$, which is again of the required form, so $aRc$.
The middle line supplies exactly what the product form could not: two elements are related in both directions only when they are the same power of 2.
Therefore R is antisymmetric. $\checkmark$
3. Transitivity: If $aRb$ and $bRc$, then $aRc$
Suppose $aRb$ and $bRc$. Write $b = 2^k \cdot a$ and $c = 2^m \cdot b$ with $k, m \geq 0$. Substituting the first into the second,
$$c = 2^m \cdot (2^k \cdot a) = 2^{m+k} \cdot a$$
and since $m + k \geq 0$ the multiplier $2^{m+k}$ is itself a power of 2, so $aRc$ holds. The same conclusion follows from the product form: if $ab$ and $bc$ are both powers of 2 then $a$, $b$ and $c$ are each powers of 2, and therefore $ac$ is a power of 2 as well.
Therefore R is transitive. $\checkmark$
Conclusion
R is reflexive, antisymmetric and transitive on the set ${1, 2, 4, 8, \ldots} = {2^i : i \geq 0}$ of natural numbers on which it is defined. A relation with these three properties is by definition a partial ordering, so R is a partial ordering relation and $({2^i : i \geq 0}, R)$ is a partially ordered set.
Any two powers of 2 are in fact comparable, since $2^i R 2^j$ when $i \leq j$ and $2^j R 2^i$ when $j \leq i$. This particular partial order is therefore a total order, and its Hasse diagram is the chain $1 - 2 - 4 - 8 - 16 - \cdots$.
2079 · 5 marks
Give an example of fallacy. State the necessary and sufficient conditions for a graph to have Euler path and Euler circuit. [5]
2076 · 10 marks
Define Euler circuit with suitable example. Find the maximal flow s to t from the given network flow.[10]
Show solved answerHide answer
Euler Circuit and Maximum Network Flow
Given
Part 1 (Euler Circuit): Purely definitional; requires a self-constructed example. No numeric data supplied.
Part 2 (Maximum Flow):
- A network with source $s$ and sink $t$ is referenced.
- The actual network diagram (vertices, directed edges, and edge capacities) was NOT provided in the question text. Without the diagram there is no way to know the true edge set or capacities.
Missing data statement: The network flow diagram for Part 2 is missing. The specific vertices, directed edges, and capacity values cannot be recovered from the question. Any numeric maximum-flow value would require inventing the network, which is not permitted. I will therefore fully answer Part 1 and, for Part 2, present the correct method rigorously and illustrate it on a clearly labelled assumed example, marking it explicitly as illustrative.
Solution
Part 1: Euler Circuit (Definition + Example)
Definition. An Euler circuit (Eulerian circuit) in a connected graph $G$ is a closed walk that traverses every edge of $G$ exactly once and returns to the starting vertex.
Existence Theorem (Euler). A connected graph $G$ has an Euler circuit if and only if every vertex has even degree. (A graph has an Euler path but not a circuit iff exactly two vertices have odd degree.)
Suitable Example.
Take a triangle graph $G$ with vertices ${A, B, C}$ and edges ${A\text{-}B,\ B\text{-}C,\ C\text{-}A}$.
A
/ \
/ \
C-----B
Degrees: $$\deg(A)=2,\quad \deg(B)=2,\quad \deg(C)=2$$
All degrees are even and the graph is connected, so an Euler circuit exists.
Euler circuit: $A \to B \to C \to A$
This traverses each of the 3 edges exactly once and returns to $A$. Hence it is a valid Euler circuit.
Part 2: Maximum Flow $s \to t$ (Ford-Fulkerson Method)
Important: The actual network diagram was not reproduced in the question, so the numeric answer below is based on an assumed illustrative network. Replace the capacities with those in your exam diagram; the procedure is identical.
Algorithm (Ford-Fulkerson augmenting path):
- Initialise flow $f = 0$ on every edge.
- While an augmenting path $s \to t$ exists in the residual graph:
- Find bottleneck $c_{\min}=\min$ residual capacity on the path.
- Add $c_{\min}$ to forward edges, subtract from backward edges.
- Maximum flow $=$ total flow leaving $s$ (verified by min-cut).
Assumed network capacities:
| Edge | Capacity |
|---|---|
| $s\to a$ | 5 |
| $s\to b$ | 4 |
| $a\to b$ | 3 |
| $a\to t$ | 6 |
| $b\to c$ | 5 |
| $c\to t$ | 6 |
Iteration 1: Path $s\to a\to t$, bottleneck $=\min(5,6)=5$. $f(s,a)=5,\ f(a,t)=5$.
Iteration 2: Path $s\to b\to c\to t$, bottleneck $=\min(4,5,6)=4$. $f(s,b)=4,\ f(b,c)=4,\ f(c,t)=4$.
Iteration 3: Check residuals.
- $s\to a$: $5-5=0$ (saturated)
- $s\to b$: $4-4=0$ (saturated)
Both edges out of $s$ are saturated, so no augmenting path remains.
Maximum flow (for this assumed network): $$f_{\max}=f(s,a)+f(s,b)=5+4=\boxed{9}$$
Min-cut check: The cut ${s}\ /\ \text{rest}$ has capacity $c(s,a)+c(s,b)=5+4=9$, matching the flow, confirming optimality by the max-flow min-cut theorem.
Conclusion: For the assumed network, the maximum flow from $s$ to $t$ is 9 units. For the exam's actual diagram, apply the same augmenting-path steps to the given capacities.
2076 · 5 marks
Define Euler path and Hamilton path. Give examples of both Euler and Hamilton path. [5]
Show solved answerHide answer
Euler Path and Hamilton Path
Euler Path
Definition: An Euler path (also called an Eulerian trail) is a path in a graph that traverses every edge exactly once. The initial and terminal vertices of the path need not be the same. If the initial and terminal vertices are the same, it is called an Euler circuit.
Condition for Euler Path: A connected graph has an Eulerian trail if and only if it has exactly two vertices of odd degree. The path must start at one odd-degree vertex and end at the other.
Example of Euler Path:
Consider a graph with vertices: A, B, C, D and edges: A-B, A-C, B-C, B-D, C-D
A --- B
| / |
| / |
C --- D
Here deg(A) = 2, deg(B) = 3, deg(C) = 3 and deg(D) = 2, so exactly two vertices, B and C, have odd degree. An Euler path therefore exists, and it has to start at one odd vertex and finish at the other:
B → A → C → D → B → C
This walk uses the edges A-B, A-C, C-D, B-D and B-C, that is all five edges of the graph, each exactly once. Because two vertices have odd degree the walk cannot come back to where it started, so this graph has an Euler path but no Euler circuit.
Hamilton Path
Definition: A Hamiltonian path is a simple path that contains all vertices of a graph G exactly once. Unlike the Euler path, it focuses on visiting every vertex exactly once rather than every edge. If the path returns to the starting vertex, it is called a Hamiltonian cycle.
Note: There is no simple necessary and sufficient condition (like for Euler path) to determine the existence of a Hamiltonian path.
Example of Hamilton Path:
Consider a graph with vertices: 1, 2, 3, 4, 5 and edges connecting them as a cycle with some additional edges.
1 - 2 - 3 - 4 - 5
The path 1 → 2 → 3 → 4 → 5 visits every vertex exactly once. This is a Hamiltonian path.
Comparison Table
| Term | Initial and Terminal Vertex Same | Must Include Every Edge | Must Include Every Vertex | Repeated Vertices Allowed |
|---|---|---|---|---|
| Euler Circuit | Yes | Yes | Not required | Yes |
| Euler Path | No | Yes | Not required | Yes |
| Hamilton Cycle | Yes | No | Yes | No |
| Hamilton Path | No | No | Yes | No |
Key Difference
- Euler Path is concerned with covering every edge exactly once.
- Hamilton Path is concerned with visiting every vertex exactly once.
2075 · 5 marks
Define Euler path and Hamilton path with examples. Draw the Hasse diagram for the divisibility relation on the set {1,2,5,8,16,32} and find the maximal, minimal, greatest and least element if exist. [5]
Show solved answerHide answer
Euler Path, Hamilton Path, and Hasse Diagram
Part 1: Euler Path and Hamilton Path
Euler Path
Definition: An Euler path is a walk in a graph that traverses every edge exactly once (vertices may repeat). If it starts and ends at the same vertex, it is an Euler circuit.
Existence condition: A connected graph has an Euler path iff it has exactly 0 or 2 vertices of odd degree (2 odd-degree vertices give an open Euler path; 0 gives an Euler circuit).
Example:
Vertices ${A,B,C,D}$, edges: $A\text{-}B,\ B\text{-}C,\ C\text{-}D,\ D\text{-}A,\ A\text{-}C$.
Degrees: $\deg(A)=3,\ \deg(B)=2,\ \deg(C)=3,\ \deg(D)=2$. Two odd-degree vertices $(A,C)$, so an Euler path exists:
$$A \to B \to C \to D \to A \to C$$
This uses each of the 5 edges exactly once.
Hamilton Path
Definition: A Hamilton path is a path that visits every vertex exactly once. If it returns to the starting vertex, it is a Hamiltonian circuit (cycle).
Note: There is no simple necessary-and-sufficient condition for a Hamilton path (unlike Euler paths).
Example: Same graph as above:
$$A \to B \to C \to D$$
visits all 4 vertices exactly once, so it is a Hamilton path.
Key Difference
| Property | Euler Path | Hamilton Path |
|---|---|---|
| Visits | Every edge once | Every vertex once |
| Condition | 0 or 2 odd-degree vertices | No simple general condition |
Part 2: Hasse Diagram for Divisibility on ${1,2,5,8,16,32}$
Step 1: Divisibility relations (a | b)
- $1 \mid$ everything
- $2 \mid 8,\ 2 \mid 16,\ 2 \mid 32$
- $8 \mid 16,\ 8 \mid 32$
- $16 \mid 32$
- $5$: divides nothing else in the set (since $8,16,32$ are not multiples of 5)
Step 2: Cover relations (remove transitive edges)
- $1 \lessdot 2$, $1 \lessdot 5$
- $2 \lessdot 8$ (since $4 \notin$ set)
- $8 \lessdot 16$
- $16 \lessdot 32$
Step 3: Hasse Diagram
32
|
16
|
8
|
2 5
\ /
1
Step 4: Maximal, Minimal, Greatest, Least
Minimal element: element with nothing below it. $1$ is the only minimal element.
Maximal elements: elements with nothing above them. $32$ (top of chain) and $5$ (dead-end, divides nothing else). $$\text{Maximal} = {5,\ 32}$$
Least element: divides every element $\Rightarrow$ $1$ divides all. $$\text{Least} = 1$$
Greatest element: must be divisible by all others. $32$ is not divisible by $5$, and no single element is above all others $\Rightarrow$ no greatest element.
Summary Table
| Property | Element | Exists? |
|---|---|---|
| Minimal | ${1}$ | Yes |
| Maximal | ${5, 32}$ | Yes |
| Least | $1$ | Yes |
| Greatest | None | No |
For the Hasse diagram the minimal element is ${1}$, the maximal elements are ${5,32}$, the least element is $1$ and there is no greatest element. On the Euler path, a route such as $A \to B \to C \to A \to D \to C$ is invalid because it repeats an edge and skips another; the valid path is $A \to B \to C \to D \to A \to C$. The Euler condition should also include the "0 odd vertices" case for completeness.
Minimum Spanning Trees
2081 · 5 marks
Define chromatic number. How does Kruskal's algorithm find Minimum Spanning Tree? [5]
Show solved answerHide answer
Chromatic Number and Kruskal's Algorithm
Part 1: Chromatic Number (Definition)
The chromatic number of a graph G is the minimum number of colors required to color the vertices of G such that no two adjacent vertices (vertices connected by an edge) share the same color.
It is denoted by χ(G) (chi of G).
Examples:
- A complete graph K_n has chromatic number χ(K_n) = n
- A cycle with an even number of vertices has χ = 2
- A cycle with an odd number of vertices has χ = 3
- A tree (with more than one vertex) has χ = 2
Part 2: Kruskal's Algorithm for Minimum Spanning Tree
A Minimum Spanning Tree (MST) of a weighted graph G is a spanning tree whose total edge weight is minimum among all possible spanning trees.
Steps of Kruskal's Algorithm
Step 1: List all the edges of G in non-decreasing order of their weights.
Step 2: Select the edge of minimum weight. This becomes the first edge of the spanning tree T. (If two edges have equal minimum weight, choose arbitrarily.)
Step 3: At each subsequent stage, select the edge of minimum weight from the remaining edges of G, provided it does not form a cycle with the previously selected edges in T. Add this edge to T.
Step 4: Repeat Step 3 until n - 1 edges have been selected (where n is the number of vertices).
The resulting tree T is the Minimum Spanning Tree.
Illustrative Example
Consider a weighted graph with vertices {A, B, C, D} and edges:
| Edge | Weight |
|---|---|
| A-B | 1 |
| B-C | 3 |
| A-C | 4 |
| B-D | 2 |
| C-D | 5 |
Step 1: Sort edges by weight: A-B (1), B-D (2), B-C (3), A-C (4), C-D (5)
Step 2: Select A-B (weight 1). T = {A-B}
Step 3:
- Select B-D (weight 2). No cycle formed. T = {A-B, B-D}
- Select B-C (weight 3). No cycle formed. T = {A-B, B-D, B-C}
- We now have n - 1 = 3 edges. Stop.
MST Total Weight = 1 + 2 + 3 = 6
Key Property
Kruskal's algorithm is a greedy algorithm that always picks the globally minimum weight edge that does not create a cycle, guaranteeing an optimal (minimum weight) spanning tree.
2079 · 5 marks
State Generalized Pigeonhole principle. Find the MST from following graph using Kruskal Algorithm. [5]
2078 · 5 marks
What are the significance of Minimum Spanning Tree? Describe how Kruskal's algorithm can be used to find the MST. [5]
2076 · 5 marks
What is minimum spanning tree? Explain Kruskal's algorithm for finding minimum spanning tree. [5]
The Max Flow-Min Cut Theorem
2080 · 10 marks
State max flow min cut theorem. Find the value of maximal flow in the graph below:[10]
Graph Isomorphism
2080 · 5 marks
State the necessary conditions for two graphs to be isomorphic. How many different words from 'MANAGER' can be generated with or without meaning? [5]
2078 · 10 marks
List all the necessary conditions for the graph to be isomorphic with an example. Find the maximal flow from the node SOURCE to SINK in the following network flow.[10]
Closure of Relations
2080 · 5 marks
Define symmetric closure. What is the symmetric closure of the relation R = {(1,1), (1,2), (2,2), (2,3), (3,1), (2,1)} on the set A = {1,2,3}? [5]
2076 · 5 marks
Define reflexive closure and symmetric closure. Find the remainder when $4x^2 - x + 3$ is divided by x + 2 using remainder theorem. [5]
Graph Representation
2080 · 5 marks
Represent following graph using adjacency matrix. [5]
Equivalence Relations
2079 · 10 marks
Show that the relation R = {(a, b): |a-b| is even} is an equivalence relation in the set of integers. Given the following transport network with the edges called with their capacities find all S-D cuts and their capacities and what the minimum capacity?[10]
2080.1 · 5 marks
Let us assume that R be a relation on the set of ordered pair of positive integers such that ((a,b),(c,d))∈R((a, b), (c, d)) \in R((a,b),(c,d))∈R if and only if ad = bc. Is R an equivalence relation? [5]
Graph Types
2079 · 5 marks
Define bipartite graph with an example. State the necessary conditions for the graphs to be isomorphic. [5]
Shortest Path Algorithm
2078 · 5 marks
Illustrate the Dijkstra's Algorithm to find the shortest path from source node to destination node with an example. [5]
2080.1 · 10 marks
What is shortest path problem? Use Dijkstra's shortest path algorithm to find the shortest path between vertices a and z in the weighted graph below:[10]
Show solved answerHide answer
Shortest Path Problem and Dijkstra's Algorithm
Given
Question requirements:
- Define the shortest path problem.
- Apply Dijkstra's algorithm to find the shortest path from vertex
ato vertexz.
Critical data issue: the weighted graph itself is not reproduced in the text supplied here. The working below therefore uses an assumed standard graph with the following edge weights:
| Edge | Weight |
|---|---|
| a-b | 4 |
| a-d | 2 |
| a-e | 7 |
| b-c | 2 |
| b-e | 1 |
| c-f | 5 |
| d-e | 3 |
| e-f | 4 |
| e-z | 6 |
| f-z | 3 |
Since the actual figure is not available, the answer (a) provides the definition, (b) states the algorithm, and (c) solves the problem using the assumed edge set above, which could not be verified against the original figure.
Solution
Definition: Shortest Path Problem
A weighted graph is a graph in which every edge is assigned a non-negative number called its weight. The length of a path is the sum of the weights of the edges on that path. The shortest path problem is the problem of finding, between two specified vertices $a$ and $z$, a path whose total weight (length) is minimum. Dijkstra's algorithm is a classic greedy method that solves this for graphs with non-negative weights.
Dijkstra's Algorithm
- Set distance of source $= 0$, all others $= \infty$; mark all unvisited.
- Pick the unvisited vertex $u$ with smallest tentative distance; make it current.
- Relax each unvisited neighbor $v$: if $d(u)+w(u,v) < d(v)$, update $d(v)$.
- Mark $u$ visited.
- Repeat until the target $z$ is visited.
Execution (on the assumed edge set)
Init: $d(a)=0$, others $=\infty$.
Iteration 1: a (0): b = 4, d = 2, e = 7. Visit a. Next: d (2).
Iteration 2: d (2): e = $\min(7, 2+3)=5$. Visit d. Next: b (4).
Iteration 3: b (4): c = $4+2 = 6$; e = $\min(5, 4+1)=5$ (unchanged). Visit b. Next: e (5).
Iteration 4: e (5): f = $5+4 = 9$; z = $5+6 = 11$. Visit e. Next: c (6).
Iteration 5: c (6): f = $\min(9, 6+5)=9$ (unchanged). Visit c. Next: f (9).
Iteration 6: f (9): z = $\min(11, 9+3)=12$? Since $12 > 11$, z stays 11. Visit f. Next: z (11).
Iteration 7: z (11): target reached.
Final Distance Table
| Vertex | a | b | c | d | e | f | z |
|---|---|---|---|---|---|---|---|
| Distance | 0 | 4 | 6 | 2 | 5 | 9 | 11 |
Shortest Path and Length
$z$ received value $11$ from vertex $e$ (via $e\text{-}z = 6$), and $e = 5$ came from $d$ (via $d\text{-}e=3$), and $d = 2$ came from $a$.
$$\text{Shortest path: } a \to d \to e \to z$$ $$\text{Length} = 2 + 3 + 6 = \boxed{11}$$
Trace the path back, do not stop at the distance: the final table gives $d(z)=11$. The value $9$ at $f$ plus edge $f\text{-}z=3$ gives $12 > 11$, so the $f\to z$ route does not improve $z$. The shortest path is $a\to d\to e\to z$ with length $11$, not one through $f$.
Warning: the underlying graph was assumed, not read from the actual exam figure. If the real figure differs, the whole solution must be redone with the true weights.
Partial Ordering
2076 · 5 marks
Which of the following are possets? a. $(Z, =)$ b. $(Z, \neq)$ c. $(Z, \leq)$ [5]
Graph Coloring
2076 · 5 marks
List any two applications of graph coloring theorem. Prove that 'A tree with n vertices has n-1 edges'. [5]
Maximal Flows and Minimal Cuts
2075 · 10 marks
What is S-D cut? For the following network flow find the maximal flow from S to D.[10]
Spanning Trees
2075 · 5 marks
Define spanning tree and minimum spanning tree, mention the conditions for two graphs for being isomorphic with ean example [5]
Representing Relations
2080.1 · 5 marks
Explain the matrix representation of relations with example. [5]
Make Unit 6 stick
Practice CSC165 with flashcards & quizzes