What is a weighted graph?

Dijkstra Algorithm Questions



80 Short 62 Medium 80 Long Answer Questions Question Index

What is a weighted graph?

A weighted graph is a type of graph where each edge is assigned a numerical value or weight. This weight represents the cost or distance associated with traversing that edge. The weights can be positive or negative, and they are used to determine the shortest path or minimum cost between vertices in the graph.