Weighted Graphs

This quiz will test your understanding of weighted graphs, including concepts such as weighted edges, adjacency matrices, and shortest paths.

14 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is a weighted graph?

  1. A graph in which each edge has a numerical value associated with it.
  2. A graph in which each vertex has a numerical value associated with it.
  3. A graph in which each edge has a color associated with it.
  4. A graph in which each vertex has a color associated with it.
Question 2 Multiple Choice (Single Answer)

What is an adjacency matrix?

  1. A matrix that represents the edges of a graph.
  2. A matrix that represents the vertices of a graph.
  3. A matrix that represents the weights of the edges of a graph.
  4. A matrix that represents the degrees of the vertices of a graph.
Question 3 Multiple Choice (Single Answer)

What is a shortest path?

  1. A path between two vertices in a graph with the smallest total weight.
  2. A path between two vertices in a graph with the largest total weight.
  3. A path between two vertices in a graph with the smallest number of edges.
  4. A path between two vertices in a graph with the largest number of edges.
Question 4 Multiple Choice (Single Answer)

Which algorithm is used to find the shortest path between two vertices in a weighted graph?

  1. Dijkstra's algorithm
  2. Prim's algorithm
  3. Kruskal's algorithm
  4. Floyd-Warshall algorithm
Question 5 Multiple Choice (Single Answer)

What is the time complexity of Dijkstra's algorithm?

  1. O(V^2)
  2. O(E log V)
  3. O(V log V)
  4. O(E)
Question 6 Multiple Choice (Single Answer)

Which algorithm is used to find the minimum spanning tree of a weighted graph?

  1. Dijkstra's algorithm
  2. Prim's algorithm
  3. Kruskal's algorithm
  4. Floyd-Warshall algorithm
Question 7 Multiple Choice (Single Answer)

What is the time complexity of Prim's algorithm?

  1. O(V^2)
  2. O(E log V)
  3. O(V log V)
  4. O(E)
Question 8 Multiple Choice (Single Answer)

Which algorithm is used to find the all-pairs shortest paths in a weighted graph?

  1. Dijkstra's algorithm
  2. Prim's algorithm
  3. Kruskal's algorithm
  4. Floyd-Warshall algorithm
Question 9 Multiple Choice (Single Answer)

What is the time complexity of Floyd-Warshall algorithm?

  1. O(V^2)
  2. O(E log V)
  3. O(V log V)
  4. O(E)
Question 10 Multiple Choice (Single Answer)

What is the difference between a weighted graph and an unweighted graph?

  1. In a weighted graph, each edge has a numerical value associated with it, while in an unweighted graph, each edge has a weight of 1.
  2. In a weighted graph, each vertex has a numerical value associated with it, while in an unweighted graph, each vertex has a weight of 1.
  3. In a weighted graph, each edge has a color associated with it, while in an unweighted graph, each edge has a color of black.
  4. In a weighted graph, each vertex has a color associated with it, while in an unweighted graph, each vertex has a color of black.
Question 11 Multiple Choice (Single Answer)

What is the difference between a directed weighted graph and an undirected weighted graph?

  1. In a directed weighted graph, the edges have a direction, while in an undirected weighted graph, the edges do not have a direction.
  2. In a directed weighted graph, the vertices have a direction, while in an undirected weighted graph, the vertices do not have a direction.
  3. In a directed weighted graph, the edges have a color, while in an undirected weighted graph, the edges do not have a color.
  4. In a directed weighted graph, the vertices have a color, while in an undirected weighted graph, the vertices do not have a color.
Question 12 Multiple Choice (Single Answer)

What is the difference between a simple weighted graph and a multigraph?

  1. In a simple weighted graph, each pair of vertices is connected by at most one edge, while in a multigraph, each pair of vertices can be connected by multiple edges.
  2. In a simple weighted graph, each vertex has a degree of at most 1, while in a multigraph, each vertex can have a degree greater than 1.
  3. In a simple weighted graph, each edge has a weight of 1, while in a multigraph, each edge can have a different weight.
  4. In a simple weighted graph, each vertex has a color, while in a multigraph, each vertex can have a different color.
Question 13 Multiple Choice (Single Answer)

What is the difference between a weighted graph and a network?

  1. In a weighted graph, the edges have weights, while in a network, the edges have capacities.
  2. In a weighted graph, the vertices have weights, while in a network, the vertices have capacities.
  3. In a weighted graph, the edges have colors, while in a network, the edges have labels.
  4. In a weighted graph, the vertices have colors, while in a network, the vertices have labels.
Question 14 Multiple Choice (Single Answer)

What is the difference between a weighted graph and a matroid?

  1. In a weighted graph, the edges have weights, while in a matroid, the edges have ranks.
  2. In a weighted graph, the vertices have weights, while in a matroid, the vertices have ranks.
  3. In a weighted graph, the edges have colors, while in a matroid, the edges have labels.
  4. In a weighted graph, the vertices have colors, while in a matroid, the vertices have labels.