- What is a weighted graph explain with an example?
- How do you know if a graph is weighted?
- Where is weighted graph used?
What is a weighted graph explain with an example?
A weighted graph is a graph in which each branch is given a numerical weight. A weighted graph is therefore a special type of labeled graph in which the labels are numbers (which are usually taken to be positive).
How do you know if a graph is weighted?
If edges in your graph have weights then your graph is said to be a weighted graph, if the edges do not have weights, the graph is said to be unweighted. A weight is a numerical value attached to each individual edge.
Where is weighted graph used?
Weighted graphs are used for applications where we need to take into account some cost or measurement between vertices of the graph. For example, the weights can represent the time it costs to travel from one location to another. Or, they can represent a measurement, such as the distance between the locations.