Unit 4: Graphs Theory I - Subjective Questions
MTH401 — Discrete Mathematics • Practice Questions with Detailed Answers
20 questions
Define the following basic graph-theoretic terms with suitable examples: vertex, edge, order, size, adjacent vertices, incident edge, degree, isolated vertex, pendant vertex, loop, and parallel edges.
A graph is written as , where is the set of vertices and is the set of edges.
- Vertex: A fundamental point or node of a graph. For example, if , then , , and are vertices.
- Edge: A connection between two vertices. The edge joining and is denoted by or .
- Order: The number of vertices in the graph, namely .
- Size: The number of edges in the graph, namely .
- Adjacent vertices: Two vertices are adjacent if an edge joins them.
- Incident edge: An edge is incident with each of its endpoints.
- Degree: The degree is the number of edges incident with vertex . A loop contributes to the degree.
- Isolated vertex: A vertex of degree .
- Pendant vertex: A vertex of degree .
- Loop: An edge whose two endpoints are the same vertex.
- Parallel edges: Two or more distinct edges having the same pair of endpoints.
A graph without loops or parallel edges is called a simple graph.
State and prove the Handshaking Lemma. A graph has six vertices of degree and four vertices of degree . Determine the number of edges and the number of vertices of odd degree.
Handshaking Lemma: For every finite undirected graph ,
Proof:
- Every edge has two endpoints.
- While summing the degrees of all vertices, each edge is counted once at each endpoint.
- Therefore, every edge contributes exactly to the degree sum.
- Hence, .
For the given graph,
Therefore,
The four vertices of degree have odd degree. Thus:
- Number of edges:
- Number of odd-degree vertices:
The number of odd-degree vertices is even, which is also a consequence of the Handshaking Lemma.
Distinguish among a walk, trail, path, closed walk, circuit, and cycle in an undirected graph. Illustrate the distinctions using a suitable vertex sequence.
- A walk is a sequence in which each edge joins and . Vertices and edges may repeat.
- A trail is a walk in which no edge is repeated, although vertices may repeat.
- A path is a walk in which no vertex is repeated. Consequently, no edge is repeated.
- A closed walk is a walk whose first and last vertices are the same, so .
- A circuit is a closed trail; it has no repeated edge.
- A cycle is a closed path in which only the first and last vertices are equal and all other vertices are distinct.
For edges :
- is a walk but not a trail because is repeated.
- is a circuit and a cycle.
- is a path if all four vertices are distinct.
The length of a walk, trail, or path is the number of edges it contains.
Define and compare the complete graph , cycle graph , and an -regular graph. Derive the number of edges in and state when and are regular.
- A complete graph is a simple graph in which every pair of distinct vertices is joined by an edge.
- A cycle graph , for , consists of vertices arranged in one cycle.
- An -regular graph is a graph in which every vertex has degree .
In , every vertex is adjacent to the other vertices, so
Using the Handshaking Lemma,
and hence
Therefore, is an -regular graph.
In , every vertex has exactly two neighbors. Thus,
and is -regular for every .
Explain wheel graphs and cube graphs. Using the convention , determine the degree sequence and number of edges of . Also derive the number of vertices and edges of the -dimensional cube .
Wheel graph: Under the stated convention, is formed by taking a cycle and adding one new central vertex adjacent to every cycle vertex.
- The central vertex has degree .
- Each cycle vertex has degree : two cycle neighbors and the central vertex.
- The degree sequence is therefore
The cycle contributes edges and the spokes contribute another edges. Hence,
Cube graph: The -dimensional cube has all binary strings of length as its vertices. Two vertices are adjacent when their strings differ in exactly one position.
- Number of vertices: .
- Each vertex has degree .
- By the Handshaking Lemma,
so
Thus, is a -regular bipartite graph.
What is a bipartite graph? Prove that an undirected graph is bipartite if and only if it contains no cycle of odd length.
A graph is bipartite if its vertex set can be partitioned into two disjoint sets and such that every edge has one endpoint in and the other in .
Forward direction: Suppose is bipartite.
- While traversing any cycle, the vertices must alternate between and .
- To return to the starting vertex, an even number of edges must be traversed.
- Therefore, every cycle has even length, so no odd cycle exists.
Reverse direction: Suppose has no odd cycle.
- In each connected component, choose a vertex .
- Put vertices at even distance from in and vertices at odd distance from in .
- If an edge joined two vertices in the same set, their paths from , together with that edge, would create an odd cycle.
- This contradicts the assumption.
Thus, every edge joins a vertex of to a vertex of , and is bipartite.
Hence,
Define the complete bipartite graph . Determine its order, size, degree sequence, and regularity condition. Apply the results to .
A complete bipartite graph is a bipartite graph with partite sets and , where , , and every vertex of is adjacent to every vertex of .
For :
- Order:
- Size: Each of the vertices in is joined to all vertices in , so
- Every vertex in has degree .
- Every vertex in has degree .
- The graph is regular exactly when . In that case, is -regular.
For :
- Order: .
- Size: .
- Three vertices have degree .
- Four vertices have degree .
- It is not regular because .
Describe the adjacency-list, edge-list, and adjacency-matrix representations of a graph. Compare their storage requirements and suitability for graph algorithms.
Adjacency list:
- For each vertex, it stores a list of its neighboring vertices.
- Its space requirement is .
- It is efficient for sparse graphs and for traversals such as BFS and DFS.
Edge list:
- It stores each edge as a pair , or as a triple for a weighted graph.
- Its space requirement is .
- It is simple and useful for algorithms that process all edges, but testing whether two particular vertices are adjacent may be slow.
Adjacency matrix:
- It is a matrix where if and are adjacent, and otherwise.
- Its space requirement is .
- Adjacency testing takes time.
- It is suitable for dense graphs and matrix-based computations.
Thus, adjacency lists are usually preferable for sparse graphs, while adjacency matrices are convenient for dense graphs and fast adjacency queries.
Construct the adjacency matrix of the undirected graph with and . Use the matrix to determine the degree of every vertex and verify the number of edges.
Using the vertex order , the adjacency matrix is
For a simple undirected graph, the degree of a vertex is the sum of the entries in its row:
- .
- .
- .
- .
The total degree is
By the Handshaking Lemma,
which agrees with the given edge set. The matrix is symmetric because the graph is undirected.
Explain the significance of powers of an adjacency matrix. If is the adjacency matrix of a graph, what does the entry represent? Demonstrate the result for .
Let be the adjacency matrix of a graph. The entry
is the number of walks of length from vertex to vertex .
For ,
The product equals exactly when both edges and exist. Thus, each nonzero term corresponds to a walk
of length . The sum counts all such intermediate vertices .
For a simple undirected graph, the diagonal entry equals because every neighbor produces the length-two walk .
This matrix property is useful for counting walks and studying reachability. It counts walks, not necessarily paths, because vertices and edges may repeat.
Define the incidence matrix of an undirected graph. Construct it for and . State two important properties of this matrix.
For an undirected graph, the incidence matrix has one row for each vertex and one column for each edge. For a graph without loops,
Using rows and columns ,
Properties:
- Every column contains exactly two s because every non-loop edge has two endpoints.
- The sum of the entries in a row equals the degree of the corresponding vertex.
Thus, the row sums are , and their total is . For an oriented incidence matrix, one endpoint is represented by and the other by .
Define graph isomorphism and explain how graph invariants are used to test whether two graphs may be isomorphic. Why is equality of degree sequences not sufficient?
Two graphs and are isomorphic if there exists a bijection
such that
The function must preserve both adjacency and non-adjacency.
Properties preserved by isomorphism are called graph invariants. Important invariants include:
- Number of vertices and edges.
- Degree sequence.
- Number of connected components.
- Connectedness.
- Number and lengths of cycles.
- Number of pendant or isolated vertices.
- Presence of cut vertices and bridges.
- Bipartiteness.
If any invariant differs, the graphs cannot be isomorphic. However, matching invariants do not always prove isomorphism.
For example, and the disjoint union of two triangles both have six vertices, six edges, and degree sequence . They are not isomorphic because is connected, whereas the union of two triangles has two connected components. Therefore, equal degree sequences are necessary but not sufficient.
Let have edges and let have edges . Determine whether and are isomorphic. If they are, provide and verify an isomorphism.
Consider the mapping
This is a bijection between the vertex sets. We verify the images of all edges of :
- maps to .
- maps to .
- maps to .
- maps to .
- maps to .
Each image is an edge of . Moreover, these images account for all five edges of .
The degree sequences also agree:
- Vertex in and vertex in have degree .
- Vertices and their images have degree .
- Vertices and have degree .
Therefore, adjacency is preserved under , and
Define connectedness and connected components in an undirected graph. Prove that the relation defined by the existence of a path from to is an equivalence relation.
An undirected graph is connected if a path exists between every pair of vertices. A connected component is a maximal connected subgraph.
Define a relation on by
To prove that is an equivalence relation:
- Reflexive: Every vertex has a path of length to itself. Hence, .
- Symmetric: If a path exists from to , traversing the same edges in reverse order gives a path from to . Hence, implies .
- Transitive: If a path exists from to and another path exists from to , concatenating them gives a walk from to . Removing repeated portions produces a path, so .
Thus, is an equivalence relation. Its equivalence classes are precisely the connected components of the graph. A graph is connected exactly when this relation has only one equivalence class.
Define a cut vertex and a bridge. For the graph with edges , identify all cut vertices and bridges, giving reasons.
A cut vertex or articulation vertex is a vertex whose removal, together with its incident edges, increases the number of connected components. A bridge is an edge whose removal increases the number of connected components.
The edges form a triangle on , and form a triangle on . Edge joins the two triangles, while attaches the pendant vertex .
Cut vertices:
- Vertex : Removing it separates vertices from the rest of the graph.
- Vertex : Removing it separates the first triangle from vertices .
- Vertex : Removing it isolates vertex .
Therefore, the cut vertices are
Bridges:
- Edge is the only connection between the two triangular regions.
- Edge is the only edge incident with vertex .
Therefore, the bridges are
No edge belonging to either triangle is a bridge because an alternative path exists around the corresponding cycle.
Distinguish among strongly connected, unilaterally connected, and weakly connected digraphs. Classify the digraph with arcs and find its strongly connected components.
- A digraph is strongly connected if, for every pair of vertices and , there is a directed path from to and a directed path from to .
- It is unilaterally connected if, for every pair , there is a directed path from to or from to .
- It is weakly connected if replacing every directed arc by an undirected edge produces a connected undirected graph.
In the given digraph, lie on the directed cycle
so each of these vertices can reach the other two. Also, , so every vertex among can reach . However, has no outgoing path back to , , or .
Therefore:
- The digraph is not strongly connected.
- It is unilaterally connected, because for every pair involving , the other vertex can reach .
- It is also weakly connected.
Its strongly connected components are
Explain how an adjacency matrix represents a digraph. How can the in-degree, out-degree, directed walks, and reachability of vertices be obtained from the matrix?
For a digraph with vertices , its adjacency matrix is defined by
Unlike the adjacency matrix of an undirected graph, need not be symmetric.
- The out-degree of is the sum of row :
- The in-degree of is the sum of column :
- The entry gives the number of directed walks of length from to .
- Vertex is reachable from if for some with .
A reachability matrix can be obtained from the Boolean sum
where arithmetic is interpreted in the Boolean sense. A digraph is strongly connected when every entry of its reachability matrix is .
Describe Dijkstra's algorithm for finding single-source shortest paths. Give its main steps, explain the relaxation operation, and state its correctness condition.
Dijkstra's algorithm finds the shortest paths from a source vertex to all other vertices in a weighted graph whose edge weights are nonnegative.
Initialization:
- Set .
- Set for every .
- Set the predecessor of every vertex to undefined.
- Insert the vertices into a min-priority queue according to their tentative distances.
Main procedure:
- Extract an unsettled vertex having the smallest tentative distance.
- Mark as settled.
- For every outgoing edge of weight , perform relaxation.
- Continue until the queue is empty or all required vertices are settled.
Relaxation: If
update
and set the predecessor of to .
When a vertex is extracted with the minimum tentative distance, that distance is final because all edge weights are nonnegative. The predecessor links can be followed backward to reconstruct shortest paths.
With an adjacency list and a binary heap, the running time is
Apply Dijkstra's algorithm from source to the undirected weighted graph with edges , , , , , , and . Find all shortest distances and shortest paths.
Initialize
Step 1: Settle
- Through , set .
- Through , set .
Step 2: Settle , since it has the smallest tentative distance .
- Through , obtain , so update with predecessor .
- Through , set .
Step 3: Settle , with distance .
- Through , obtain , so update with predecessor .
- Through , set .
Step 4: Settle , with distance .
- Through , obtain , so update with predecessor .
Step 5: Settle , with distance .
The final results are:
| Vertex | Shortest distance from | Shortest path |
|---|---|---|
The vertices are settled in the order .
Explain why Dijkstra's algorithm requires nonnegative edge weights. Give a counterexample with a negative edge, outline the correctness argument for nonnegative weights, and compare common implementations.
Why nonnegative weights are required: Dijkstra's algorithm permanently settles the vertex with the smallest tentative distance. This decision is safe only if extending another path cannot later reduce that settled distance. Nonnegative weights guarantee this property.
Consider the directed weighted graph with edges
Dijkstra's algorithm may settle with distance before processing . However, the actual shortest path is
with total weight
Thus, a negative edge can invalidate a settled distance.
Correctness idea for nonnegative weights: Suppose is the unsettled vertex with minimum tentative distance. Any alternative path to through an unsettled vertex must first reach some unsettled vertex . Since and every remaining edge has nonnegative weight, continuing from cannot produce a path shorter than . Therefore, is final when is settled.
Complexities:
- Array or adjacency-matrix implementation: .
- Binary heap with adjacency lists: .
- Fibonacci heap: .
For graphs with negative edges but no reachable negative cycle, the Bellman-Ford algorithm should be used instead.
Define the following basic graph-theoretic terms with suitable examples: vertex, edge, order, size, adjacent vertices, incident edge, degree, isolated vertex, pendant vertex, loop, and parallel edges.
A graph is written as , where is the set of vertices and is the set of edges.
- Vertex: A fundamental point or node of a graph. For example, if , then , , and are vertices.
- Edge: A connection between two vertices. The edge joining and is denoted by or .
- Order: The number of vertices in the graph, namely .
- Size: The number of edges in the graph, namely .
- Adjacent vertices: Two vertices are adjacent if an edge joins them.
- Incident edge: An edge is incident with each of its endpoints.
- Degree: The degree is the number of edges incident with vertex . A loop contributes to the degree.
- Isolated vertex: A vertex of degree .
- Pendant vertex: A vertex of degree .
- Loop: An edge whose two endpoints are the same vertex.
- Parallel edges: Two or more distinct edges having the same pair of endpoints.
A graph without loops or parallel edges is called a simple graph.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →