Please answer A and B 1. Consider the following adjacency matrix representing vertices v through v^:...
03:25 pts) For the edge weight matrix assigned to you for a directed graph, determine the shortest path weights between any two vertices of the graph using the Floyd-Warshall algorithm. Show clearly the distance matrix and the predecessor matrix for each iteration Also, extract a path of length two or above between any two vertices of your choice. Clearly show the path extraction steps, as shown in the slides. V1 V1 9 V2 0 V3 3 w 85 V2 V3...
15 points) Consider the following vectors in R3 0 0 2 V1 = 1 ; V2 = 3 ; V3 = 1] ; V4 = -1;V5 = 4 1 2 3 = a) Are V1, V2, V3, V4, V5 linearly independent? Explain. b) Let H (V1, V2, V3, V4, V5) be a 3 x 5 matrix, find (i) a basis of N(H) (ii) a basis of R(H) (iii) a basis of C(H) (iv) the rank of H (v) the nullity...
Dijkstra’s Algorithm: You have to implement the Dijkstra’s algorithm and apply it on the graph provided below. You have to take the input from the user as an adjacency matrix representing the graph, the source, the destination. Then you have to apply the Dijkstra’s algorithm to find the shortest path from the source and the destination, and find the shortest route between the source and the destination. For the input you have to read it from a file. It will...
please answer one of the two 1. (25) [Single-source shortest-path: algorithm tracing] Show the tracing of Dijkstra's shortest path search algorithm on the weighted directed graph shown below. Do the tracing it twice, first starting with the nodes and, second, starting with the node z. For each tracing, each time the shortest path to a new node is determined, show the graph with the shortest path to the node clearly marked and show inside the node the shortest distance to...
8, (10 pts) Show that given a directed graph G = (V,E) already stored in adjacency matrix form, determining if there is a vertex with in-degree n - 1 and out-degree 0 can be done in O(n) time where n is the number of vertices in V. 8, (10 pts) Show that given a directed graph G = (V,E) already stored in adjacency matrix form, determining if there is a vertex with in-degree n - 1 and out-degree 0 can...
Consider the following graph: V4 V1 V2 V3 V5 and consider the following process: Initially, start at v1. • At ach time step, choose one of th and move there. vertices adjacent to your current location uniformly at random, Let pi(n), p2(n), p3(n), p4(n), p5(n) be the probability your location after n time steps is v1, V2, 03, 04, or V5 respectively. So pi(0) = 1 and p2(0) = P3(0) = p4(0) = p5(0) = 0. (a) Express pi(n+1), p2(n+1),...
4. Consider the matrix 0- 3 1 -2 1 4 (a) Use Matlab to determine the reduced row echelon form of A (b) If v, V2, vs, v4 are the column vectors of the matrix A, use your result from (a) to obtain a basis for the subspace of W-linsv1, V2, V3, V4. Write the basis in the box below 4. Consider the matrix 0- 3 1 -2 1 4 (a) Use Matlab to determine the reduced row echelon form...
[INPUT] First line number of vertex v adjacency matrix of graph Second v+1 line (If not connected, 1 If connected, weight on the edge) [OUTPUT First line For completed MST Second line Completed MST cost as a result of running dfs(0) [EXAMPLE] input,txt 7 -1 28 -1 -1 -1 10 -1 28 -1 16 -1 -1 -1 14 -1 16 -1 12 -1 -1 -1 -1 -1 12 -1 22 -1 18 -1 -1 -1 22 -1 25 24 10...
Note that for the following question you should use technology to do the matrix calculations. Consider a graph with the following adjacency matrix: 0100 0 1 110011 0 01 0 11 00 0 11 1 01 1 10 0 Assuming the nodes are labelled 1,2,3,4,5,6 in the same order as the rows and columns, answer the folllowing questions: (a) How many walks of length 2 are there from node 4 to itself? (b) How many walks of length 3 are...