Question: Problem 5 (8 marks) Given an weighted, undirected graph G=(V.E) in adjacency-list representation, a source vertex s V and a destination vertex t V, construct
Problem 5 (8 marks) Given an weighted, undirected graph G=(V.E) in adjacency-list representation, a source vertex s V and a destination vertex t V, construct a data structure such that the following queries can be answered in 0(1) time: Query (edge e): the query takes as input an edge e E, and outputs 1 if there exists a shortest path from s tot that uses edge e, else outputs 0. Explain in words (no pseudocode) (a) how to construct the above data structure, (b) the time required to construct the data structure, (c) the time required to answer queries
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
