diff --git a/jfgp3d7rrx0/index.html b/jfgp3d7rrx0/index.html index 5554c368..172a9d97 100644 --- a/jfgp3d7rrx0/index.html +++ b/jfgp3d7rrx0/index.html @@ -8,7 +8,7 @@ Consider an undirected graph with 5 vertices (V0,V1,V2,V3,V4)(V_0, V_1, V_2, V_3 in Dijkstra’s algorithm (starting from V0V_0), the current tentative distances are: dist={V0:0,V1:5,V2:3,V3:8,V4:10}dist = \{V_0:0, V_1:5, V_2:3, V_3:8, V_4:10\}. And the processed set is: {V0:True,V1:False,V2:False,V3:False,V4:False}\{V_0:True, V_1:False, V_2:False, V_3:False, V_4:False\}. Assuming the next step is to select an unvisited -vertex to mark as processed, which vertex will be chosen?'>

secret note jfgp3d7rrx0

There will be an explanation for non-trivial questions.

Activity 1

1

Dijkstra’s algorithm guarantees finding the shortest path from a single source to all other vertices under which of the following conditions?

Answer: All edge weights must be non-negative.

2

Consider an undirected graph with 5 vertices (V0,V1,V2,V3,V4)(V_0, V_1, V_2, V_3, V_4). At a certain point +vertex to mark as processed, which vertex will be chosen?'>

secret note jfgp3d7rrx0

There will be an explanation for non-trivial questions.

Activity 1

1

Dijkstra’s algorithm guarantees finding the shortest path from a single source to all other vertices under which of the following conditions?

Answer: All edge weights must be non-negative.

2

Consider an undirected graph with 5 vertices (V0,V1,V2,V3,V4)(V_0, V_1, V_2, V_3, V_4). At a certain point in Dijkstra’s algorithm (starting from V0V_0), the current tentative distances are: dist={V0:0,V1:5,V2:3,V3:8,V4:10}dist = \{V_0:0, V_1:5, V_2:3, V_3:8, V_4:10\}. And the processed set is: {V0:True,V1:False,V2:False,V3:False,V4:False}\{V_0:True, V_1:False, V_2:False, V_3:False, V_4:False\}. Assuming the next step is to select an unvisited @@ -80,4 +80,33 @@ there exists a negative cycle in the graph.

                    parent[v] = u
 
     return False
-

GA

\ No newline at end of file +

GA

1

At each step of Dijkstra’s algorithm, after a vertex has been processed, how does the algorithm determine which unvisited vertex to process next?

Answer: It picks the unvisited vertex that has the smallest current shortest distance from the source.

2

Which of the following statements correctly describes how the Bellman-Ford algorithm detects the presence of a negative cycle reachable from the source? Consider that V is the number of vertices in the graph.

Answer: If, during a Vth pass over all edges, any distance value can still be improved (i.e., an edge relaxation occurs).

3

A graph has 4 vertices (V1, V2, V3, V4) and the following edges:

If Bellman-Ford starts from V1, after running the algorithm for all necessary passes, how many vertices will have their shortest distance updated in the final (4-th) pass used for negative cycle detection?

Answer: 3

4

Consider any connected graph with 4 vertices and 6 edges, where all edge weights are distinct. In such a graph, the three edges with the smallest weights will always be part of its Minimum Spanning Tree (MST).

Answer: False

5

A graph can have a unique Minimum Spanning Tree (MST) only if all its edge weights are distinct

Answer: True

6

Suppose we run Prim’s algorithm and Kruskal’s algorithm on a graph G and these two algorithms +produce minimum-cost spanning trees TPT_P and TKT_K, respectively.

(I) TPT_P may be different from TKT_K if some pair of edges in G have the same weight.

(II) TPT_P is always the same as TKT_K if all edges in G have distinct weights.

Answer: Both (I) and (II) are correct.

7

Which one of the following can be the sequence of edges added, in that order, to create a minimum spanning tree using Kruskal’s algorithm?

Answers:

  1. (a,b) (d,f) (b,f) (d,c) (d,e)
  2. (a,b) (d,f) (d,c) (b,f) (d,e)
  3. (d,f) (a,b) (d,c) (b,f) (d,e)
  1. (d,f) (a,b) (b,f) (d,c) (d,e)

8

Consider the given weighted adjacency matrix ww for a complete undirected graph with vertex +set {0,1,2,3,4}\{0, 1, 2, 3, 4\}. Where w[i][j]w[i][j], iji \neq j in the matrix is the weight of the edge +(i,j)(i,j).

w=(018141012498120731470249320)w = \begin{pmatrix} +0 & 1 & 8 & 1 & 4 \\ +1 & 0 & 12 & 4 & 9 \\ +8 & 12 & 0 & 7 & 3 \\ +1 & 4 & 7 & 0 & 2 \\ +4 & 9 & 3 & 2 & 0 +\end{pmatrix}

What is the weight of the minimum spanning tree for the given graph?

Answer: 7

9

Which of the following statement(s) is/are true about the spanning tree of a connected graph?

Answers:

10

Consider the following weighted adjacency list WList for a directed and connected graph. What will be the path weight of the shortest path from 1 to 3?

WList = {
+  #source: [(destination, weight),...]
+  1: [(2, 10), (8, 8)],
+  2: [(6, 2)],
+  3: [(2, 1), (4, 1)],
+  4: [(5, 3)],
+  5: [(6, -1)],
+  6: [(3, -2)],
+  7: [(2, -4), (6, -1)],
+  8: [(7, 1)]
+}
+

Answer: 5

11

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Every entry W[i][j] where i≠j in the matrix W below is the weight of the edge from vertex i to vertex j.

w=(018141012498120731470249320)w = \begin{pmatrix} +0 & 1 & 8 & 1 & 4 \\ +1 & 0 & 12 & 4 & 9 \\ +8 & 12 & 0 & 7 & 3 \\ +1 & 4 & 7 & 0 & 2 \\ +4 & 9 & 3 & 2 & 0 +\end{pmatrix}

Answer: 4

12

In the given graph, if we try to find the shortest path from node a to all other nodes using Dijkstra’s algorithm, in what order do the nodes get included in the visited set?

Answer: a e d c b g f h

13

Consider the given graph. Which of the following is the correct sequence of edges added to the minimum spanning tree when Prim’s algorithm is applied on this graph with 5 as the source vertex?

Answer: [(5,1),(1,2),(2,3),(3,4)]

14

In the context of the Floyd-Warshall algorithm, what does it mean if the distance matrix has a negative value in its diagonal?

Answer: The graph has a negative-weight cycle.

15

Consider the graph G given. Let +α denote the number of minimum spanning trees of G and +β denote the weight of such a minimum spanning tree. The value of +α+β is

Answer: 14

\ No newline at end of file diff --git a/pagefind/fragment/en-us_bef7b43.pf_fragment b/pagefind/fragment/en-us_bef7b43.pf_fragment deleted file mode 100644 index 5346b600..00000000 Binary files a/pagefind/fragment/en-us_bef7b43.pf_fragment and /dev/null differ diff --git a/pagefind/fragment/en-us_e1c4bd5.pf_fragment b/pagefind/fragment/en-us_e1c4bd5.pf_fragment new file mode 100644 index 00000000..240034c9 Binary files /dev/null and b/pagefind/fragment/en-us_e1c4bd5.pf_fragment differ diff --git a/pagefind/index/en-us_2668ba2.pf_index b/pagefind/index/en-us_2668ba2.pf_index new file mode 100644 index 00000000..cb151154 Binary files /dev/null and b/pagefind/index/en-us_2668ba2.pf_index differ diff --git a/pagefind/index/en-us_3235f32.pf_index b/pagefind/index/en-us_3235f32.pf_index deleted file mode 100644 index ca3ea727..00000000 Binary files a/pagefind/index/en-us_3235f32.pf_index and /dev/null differ diff --git a/pagefind/index/en-us_3be3a5e.pf_index b/pagefind/index/en-us_3be3a5e.pf_index new file mode 100644 index 00000000..9b3fdf9c Binary files /dev/null and b/pagefind/index/en-us_3be3a5e.pf_index differ diff --git a/pagefind/index/en-us_3db2f6a.pf_index b/pagefind/index/en-us_3db2f6a.pf_index new file mode 100644 index 00000000..b099d33f Binary files /dev/null and b/pagefind/index/en-us_3db2f6a.pf_index differ diff --git a/pagefind/index/en-us_5840b7b.pf_index b/pagefind/index/en-us_5840b7b.pf_index deleted file mode 100644 index 96450ed2..00000000 Binary files a/pagefind/index/en-us_5840b7b.pf_index and /dev/null differ diff --git a/pagefind/index/en-us_651b4c6.pf_index b/pagefind/index/en-us_651b4c6.pf_index new file mode 100644 index 00000000..f8d02799 Binary files /dev/null and b/pagefind/index/en-us_651b4c6.pf_index differ diff --git a/pagefind/index/en-us_882a770.pf_index b/pagefind/index/en-us_882a770.pf_index deleted file mode 100644 index c488edbd..00000000 Binary files a/pagefind/index/en-us_882a770.pf_index and /dev/null differ diff --git a/pagefind/index/en-us_949fd1b.pf_index b/pagefind/index/en-us_949fd1b.pf_index deleted file mode 100644 index 8470206a..00000000 Binary files a/pagefind/index/en-us_949fd1b.pf_index and /dev/null differ diff --git a/pagefind/index/en-us_97d6256.pf_index b/pagefind/index/en-us_97d6256.pf_index new file mode 100644 index 00000000..d58657fc Binary files /dev/null and b/pagefind/index/en-us_97d6256.pf_index differ diff --git a/pagefind/index/en-us_bd67845.pf_index b/pagefind/index/en-us_bd67845.pf_index deleted file mode 100644 index f926f65a..00000000 Binary files a/pagefind/index/en-us_bd67845.pf_index and /dev/null differ diff --git a/pagefind/index/en-us_dc13e6f.pf_index b/pagefind/index/en-us_dc13e6f.pf_index new file mode 100644 index 00000000..f9601dbe Binary files /dev/null and b/pagefind/index/en-us_dc13e6f.pf_index differ diff --git a/pagefind/index/en-us_ec1c2c2.pf_index b/pagefind/index/en-us_ec1c2c2.pf_index deleted file mode 100644 index b23a65ae..00000000 Binary files a/pagefind/index/en-us_ec1c2c2.pf_index and /dev/null differ diff --git a/pagefind/pagefind-entry.json b/pagefind/pagefind-entry.json index 2245db69..365f9edb 100644 --- a/pagefind/pagefind-entry.json +++ b/pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.0.3","languages":{"en-us":{"hash":"en-us_fc2e4d403cd58","wasm":"en-us","page_count":56}}} \ No newline at end of file +{"version":"1.0.3","languages":{"en-us":{"hash":"en-us_c11118dc9fbec","wasm":"en-us","page_count":56}}} \ No newline at end of file diff --git a/pagefind/pagefind.en-us_c11118dc9fbec.pf_meta b/pagefind/pagefind.en-us_c11118dc9fbec.pf_meta new file mode 100644 index 00000000..3e2bd22b Binary files /dev/null and b/pagefind/pagefind.en-us_c11118dc9fbec.pf_meta differ diff --git a/pagefind/pagefind.en-us_fc2e4d403cd58.pf_meta b/pagefind/pagefind.en-us_fc2e4d403cd58.pf_meta deleted file mode 100644 index 118cb569..00000000 Binary files a/pagefind/pagefind.en-us_fc2e4d403cd58.pf_meta and /dev/null differ