ITPEC FE Morning October 2021 Question 4

Source exam: ITPEC FE Morning October 2021Topic: Basic Theory & Math

ITPEC FE Morning October 2021 — Question 4 of 80

Adjacency Matrix for Directed Graphs — map directed edges to a matrix where row = source, column = destination.

Read each edge from the graph and mark 1 in the matrix:

  • Directed edge from i to j → matrix[i][j] = 1
  • No edge0
  • Self-loop (edge from a node to itself) → diagonal entry = 1

Edges in this graph:
- A → B

- B → A

- B → C

Resulting matrix:

ABC
A010
B101
C000

Why not others:
- (a) — adds self-loops on A, B, C and a non-existent A→C edge

- (b) — incorrectly sets A→B = 0, adds C→A and C→B edges

- (c) — adds self-loops on A, B, C and swaps some connections

Key rule: In a directed graph adjacency matrix, matrix[i][j] = 1 means there is an edge from vertex i to vertex j. Curved arrows between two nodes are mutual edges, not self-loops.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.